:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --rail-w: 68px;
  --side-w: 320px;
  --detail-w: 400px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow-sm: 0 8px 18px rgba(26, 37, 64, 0.12);
  --shadow-lg: 0 24px 70px rgba(26, 37, 64, 0.2);
  --unread-badge-bg: linear-gradient(135deg, #ff6577 0%, #e11d48 100%);
  --unread-badge-shadow: rgba(225, 29, 72, 0.32);
  --unread-badge-ring: rgba(255, 255, 255, 0.82);
}

body[data-theme="aurora"] {
  color-scheme: light;
  --bg: #e9edf6;
  --rail: #f2f5fb;
  --rail-ink: #56627d;
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --surface-strong: #eef2f8;
  --ink: #1b2336;
  --muted: #56627d;
  --soft: #93a0b8;
  --line: #e3e8f2;
  --primary: #4f8cff;
  --primary-soft: #e8f0ff;
  --secondary: #7c6bff;
  --accent: #3aa0ff;
  --ok: #1aa97a;
  --warn: #b9791a;
  --danger: #e2566a;
  --unread-badge-bg: linear-gradient(135deg, #ff6b7d 0%, #e11d48 100%);
  --unread-badge-shadow: rgba(225, 29, 72, 0.28);
  --bubble-me: #e8f0ff;
  --bubble-other: #f1f4fa;
  --mention-user-bg: #e7f0ff;
  --mention-user-ink: #2f63c7;
  --mention-user-ring: rgba(79, 140, 255, 0.3);
  --mention-user-hover-bg: #dce9ff;
  --mention-all-bg: #fff0c2;
  --mention-all-ink: #9a5b00;
  --mention-all-ring: rgba(180, 112, 0, 0.36);
  --mention-all-hover-bg: #ffe6a3;
  --scrim: rgba(40, 52, 86, 0.32);
}

body[data-theme="teal"] {
  --bg: #f2fbf9;
  --rail: #10231f;
  --rail-ink: #d9f6f0;
  --surface: #ffffff;
  --surface-soft: #e9f6f3;
  --surface-strong: #d7ece8;
  --ink: #12302b;
  --muted: #5d756f;
  --soft: #82928f;
  --line: #cde2de;
  --primary: #0d9488;
  --primary-soft: #dcf7f2;
  --secondary: #2563eb;
  --accent: #ea580c;
  --ok: #087f5b;
  --warn: #a65f00;
  --danger: #c92f2f;
  --unread-badge-bg: linear-gradient(135deg, #f56565 0%, #c81e3a 100%);
  --unread-badge-shadow: rgba(200, 30, 58, 0.26);
  --bubble-me: #dff5ef;
  --bubble-other: #ffffff;
  --mention-user-bg: #ddf7f3;
  --mention-user-ink: #08786f;
  --mention-user-ring: rgba(13, 148, 136, 0.28);
  --mention-user-hover-bg: #cbf1eb;
  --mention-all-bg: #fff0c2;
  --mention-all-ink: #8f4e00;
  --mention-all-ring: rgba(166, 95, 0, 0.34);
  --mention-all-hover-bg: #ffe5a3;
  --scrim: rgba(16, 35, 31, 0.48);
}

body[data-theme="graphite"] {
  --bg: #f5f6f8;
  --rail: #1f2937;
  --rail-ink: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #eef0f3;
  --surface-strong: #e1e5ea;
  --ink: #182230;
  --muted: #667085;
  --soft: #8c95a1;
  --line: #d9dee7;
  --primary: #365d8f;
  --primary-soft: #e7eef7;
  --secondary: #0d9488;
  --accent: #b85f2e;
  --ok: #087f5b;
  --warn: #a65f00;
  --danger: #c92f2f;
  --unread-badge-bg: linear-gradient(135deg, #f56565 0%, #c81e3a 100%);
  --unread-badge-shadow: rgba(200, 30, 58, 0.26);
  --bubble-me: #e6eef7;
  --bubble-other: #ffffff;
  --mention-user-bg: #e6eef8;
  --mention-user-ink: #2f5f9d;
  --mention-user-ring: rgba(54, 93, 143, 0.3);
  --mention-user-hover-bg: #dce8f5;
  --mention-all-bg: #fff0c2;
  --mention-all-ink: #884d00;
  --mention-all-ring: rgba(166, 95, 0, 0.34);
  --mention-all-hover-bg: #ffe5a3;
  --scrim: rgba(24, 34, 48, 0.5);
}

body[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #070a12;
  --rail: #0a0e18;
  --rail-ink: #e8edf9;
  --surface: #121826;
  --surface-soft: #171f30;
  --surface-strong: #1e2740;
  --ink: #e8edf9;
  --muted: #9aa6c2;
  --soft: #5c6680;
  --line: #232c44;
  --primary: #5b9dff;
  --primary-soft: #18233f;
  --secondary: #7c6bff;
  --accent: #6ad6ff;
  --ok: #37e0a6;
  --warn: #ffcc6b;
  --danger: #ff6f7d;
  --unread-badge-bg: linear-gradient(135deg, #ff7b8b 0%, #ff3d5e 100%);
  --unread-badge-shadow: rgba(255, 61, 94, 0.38);
  --unread-badge-ring: rgba(255, 255, 255, 0.18);
  --bubble-me: #2f57c2;
  --bubble-other: #161d2e;
  --mention-user-bg: rgba(91, 157, 255, 0.18);
  --mention-user-ink: #9cc9ff;
  --mention-user-ring: rgba(91, 157, 255, 0.3);
  --mention-user-hover-bg: rgba(91, 157, 255, 0.26);
  --mention-all-bg: rgba(255, 204, 107, 0.2);
  --mention-all-ink: #ffd166;
  --mention-all-ring: rgba(255, 204, 107, 0.34);
  --mention-all-hover-bg: rgba(255, 204, 107, 0.28);
  --scrim: rgba(4, 7, 14, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body,
#chat-root {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.16s var(--ease-out),
    border-color 0.16s var(--ease-out),
    color 0.16s var(--ease-out),
    opacity 0.16s var(--ease-out),
    transform 0.16s var(--ease-out),
    box-shadow 0.16s var(--ease-out);
}

button:hover {
  border-color: var(--line);
  background: var(--primary-soft);
}

@supports (color: color-mix(in srgb, black, white)) {
  button:hover {
    border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
    background: color-mix(in srgb, var(--primary-soft), var(--surface) 40%);
  }
}

button:active {
  opacity: 0.78;
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 30%);
  outline-offset: 2px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 72px;
  resize: none;
  padding: 10px 12px;
  line-height: 1.55;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

p {
  line-height: 1.55;
}

small,
time {
  color: var(--muted);
  font-size: 12px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft), transparent 45%);
  background-clip: content-box;
}

.im-shell {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(288px, var(--side-w)) minmax(0, 1fr);
  background: var(--bg);
  overflow: hidden;
}

.im-shell.is-detail-open {
  grid-template-columns: var(--rail-w) minmax(292px, var(--side-w)) minmax(0, 1fr);
}

.app-rail,
.side-panel,
.workspace,
.context-panel {
  min-width: 0;
  min-height: 0;
}

.app-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 6px;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-button {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.brand-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rail-nav,
.rail-footer {
  display: grid;
  gap: 6px;
  align-content: start;
}

.rail-item {
  position: relative;
  width: 54px;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 3px;
  border-color: transparent;
  background: transparent;
  color: color-mix(in srgb, var(--rail-ink), transparent 15%);
}

.rail-item:hover,
.rail-item.is-active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 3px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
}

.rail-mark {
  font-size: 16px;
  font-weight: 800;
}

.rail-label {
  font-size: 10px;
}

.rail-badge {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.rail-user {
  position: relative;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
}

.presence-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--rail);
  border-radius: 999px;
  background: var(--soft);
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 10%);
  overflow: hidden;
}

.account-block,
.panel-search {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.account-block {
  display: grid;
  gap: 9px;
}

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

.account-copy,
.conversation-body,
.file-text,
.plain-row span,
.topbar-title,
.topbar-title div,
.profile-large div {
  min-width: 0;
}

.account-copy strong,
.conversation-body strong,
.file-text strong,
.plain-row strong,
.profile-large h2,
.profile-large h3 {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy span,
.conversation-body span,
.file-text small,
.plain-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.account-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.data-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), var(--surface) 86%);
  color: var(--primary);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.data-source-pill.is-mock {
  border-color: color-mix(in srgb, #f0b84a, transparent 55%);
  background: color-mix(in srgb, #f0b84a, var(--surface) 84%);
  color: color-mix(in srgb, #f0b84a, var(--ink) 34%);
}

.data-source-pill.is-live {
  border-color: color-mix(in srgb, var(--ok), transparent 56%);
  background: color-mix(in srgb, var(--ok), var(--surface) 88%);
  color: color-mix(in srgb, var(--ok), var(--ink) 30%);
}

.data-source-banner {
  width: calc(100% - 36px);
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 18px 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, #f0b84a, transparent 52%);
  border-radius: 12px;
  background: color-mix(in srgb, #f0b84a, var(--surface) 86%);
  color: color-mix(in srgb, #f0b84a, var(--ink) 28%);
  font-size: 12px;
  font-weight: 760;
}

.data-source-banner strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.data-source-topbar-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, #f0b84a, transparent 54%);
  border-radius: 999px;
  background: color-mix(in srgb, #f0b84a, var(--surface) 88%);
  color: color-mix(in srgb, #d29a2d, var(--ink) 28%);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  vertical-align: middle;
}

.status-button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok), transparent 65%);
  background: color-mix(in srgb, var(--ok), transparent 92%);
}

.theme-strip {
  display: flex;
  align-items: center;
  gap: 7px;
}

.theme-strip button {
  position: relative;
  width: 26px;
  min-width: 26px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  overflow: hidden;
}

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

.theme-strip button::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  background: var(--primary);
  box-shadow: inset -8px 0 0 var(--secondary), inset -16px 0 0 var(--accent);
}

.theme-strip button[data-theme-choice="teal"]::before {
  background: #0d9488;
  box-shadow: inset -8px 0 0 #2563eb, inset -16px 0 0 #ea580c;
}

.theme-strip button[data-theme-choice="graphite"]::before {
  background: #365d8f;
  box-shadow: inset -8px 0 0 #0d9488, inset -16px 0 0 #b85f2e;
}

.theme-strip button[data-theme-choice="midnight"]::before {
  background: #60a5fa;
  box-shadow: inset -8px 0 0 #2dd4bf, inset -16px 0 0 #fb923c;
}

.theme-strip button.is-active,
.filter-tabs button.is-active,
.context-tabs button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 750;
}

.search-field {
  position: relative;
  display: block;
}

.search-field span {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: transparent;
  width: 15px;
  height: 15px;
  border: 2px solid var(--soft);
  border-radius: 999px;
  pointer-events: none;
}

.search-field span::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  background: var(--soft);
  transform: rotate(45deg);
  border-radius: 999px;
}

.search-field input {
  padding-left: 38px;
  min-height: 38px;
}

.filter-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.filter-tabs button {
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.side-content,
.page-scroll,
.message-scroll,
.context-body,
.drawer-body {
  overflow: auto;
}

.side-content {
  padding: 8px 10px 12px;
}

.side-section-head {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  color: var(--muted);
}

.side-section-head strong {
  color: var(--ink);
}

.side-section-head button {
  min-height: 30px;
  padding: 0 9px;
}

.conversation-stack,
.plain-list,
.file-list,
.card-list {
  display: grid;
  gap: 6px;
}

.plain-list.compact {
  margin-top: 4px;
}

.conversation-card,
.plain-row,
.file-card {
  width: 100%;
  display: grid;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.conversation-card {
  align-items: center;
}

.conversation-body {
  min-width: 0;
  display: block;
}

.conversation-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  position: relative;
  min-height: 68px;
  padding: 8px 9px;
}

.plain-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 8px 9px;
}

.plain-row i,
.setting-nav-row i {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.file-card {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 64px;
  padding: 8px 9px;
}

.conversation-card:hover,
.conversation-card.is-active,
.plain-row:hover,
.plain-row.is-active,
.file-card:hover,
.file-card.is-active,
.member-card:hover {
  border-color: var(--line);
  background: var(--surface);
}

.conversation-card.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.line-one {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.line-two,
.line-three {
  margin-top: 2px;
}

.conversation-state b {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.conversation-state i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

.avatar-fallback,
.avatar img[data-avatar-image] {
  grid-area: 1 / 1;
}

.avatar img,
.directory-avatar img,
.signed-out-avatar img,
.rail-user img,
.incoming-avatar > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.avatar img[data-avatar-image],
.directory-avatar img[data-avatar-image],
.signed-out-avatar img[data-avatar-image],
.message-avatar img[data-avatar-image],
.detail-avatar img[data-avatar-image],
.incoming-avatar img[data-avatar-image] {
  visibility: hidden;
}

.avatar img[data-avatar-image].is-avatar-loaded,
.directory-avatar img[data-avatar-image].is-avatar-loaded,
.signed-out-avatar img[data-avatar-image].is-avatar-loaded,
.message-avatar img[data-avatar-image].is-avatar-loaded,
.detail-avatar img[data-avatar-image].is-avatar-loaded,
.incoming-avatar img[data-avatar-image].is-avatar-loaded {
  visibility: visible;
}

.avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.directory-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.signed-out-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.message-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.detail-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.incoming-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.rail-user > span:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback {
  visibility: hidden;
}

.avatar:has(img[data-avatar-image].is-avatar-loaded),
.avatar-soft:has(img[data-avatar-image].is-avatar-loaded),
.avatar-user:has(img[data-avatar-image].is-avatar-loaded),
.message-avatar:has(img[data-avatar-image].is-avatar-loaded),
.detail-avatar:has(img[data-avatar-image].is-avatar-loaded),
.directory-avatar:has(img[data-avatar-image].is-avatar-loaded),
.signed-out-avatar:has(img[data-avatar-image].is-avatar-loaded),
.incoming-avatar:has(img[data-avatar-image].is-avatar-loaded),
.contact-avatar-wrap .avatar-xl:has(img[data-avatar-image].is-avatar-loaded),
.conversation-card .avatar:has(img[data-avatar-image].is-avatar-loaded),
.conversation-avatar-wrap .avatar:has(img[data-avatar-image].is-avatar-loaded) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.avatar img.is-avatar-broken {
  display: none;
}

.avatar-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar-user {
  background: var(--secondary);
}

.avatar-xl {
  width: 62px;
  height: 62px;
  font-size: 22px;
}

.avatar.is-system {
  background: var(--accent);
}

.file-type {
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.pill,
.tag,
.status-pill,
.ok-chip,
.alert-chip,
.message-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
}

.pill,
.tag {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
}

.pill.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 65%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.status-pill,
.ok-chip {
  min-height: 28px;
  padding: 0 10px;
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok), transparent 62%);
  background: color-mix(in srgb, var(--ok), transparent 92%);
}

.status-pill[data-status="offline"] {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--muted), transparent 62%);
  background: color-mix(in srgb, var(--muted), transparent 92%);
}

.alert-chip {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: color-mix(in srgb, var(--bg), var(--surface) 8%);
}

.chat-workspace {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chat-top-stack {
  position: relative;
  z-index: 18;
  min-width: 0;
  display: grid;
}

.chat-top-stack:empty {
  display: none;
}

.workspace-topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 8%);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.hero-actions,
.button-row,
.message-actions,
.composer-footer,
.call-controls,
.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row.vertical {
  align-items: stretch;
  flex-direction: column;
}

.icon-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.detail-action {
  min-width: 56px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: color-mix(in srgb, var(--primary), #000 10%);
  color: #fff;
}

.danger-button {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 45%);
}

.danger-button:hover {
  background: color-mix(in srgb, var(--danger), transparent 91%);
}

.list-toggle {
  display: none;
}

.room-strip,
.conversation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 54%);
}

.room-strip-main,
.conversation-hero div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-strip span,
.conversation-hero span {
  color: var(--muted);
  font-size: 12px;
}

.room-strip strong {
  color: var(--ink);
  font-size: 12px;
}

.room-strip-main > span:first-child {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
}

.room-strip-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-strip-actions button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), transparent 18%);
}

.message-scroll {
  padding: 16px 24px 18px;
  overflow-anchor: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 38%), transparent 120px),
    color-mix(in srgb, var(--bg), var(--surface) 7%);
}

.message-flow {
  width: 100%;
  max-width: 980px;
  min-height: 100%;
  display: grid;
  align-content: start;
  margin: 0 auto;
}

.timeline-marker,
.system-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-marker {
  margin: 2px 0 14px;
}

.system-line {
  margin: 10px 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 42px;
}

.system-line span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.chat-history-skeleton {
  min-height: min(520px, 72vh);
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 8px 0 24px;
}

.chat-history-skeleton-row {
  width: min(520px, 82%);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.chat-history-skeleton-row.is-short {
  width: min(390px, 66%);
}

.chat-history-skeleton-row.is-me {
  width: min(460px, 74%);
  justify-self: end;
  grid-template-columns: minmax(0, 1fr);
}

.chat-history-skeleton-row i,
.chat-history-skeleton-row b {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--surface-soft), transparent 6%), color-mix(in srgb, var(--line), transparent 10%), color-mix(in srgb, var(--surface-soft), transparent 6%));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.1s linear infinite;
}

.chat-history-skeleton-row i {
  width: 32px;
  height: 32px;
}

.chat-history-skeleton-row.is-me i {
  display: none;
}

.chat-history-skeleton-row b {
  height: 58px;
  border-radius: 14px;
}

.message-virtual-spacer {
  width: 1px;
  min-height: 0;
  pointer-events: none;
}

@keyframes skeleton-shimmer {
  to { background-position: -220% 0; }
}

.message-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 680px);
  align-items: start;
  gap: 9px;
  margin-bottom: 12px;
  /* The virtual message window already bounds mounted rows. Placeholder
     heights here shift the reading anchor after a detail-panel width change. */
  animation: message-in 0.22s var(--ease-out);
}

.message-row.is-me {
  grid-template-columns: minmax(0, 680px);
  justify-content: end;
}

.message-scroll.is-restored-primary-view .message-row {
  animation: none;
}

.message-row > .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.message-stack {
  min-width: 0;
  display: grid;
  gap: 4px;
  position: relative;
}

.message-row.is-me .message-stack {
  justify-items: end;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bubble {
  max-width: min(680px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bubble-other);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink), transparent 94%);
}

.message-row.is-me .bubble {
  background: var(--bubble-me);
  border-color: color-mix(in srgb, var(--primary), var(--line) 70%);
}

.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.is-group-invite-approval-bubble {
  width: min(520px, 100%);
  padding: 0;
  overflow: hidden;
}

.group-invite-approval-card {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.group-invite-approval-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-invite-approval-head span {
  font-weight: 800;
  color: var(--ink);
}

.group-invite-approval-head em,
.group-invite-approval-result {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.group-invite-approval-result {
  display: grid;
  gap: 3px;
}

.group-invite-approval-result small {
  color: var(--ink-3);
}

.group-invite-approval-head em {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.group-invite-approval-head em[data-status="pending"] {
  color: #b7791f;
  border-color: rgba(245, 158, 11, .28);
  background: rgba(245, 158, 11, .12);
}

.group-invite-approval-head em[data-status="approved"] {
  color: #0f9f6e;
  border-color: rgba(16, 185, 129, .25);
  background: rgba(16, 185, 129, .12);
}

.group-invite-approval-head em[data-status="rejected"] {
  color: #e2566a;
  border-color: rgba(226, 86, 106, .28);
  background: rgba(226, 86, 106, .12);
}

.group-invite-approval-copy {
  display: grid;
  gap: 4px;
}

.group-invite-approval-copy strong {
  color: var(--ink);
  line-height: 1.45;
}

.group-invite-approval-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.group-invite-approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.bubble blockquote {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: var(--surface-soft);
}

.bubble blockquote b,
.bubble blockquote span {
  display: block;
  font-size: 12px;
}

.bubble blockquote span {
  color: var(--muted);
  margin-top: 2px;
}

.attachment-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  text-align: left;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 36%);
}

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

.attachment-card small {
  color: var(--muted);
}

.attachment-image-card {
  max-width: 100%;
  min-width: 0;
  display: block;
  padding: 8px;
}

.attachment-video-card {
  width: min(190px, 100%);
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

.attachment-image-card img {
  display: block;
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-soft);
}

.attachment-video-thumb {
  position: relative;
  display: block;
  aspect-ratio: var(--media-ratio, 16 / 9);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #080d18;
}

.attachment-video-thumb img,
.attachment-video-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.attachment-video-thumb i,
.media-play-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .48);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.attachment-video-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.attachment-video-info strong,
.attachment-video-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-video-meta {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.attachment-video-thumb i svg,
.media-play-dot svg {
  width: 20px;
  height: 20px;
}

.attachment-image-card span {
  display: block;
  margin-top: 8px;
}

.file-transfer-progress {
  position: relative;
  display: block;
  height: 18px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft), var(--line) 40%);
}

.file-transfer-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.file-transfer-progress em {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0 8px;
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-thumb {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
}

.media-file-thumb img,
.media-file-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-file-thumb.is-video .media-play-dot {
  width: 22px;
  height: 22px;
  background: rgba(5, 10, 22, .62);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}

.media-file-thumb.is-video video {
  position: absolute;
  inset: 0;
}

.media-file-thumb.is-video .media-play-dot svg {
  width: 12px;
  height: 12px;
}

.message-edited-mark {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong), transparent 18%);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.message-edited-mark time {
  color: inherit;
  font-size: 10.5px;
}

.message-row.is-me .message-edited-mark {
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .78);
}

.message-pinned-mark {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong), transparent 18%);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.message-row.is-me .message-pinned-mark {
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .78);
}

body[data-theme="aurora"] .message-row.is-me .message-edited-mark {
  background: rgba(255, 255, 255, .48);
  color: #53627f;
}

body[data-theme="aurora"] .message-row.is-me .message-pinned-mark {
  background: rgba(255, 255, 255, .48);
  color: #53627f;
}

.message-foot {
  display: grid;
  align-items: start;
  justify-items: start;
  gap: 3px;
  min-height: 20px;
}

.message-state {
  min-height: 22px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface-soft);
}

button.message-state {
  border: 0;
  cursor: pointer;
}

button.message-state:hover {
  color: var(--primary);
  text-decoration: underline;
  box-shadow: none;
}

.message-state[data-state="failed"] {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.message-actions button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
}

.message-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: min(460px, 100%);
  max-height: 0;
  margin-top: -2px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    max-height 0.16s var(--ease-out),
    margin-top 0.16s var(--ease-out),
    padding 0.16s var(--ease-out),
    opacity 0.14s var(--ease-out),
    transform 0.14s var(--ease-out),
    visibility 0.14s var(--ease-out);
}

.message-row:hover .message-actions,
.message-row:focus-within .message-actions,
.message-row.is-failed .message-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  max-height: 72px;
  margin-top: 1px;
  padding: 2px 0 0;
  transform: translateY(0);
}

.quick-reaction-bar {
  position: absolute;
  z-index: 5;
  top: -28px;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transition:
    opacity 0.14s var(--ease-out),
    transform 0.14s var(--ease-out);
}

.message-row:not(.is-me) .quick-reaction-bar {
  left: 0;
}

.message-row.is-me .quick-reaction-bar {
  right: 0;
}

.message-row:hover .quick-reaction-bar,
.message-row:focus-within .quick-reaction-bar {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.quick-reaction-bar button,
.reaction-strip button,
.emoji-grid button {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
}

.quick-reaction-bar button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.reaction-strip { display: flex; flex-wrap: wrap; }
.reaction-strip button { display: inline-flex; align-items: center; }

.composer-panel {
  padding: 10px 24px 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 6%);
}

.composer-shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 7px;
  margin: 0 auto;
}

.reply-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.reply-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
}

.reply-copy b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.reply-copy em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-bar button {
  min-height: 26px;
  flex: 0 0 auto;
}

.reply-clear-button {
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 40%);
}

.composer-toolbar,
.tool-dock {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.composer-tool,
.tool-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0 8px;
  background: var(--surface);
}

.composer-tool span,
.tool-button span {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: var(--primary-soft);
  font-weight: 800;
  color: var(--primary);
  font-size: 11px;
}

.composer-tool strong {
  font-size: 11px;
}

.composer-tool i,
.tool-button small,
.tool-button i {
  font-size: 11px;
  color: var(--muted);
  font-style: normal;
}

.composer-tool.is-pending,
.tool-button.is-pending {
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 45%);
}

.composer-tool.is-pending::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--soft);
}

.more-tool {
  border-style: dashed;
}

.composer-input textarea {
  min-height: 56px;
  max-height: 104px;
  background: var(--surface);
}

.composer-footer {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.emoji-popover {
  position: fixed;
  left: calc(var(--rail-w) + var(--side-w) + 28px);
  bottom: 124px;
  z-index: 60;
  width: min(440px, calc(100vw - 32px));
  height: min(420px, calc(100vh - 152px));
  min-height: 280px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  transform-origin: left bottom;
  contain: layout paint;
  animation: emoji-popover-in .16s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes emoji-popover-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.emoji-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.emoji-head strong {
  color: var(--ink);
}

.emoji-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.emoji-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-weight: 700;
}

.emoji-tabs button.is-active {
  color: var(--ink);
  background: var(--raise);
}

.emoji-picker-view {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
}

.emoji-picker-view button {
  padding: 0;
}

.emoji-picker-search {
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.emoji-picker-search:focus-within {
  border-color: color-mix(in srgb, var(--primary), var(--line) 42%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-soft), transparent 32%);
}

.emoji-picker-search input {
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.emoji-picker-search button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--raise);
}

.emoji-picker-categories {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.emoji-picker-categories::-webkit-scrollbar {
  display: none;
}

.emoji-picker-categories button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  filter: grayscale(.18);
}

.emoji-picker-categories button:hover,
.emoji-picker-categories button.is-active {
  background: var(--primary-soft);
  filter: none;
}

.emoji-picker-categories button.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 48%);
}

.emoji-picker-meta {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}

.emoji-virtual-viewport {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: 0;
  scrollbar-gutter: stable;
}

.emoji-virtual-grid {
  display: grid;
  grid-template-columns: repeat(var(--emoji-picker-columns, 8), minmax(0, 1fr));
  grid-auto-rows: 38px;
  align-content: start;
  gap: 5px;
}

.emoji-virtual-grid button {
  min-width: 0;
  min-height: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 22px;
  line-height: 1;
}

.emoji-virtual-grid button:hover,
.emoji-virtual-grid button:focus-visible {
  background: var(--primary-soft);
  transform: translateY(-1px) scale(1.04);
}

.emoji-picker-cell {
  position: relative;
  min-width: 0;
}

.emoji-picker-cell > [data-emoji-picker-item] {
  width: 100%;
}

.emoji-picker-cell .emoji-picker-variant-trigger {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--raise), transparent 8%);
  color: var(--muted);
  font-family: var(--font);
  font-size: 9px;
  line-height: 1;
}

.emoji-picker-variants {
  position: absolute;
  inset: auto 0 0;
  z-index: 4;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raise);
  box-shadow: var(--shadow-lg);
}

.emoji-picker-variants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
}

.emoji-picker-variants-head button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
}

.emoji-picker-variants-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-picker-variants-grid button {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 22px;
}

.emoji-picker-variants-grid button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.emoji-virtual-spacer {
  min-height: 0;
  pointer-events: none;
}

.emoji-picker-empty {
  min-height: 150px;
  padding: 24px 12px;
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
  color: var(--muted);
}

.emoji-picker-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.emoji-picker-empty span {
  font-size: 11px;
}

.emoji-grid {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  animation: emoji-panel-body-in .14s ease-out both;
}

@keyframes emoji-panel-body-in {
  from {
    opacity: .72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-grid button {
  min-height: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 20px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.emoji-grid button:hover {
  background: var(--primary-soft);
}

.sticker-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  display: grid;
  align-content: start;
  gap: 12px;
  animation: emoji-panel-body-in .14s ease-out both;
}

.sticker-section {
  display: grid;
  gap: 8px;
}

.sticker-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sticker-section-head span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.sticker-section-head strong {
  color: var(--ink);
  font-size: 13px;
}

.sticker-section-head small {
  color: var(--muted);
  font-size: 11px;
}

.sticker-section-actions {
  flex: 0 0 auto;
}

.sticker-section-actions button,
.sticker-actions button {
  min-width: 30px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ink-2);
  background: var(--surface-soft);
}

.sticker-section-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.sticker-section-actions svg,
.sticker-actions svg {
  width: 15px;
  height: 15px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sticker-card {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.sticker-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.sticker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sticker-thumb em {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(0, 0, 0, .52);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-card.is-active .sticker-thumb em {
  background: rgba(28, 151, 106, .82);
}

.sticker-card.is-processing .sticker-thumb {
  opacity: .72;
}

.sticker-card.is-uploading .sticker-thumb {
  border: 1px dashed rgba(99, 112, 255, .42);
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(99, 112, 255, .12), rgba(49, 196, 141, .1)),
    var(--surface-soft);
}

.sticker-card.is-uploading.is-failed .sticker-thumb {
  border-color: rgba(255, 108, 108, .48);
  color: var(--danger);
  background:
    linear-gradient(135deg, rgba(255, 108, 108, .12), rgba(255, 176, 84, .1)),
    var(--surface-soft);
}

.sticker-upload-percent {
  position: relative;
  z-index: 1;
  color: currentColor;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.sticker-card.is-busy {
  opacity: .7;
}

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

.sticker-actions button {
  padding: 0;
}

.sticker-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.sticker-inline-error,
.sticker-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.sticker-inline-error {
  color: var(--danger);
  text-align: left;
}

.sticker-empty.is-compact {
  padding: 8px;
}

@media (max-width: 720px) {
  .emoji-popover {
    left: 12px;
    right: 12px;
    bottom: 104px;
    width: auto;
    height: min(420px, calc(100vh - 128px));
  }

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

}

@media (prefers-reduced-motion: reduce) {
  .emoji-popover,
  .emoji-grid,
  .sticker-panel {
    animation: none;
  }
}

.emoji-grid.is-modal {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 16px;
}

.page-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}

.page-scroll {
  padding: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.content-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.content-stack {
  display: grid;
  gap: 14px;
}

.panel,
.feature-panel,
.file-preview,
.file-focus,
.rtc-stage,
.empty-state,
.error-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel,
.feature-panel,
.file-preview {
  padding: 16px;
}

.feature-panel,
.panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.profile-large {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.profile-large.compact {
  grid-template-columns: auto minmax(0, 1fr);
}

.profile-large p,
.muted {
  color: var(--muted);
}

.info-grid,
.info-list {
  display: grid;
  gap: 10px;
}

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

.info-grid > span,
.info-list > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.info-grid strong,
.info-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-user-id-button {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  height: 18px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: none;
  outline: 0;
  transform: none;
  contain: layout paint style;
  transition: color .12s ease;
}

.copy-user-id-button span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 18px;
}

.copy-user-id-button svg {
  width: 12px;
  height: 12px;
  min-width: 12px;
  flex: 0 0 12px;
  opacity: .58;
  color: currentColor;
}

.copy-user-id-button:hover,
.copy-user-id-button:focus-visible {
  color: var(--primary);
  outline: none;
}

.copy-user-id-button:focus-visible {
  box-shadow: none;
}

.info-grid strong:has(.copy-user-id-button),
.info-list strong:has(.copy-user-id-button),
.detail-kv strong:has(.copy-user-id-button),
.contact-info-grid strong:has(.copy-user-id-button) {
  width: auto;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button {
  height: auto;
  min-height: 0;
  gap: 6px;
  color: var(--primary);
  font-weight: 800;
  line-height: 1.35;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button span,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button span,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button span,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button span {
  line-height: 1.35;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button svg,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button svg,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button svg,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button svg {
  width: 13px;
  height: 13px;
  min-width: 13px;
  opacity: .7;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button:hover,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button:hover,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button:hover,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button:hover {
  color: var(--primary-strong);
}

.notice-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 38%);
}

.group-notice-box {
  gap: 12px;
  padding: 14px;
}

.notice-box-head,
.group-members-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notice-box-head strong,
.group-members-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.group-members-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
}

.group-members-head span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.group-members-head button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 92%);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.group-members-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.member-load-more {
  justify-self: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}

.group-member-row {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 52%);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.group-member-row:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 68%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 70%);
  transform: translateY(-1px);
}

.group-member-row .avatar {
  width: 36px;
  height: 36px;
}

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

.identity-avatar-presence,
.member-avatar-wrap,
.contact-avatar-wrap,
.conversation-avatar-wrap {
  position: relative;
}

.identity-avatar-presence {
  display: inline-flex;
  flex: 0 0 auto;
}

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

.group-member-row-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.group-member-row-copy small {
  color: var(--muted);
  font-size: 11px;
}

.group-member-row .role-badge {
  justify-self: end;
}

.group-manage-panel {
  gap: 14px;
}

.group-readonly-panel {
  align-content: start;
}

.file-preview,
.file-focus {
  display: grid;
  gap: 14px;
}

.file-focus {
  padding: 16px;
}

.file-focus-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.file-focus-foot p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.preview-canvas,
.modal-preview,
.preview-mini {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--primary), var(--line) 45%);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.preview-canvas {
  min-height: 360px;
}

.preview-canvas span,
.modal-preview span,
.preview-mini span {
  min-width: 68px;
  height: 68px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.rtc-stage {
  padding: 16px;
}

.video-grid {
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.video-grid div {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.video-grid span {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.call-controls {
  justify-content: center;
  padding-top: 14px;
}

.pane-head {
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 23, .5);
}

.pane-head h3 {
  flex: 1;
  color: var(--ink);
  font-size: 17px;
  font-weight: 660;
}

.pick {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink);
  font-size: 13px;
}

.pick svg {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.file-load-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.file-load-more button {
  min-width: 132px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
}

.file-load-more button:disabled {
  cursor: wait;
  color: var(--ink-3);
  opacity: .72;
}

.fcard {
  min-width: 0;
  min-height: 338px;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr auto;
  align-content: start;
  gap: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
  transition: transform .15s var(--ease-out), border-color .15s var(--ease-out), background .15s var(--ease-out);
}

.fcard:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, .04);
}

.fcard .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  border: 0;
  border-radius: 12px;
}

.fcard .thumb svg {
  width: 38px;
  height: 38px;
}

.fc-doc {
  background: var(--grad-soft);
  color: var(--brand);
}

.fc-img {
  background: linear-gradient(135deg, rgba(124, 107, 255, .25), rgba(106, 214, 255, .2));
  color: #cdd8ff;
}

.fc-video {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(33, 39, 63, .98), rgba(88, 102, 255, .24));
  color: #dbe4ff;
}

.fc-pdf {
  background: linear-gradient(135deg, rgba(255, 82, 82, .22), rgba(255, 138, 91, .18));
  color: #ffc7c0;
}

.fcard .thumb.has-media-thumb {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.fcard .thumb.has-media-thumb img,
.fcard .thumb.has-media-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fc-zip {
  background: linear-gradient(135deg, rgba(255, 138, 91, .22), rgba(255, 111, 125, .18));
  color: #ffb59b;
}

.fc-aud {
  background: linear-gradient(135deg, rgba(47, 211, 168, .22), rgba(63, 155, 255, .18));
  color: #9af0d6;
}

.fcard b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fmeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.file-download-status {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  color: var(--ink-3);
  font-size: 11.5px;
}

.file-download-status.is-cached {
  border-color: rgba(47, 211, 168, .22);
  color: var(--ok);
}

.file-download-status.is-busy {
  border-color: rgba(79, 140, 255, .24);
  color: var(--ink-2);
}

.file-download-status.is-failed {
  border-color: rgba(255, 107, 107, .24);
  color: var(--danger);
}

.file-download-status > i {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.file-download-status > i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--grad);
}

.file-download-status em {
  display: flex;
  gap: 6px;
  font-style: normal;
}

.file-download-status button {
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 11px;
}

.file-cache-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.file-cache-panel > div:first-child {
  display: grid;
  gap: 3px;
}

.file-cache-panel strong {
  color: var(--ink);
  font-size: 13px;
}

.file-cache-panel span,
.file-cache-panel small {
  color: var(--ink-3);
  font-size: 11.5px;
}

.file-cache-actions {
  display: flex;
  gap: 8px;
}

.file-cache-actions button {
  flex: 1;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 12px;
}

.wm {
  padding: 1px 6px;
  border: 1px solid rgba(255, 204, 107, .3);
  border-radius: 6px;
  color: var(--warn);
  font-size: 10px;
}

.frow {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.frow button {
  flex: 0 0 auto;
  min-width: 72px;
  max-width: 96px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 12px;
}

.frow button.pri {
  border: 0;
  background: var(--grad);
  color: #fff;
}

.stage {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(79, 140, 255, .18), transparent 60%),
    #070a12;
}

.stage-head {
  height: 60px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.stage-head h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 660;
}

.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
}

.timer .rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(255, 111, 125, .2);
}

.tiles {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(40, 50, 80, .5), rgba(20, 26, 44, .7));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.tile.main {
  grid-row: span 2;
  background: linear-gradient(135deg, rgba(79, 140, 255, .22), rgba(124, 107, 255, .16));
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .28), 0 18px 50px rgba(79, 140, 255, .18);
}

.big-av {
  width: 96px;
  height: 96px;
  border-radius: 30px;
  font-size: 34px;
}

.tile:not(.main) .big-av {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 26px;
}

.nm {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  font-size: 13px;
  backdrop-filter: blur(6px);
}

.ping {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  color: var(--ink-2);
  font-size: 11px;
}

.call-bar {
  height: 88px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 23, .6);
}

.cbtn {
  width: 54px;
  height: 54px;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raise);
  color: var(--ink);
}

.cbtn svg {
  width: 22px;
  height: 22px;
}

.cbtn.on {
  border: 0;
  background: var(--grad);
  color: #fff;
}

.cbtn.end {
  width: 64px;
  border: 0;
  background: linear-gradient(135deg, #ff6f7d, #ff4d62);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 77, 98, .4);
}

.rtc-idle-workspace .page-scroll {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 26px 28px;
}

.rtc-empty-panel {
  min-height: 320px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  padding: 34px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 50%);
  border-radius: 24px;
  background:
    radial-gradient(520px 240px at 84% 0%, color-mix(in srgb, var(--primary), transparent 78%), transparent 72%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 42%), var(--surface));
  box-shadow: 0 24px 70px rgba(79, 140, 255, .12);
}

.rtc-empty-visual {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 50%);
  border-radius: 36px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 20px 50px rgba(79, 140, 255, .28);
}

.rtc-empty-icon svg {
  width: 52px;
  height: 52px;
}

.rtc-empty-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.rtc-empty-copy .eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 760;
}

.rtc-empty-copy h2 {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
}

.rtc-empty-copy p:not(.eyebrow) {
  max-width: 660px;
  color: var(--ink-2);
  line-height: 1.75;
}

.rtc-empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rtc-empty-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raise);
  color: var(--ink);
  white-space: nowrap;
}

.rtc-empty-actions svg {
  width: 18px;
  height: 18px;
}

.rtc-recent-section {
  display: grid;
  gap: 12px;
}

.rtc-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.rtc-idle-workspace .rtc-recent-section {
  min-width: 0;
  container: rtc-contacts / inline-size;
}

.rtc-idle-workspace .rtc-record-grid {
  grid-template-columns: minmax(0, 1fr);
}

@container rtc-contacts (min-width: 560px) {
  .rtc-idle-workspace .rtc-record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container rtc-contacts (min-width: 860px) {
  .rtc-idle-workspace .rtc-record-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rtc-record-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

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

.rtc-record-card strong {
  color: var(--ink);
  font-size: 14px;
}

.rtc-record-card small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.rtc-record-card em {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 86%);
  color: var(--warn);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.rtc-record-card em.is-done {
  background: color-mix(in srgb, var(--ok), transparent 88%);
  color: var(--ok);
}

.rtc-record-card button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink);
}

.call-history-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.call-history-row em {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok), transparent 84%);
  color: var(--ok);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.call-history-row.is-ringing .avatar,
.rtc-record-card.is-ringing .avatar {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok), transparent 84%);
}

.rtc-call-workspace .page-scroll {
  display: grid;
  gap: 24px;
  padding: 28px 32px 30px;
}

.rtc-incoming-panel,
.rtc-live-panel {
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-radius: 24px;
  background:
    radial-gradient(520px 280px at 78% 8%, color-mix(in srgb, var(--primary), transparent 78%), transparent 72%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), var(--surface) 34%), var(--surface));
  box-shadow: 0 24px 70px rgba(79, 140, 255, .14);
}

.rtc-incoming-panel {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(132px, 160px) minmax(0, 1fr);
  grid-template-areas:
    "avatar copy"
    "actions actions";
  align-items: center;
  gap: 28px;
  padding: 36px;
}

.incoming-pulse-stage {
  grid-area: avatar;
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}

.incoming-pulse-stage .avatar {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  border-radius: 30px;
  background: var(--grad);
  box-shadow: 0 22px 50px rgba(79, 140, 255, .3);
}

.incoming-ring {
  position: absolute;
  inset: 18px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 28%);
  border-radius: 44px;
  animation: call-ring 1.9s var(--ease-out) infinite;
}

.incoming-ring.two {
  animation-delay: .55s;
}

.rtc-call-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.rtc-call-copy .eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 780;
}

.rtc-call-copy h2 {
  max-width: 100%;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.16;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.rtc-call-copy p:not(.eyebrow) {
  color: var(--ink-2);
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.rtc-caller-trust {
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 58%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-soft), transparent 24%);
}

.rtc-caller-trust svg {
  width: 18px;
  height: 18px;
  color: var(--primary-2);
}

.rtc-caller-trust strong {
  color: var(--ink);
  font-size: 13px;
}

.rtc-caller-trust span {
  color: var(--ink-3);
  font-size: 12px;
}

.rtc-incoming-accept-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 0;
  color: var(--primary-2);
  font-size: 14px;
  font-weight: 760;
}

.rtc-incoming-accept-status i {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid color-mix(in srgb, var(--primary-2), transparent 68%);
  border-top-color: var(--primary-2);
  border-radius: 999px;
  animation: rtc-accept-spin .75s linear infinite;
}

@keyframes rtc-accept-spin {
  to { transform: rotate(360deg); }
}

.rtc-call-actions {
  width: min(100%, 560px);
  min-width: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 12px;
}

.rtc-incoming-panel .rtc-call-actions {
  grid-area: actions;
}

.rtc-call-actions button,
.call-answer,
.call-end {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 760;
  white-space: nowrap;
}

.call-answer {
  background: linear-gradient(135deg, #19c88f, #36d399);
  box-shadow: 0 16px 34px rgba(25, 200, 143, .26);
}

.call-end {
  background: linear-gradient(135deg, #ff6475, #e83f58);
  box-shadow: 0 16px 34px rgba(232, 63, 88, .24);
}

.rtc-call-actions button:disabled,
.incoming-call-actions button:disabled {
  opacity: .56;
  cursor: wait;
  box-shadow: none;
}

.rtc-call-actions svg,
.call-answer svg,
.call-end svg {
  width: 18px;
  height: 18px;
}

.rtc-live-panel {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
  padding: 18px;
}

.rtc-live-duration {
  justify-self: center;
  min-width: 218px;
  min-height: 78px;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 16px;
  padding: 12px 28px 13px;
  border: 1px solid rgba(112, 165, 255, .36);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(35, 45, 70, .78), rgba(12, 18, 31, .72));
  color: var(--ink-2);
  box-shadow:
    0 18px 44px rgba(23, 52, 104, .34),
    inset 0 1px 0 rgba(255, 255, 255, .10);
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.rtc-live-duration span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding-right: 15px;
  border-right: 1px solid rgba(132, 180, 255, .22);
  color: #b8c4dc;
  font-size: 14px;
  font-weight: 780;
  line-height: 1;
}

.rtc-live-duration strong {
  color: #84b4ff;
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 860;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 10px 26px rgba(91, 157, 255, .28);
}

body[data-theme="aurora"] .rtc-live-duration {
  border-color: rgba(79, 140, 255, .36);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(243, 247, 255, .9));
  box-shadow:
    0 18px 40px rgba(79, 140, 255, .14),
    inset 0 1px 0 rgba(255, 255, 255, .86);
}

body[data-theme="aurora"] .rtc-live-duration span {
  border-right-color: rgba(79, 140, 255, .22);
  color: #5f6f90;
}

body[data-theme="aurora"] .rtc-live-duration strong {
  color: #4f82ff;
  text-shadow: 0 8px 22px rgba(79, 140, 255, .16);
}

.rtc-live-tile {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: default;
  transition: none;
}

.rtc-live-tile:hover,
.rtc-live-tile:focus,
.rtc-live-tile:focus-within,
.rtc-live-tile:active {
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  transform: none;
}

.rtc-live-tile.is-peer {
  background:
    radial-gradient(380px 240px at 50% 10%, color-mix(in srgb, var(--primary), transparent 68%), transparent 72%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft), var(--surface) 24%), var(--surface-soft));
}

.rtc-live-tile.is-peer:hover,
.rtc-live-tile.is-peer:focus,
.rtc-live-tile.is-peer:focus-within,
.rtc-live-tile.is-peer:active {
  background:
    radial-gradient(380px 240px at 50% 10%, color-mix(in srgb, var(--primary), transparent 68%), transparent 72%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft), var(--surface) 24%), var(--surface-soft));
}

.rtc-live-tile .avatar {
  width: 86px;
  height: 86px;
  border-radius: 28px;
}

.rtc-live-tile strong {
  color: var(--ink);
  font-size: 18px;
}

.rtc-live-tile small {
  color: var(--ink-2);
}

.rtc-live-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.incoming-call-notice {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #040a14;
}

.incoming-call-card {
  width: min(560px, 100%);
  min-height: min(480px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 36px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 42%);
  border-radius: 30px;
  background: #111827;
  color: var(--ink);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .5);
  animation: call-notice-in .24s var(--ease-out);
}

.incoming-call-main {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
}

.incoming-call-kicker {
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), var(--surface) 88%);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.incoming-avatar {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
}

.incoming-avatar > .incoming-avatar-core {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  min-width: 104px;
  min-height: 104px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: var(--grad);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.incoming-avatar i {
  position: absolute;
  inset: 0;
  border-radius: 38px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 24%);
  animation: call-ring 1.8s var(--ease-out) infinite;
}

.incoming-copy {
  display: block;
  min-width: 0;
}

.incoming-copy strong,
.incoming-copy small,
.incoming-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-copy strong {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}

.incoming-copy small {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.incoming-copy em {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 13px;
  font-style: normal;
}

.incoming-call-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.incoming-call-actions:has(.call-accept:only-child),
.incoming-call-actions:not(:has(.is-audio, .is-video)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.incoming-call-actions button {
  min-height: 62px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-weight: 760;
  line-height: 1;
  transition: transform .16s var(--ease-out), background-color .16s var(--ease-out), border-color .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}

.incoming-call-actions .call-decline {
  background: color-mix(in srgb, var(--danger), var(--surface) 82%);
  border-color: color-mix(in srgb, var(--danger), transparent 68%);
  color: var(--danger);
}

.incoming-call-actions .call-accept {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: color-mix(in srgb, var(--primary), transparent 38%);
  color: #fff;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary), transparent 72%);
  white-space: nowrap;
}

.incoming-call-actions .call-decline:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--danger), var(--surface) 72%);
  border-color: color-mix(in srgb, var(--danger), transparent 44%);
  color: color-mix(in srgb, var(--danger), #7f1020 18%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--danger), transparent 84%);
}

.incoming-call-actions .call-accept:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary), #fff 8%), color-mix(in srgb, var(--secondary), #fff 6%));
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary), transparent 64%);
}

.incoming-call-actions .call-decline:active,
.incoming-call-actions .call-accept:active {
  transform: translateY(0);
}

.incoming-call-actions .call-decline:focus-visible,
.incoming-call-actions .call-accept:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 72%);
  outline-offset: 3px;
}

.incoming-call-actions svg {
  width: 17px;
  height: 17px;
}

.incoming-call-actions .call-accept svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.incoming-call-actions .call-decline svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

body[data-theme="aurora"] .incoming-call-card {
  background: #fff;
  box-shadow: 0 22px 48px rgba(37, 65, 118, .16);
}

body[data-theme="aurora"] .incoming-call-actions .call-decline {
  background: #fff0f3;
  border-color: #ffc6d1;
  color: #e84d62;
}

body[data-theme="aurora"] .incoming-call-actions .call-decline:hover {
  background: #ffdfe6;
  border-color: #ff9daf;
  color: #d9364d;
  box-shadow: 0 14px 28px rgba(232, 77, 98, .18);
}

body[data-theme="aurora"] .incoming-call-actions .call-accept:hover {
  box-shadow: 0 16px 34px rgba(45, 167, 116, .24);
}

body[data-theme="midnight"] .incoming-call-actions .call-decline {
  background: rgba(255, 111, 125, .16);
  border-color: rgba(255, 111, 125, .34);
  color: #ff8796;
}

body[data-theme="midnight"] .incoming-call-actions .call-decline:hover {
  background: rgba(255, 111, 125, .24);
  border-color: rgba(255, 111, 125, .56);
  color: #ffd7dd;
  box-shadow: 0 14px 30px rgba(255, 85, 105, .16);
}

body[data-theme="midnight"] .incoming-call-actions .call-accept {
  box-shadow: 0 16px 36px rgba(91, 157, 255, .24);
}

body[data-theme="midnight"] .incoming-call-actions .call-accept:hover {
  border-color: rgba(103, 214, 166, .52);
  box-shadow: 0 18px 38px rgba(52, 211, 153, .22);
}

.im-shell .incoming-call-actions .call-decline:hover,
.im-shell .incoming-call-actions .call-decline:focus-visible {
  background: linear-gradient(135deg, #ff7080, #ee5066) !important;
  border-color: color-mix(in srgb, #ff8b98, transparent 18%) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(238, 80, 102, .24) !important;
}

.im-shell .incoming-call-actions .call-accept:hover,
.im-shell .incoming-call-actions .call-accept:focus-visible {
  background: linear-gradient(135deg, #35d59b, #4fd18f) !important;
  border-color: color-mix(in srgb, #56daa0, transparent 18%) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(53, 213, 155, .24) !important;
}

.im-shell .rtc-call-actions .call-end:hover,
.im-shell .rtc-call-actions .call-end:focus-visible,
.im-shell .call-end:hover,
.im-shell .call-end:focus-visible {
  background: linear-gradient(135deg, #ff7080, #e83f58) !important;
  border-color: color-mix(in srgb, #ff8b98, transparent 20%) !important;
  color: #fff !important;
  box-shadow: 0 18px 38px rgba(232, 63, 88, .26) !important;
}

.im-shell .rtc-call-actions .call-answer:hover,
.im-shell .rtc-call-actions .call-answer:focus-visible,
.im-shell .call-answer:hover,
.im-shell .call-answer:focus-visible {
  background: linear-gradient(135deg, #19c88f, #3ed99f) !important;
  border-color: color-mix(in srgb, #55deb0, transparent 18%) !important;
  color: #fff !important;
  box-shadow: 0 18px 38px rgba(25, 200, 143, .28) !important;
}

.im-shell .incoming-call-actions .call-decline:active,
.im-shell .incoming-call-actions .call-accept:active,
.im-shell .rtc-call-actions .call-end:active,
.im-shell .rtc-call-actions .call-answer:active {
  transform: translateY(0) scale(.98);
}

@keyframes call-ring {
  0% {
    opacity: .85;
    transform: scale(.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes call-notice-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 920px) {
  .incoming-call-notice {
    place-items: end center;
    padding: 0;
  }

  .incoming-call-card {
    width: 100%;
    min-height: min(640px, 72vh);
    padding: 30px 24px calc(24px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 30px 30px 0 0;
  }

  .incoming-call-main {
    gap: 16px;
  }

  .incoming-call-actions {
    justify-content: stretch;
  }

  .incoming-call-actions button {
    min-height: 58px;
  }
}

@media (max-width: 480px) {
  .incoming-call-card {
    min-height: min(620px, 78vh);
    gap: 18px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .incoming-avatar {
    width: 104px;
    height: 104px;
  }

  .incoming-avatar > .incoming-avatar-core {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    border-radius: 28px;
  }

  .incoming-call-actions button {
    min-height: 56px;
    padding: 0 10px;
    font-size: 12px;
  }

  .rtc-incoming-panel,
  .rtc-live-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .rtc-incoming-panel {
    grid-template-areas:
      "avatar"
      "copy"
      "actions";
  }

  .rtc-incoming-panel .incoming-pulse-stage,
  .rtc-incoming-panel .rtc-call-copy {
    justify-self: center;
  }

  .rtc-incoming-panel .rtc-call-copy {
    text-align: center;
  }

  .rtc-call-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .incoming-ring,
  .incoming-avatar i {
    animation: none;
  }

  .incoming-call-card {
    animation: none;
  }
}

.settings-workspace .page-scroll {
  padding: 0;
}

.set-pane {
  width: min(760px, calc(100% - 60px));
  max-width: 760px;
  padding: 28px 32px;
}

.settings-pane-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.settings-pane-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(124, 140, 255, .24);
  border-radius: 15px;
  background: var(--grad-soft);
  color: #fff;
  box-shadow: 0 12px 28px rgba(79, 140, 255, .12);
}

.settings-pane-icon svg {
  width: 23px;
  height: 23px;
}

.set-pane h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 680;
}

.set-pane .lead {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13px;
}

.set-group {
  margin-top: 24px;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
}

.set-group .gl {
  padding: 14px 0 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.set-row:first-of-type {
  border-top: 0;
}

.set-row .sr-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.set-row .sr-body b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 560;
}

.set-row .sr-body p {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

button.set-row.legal-document-row {
  width: 100%;
  min-height: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

button.set-row.legal-document-row:hover,
button.set-row.legal-document-row:focus-visible {
  background: var(--surface-soft);
}

.legal-document-row .sr-body > span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.legal-document-affordance {
  flex: none;
  pointer-events: none;
}

.set-row.is-policy .sr-body p {
  color: var(--ink-2);
}

.setting-status {
  flex: none;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
}

.setting-status.is-ok {
  border-color: rgba(55, 224, 166, .32);
  background: rgba(55, 224, 166, .08);
  color: var(--ok);
}

.device-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.device-card:first-of-type {
  border-top: 0;
}

.device-card b,
.device-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card b {
  color: var(--ink);
  font-size: 14px;
}

.device-card p {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.device-card-copy {
  min-width: 0;
}

.device-card-copy p {
  display: flex;
  align-items: center;
  gap: 7px;
}

.device-card-copy p span,
.device-card-copy p code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card-copy p code {
  max-width: min(280px, 42vw);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font: 500 11px/1.3 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.danger-pick {
  color: var(--bad);
}

.device-remove-trigger {
  border-color: color-mix(in srgb, var(--bad) 34%, var(--line));
  background: color-mix(in srgb, var(--bad) 7%, transparent);
  font-weight: 680;
}

.device-remove-trigger:hover,
.device-remove-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--bad) 58%, var(--line));
  background: color-mix(in srgb, var(--bad) 13%, transparent);
}

.device-removal-dialog-layer {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, #060912 72%, transparent);
  backdrop-filter: blur(8px);
  animation: scrim-in .16s var(--ease-out);
}

.device-removal-dialog {
  width: min(500px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 40px));
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--bad) 24%, var(--line-2));
  border-radius: 22px;
  background:
    radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--bad) 11%, transparent), transparent 68%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #fff 4%), var(--surface));
  color: var(--ink);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .48), 0 0 0 1px color-mix(in srgb, var(--bad) 7%, transparent);
  animation: dialog-in .18s var(--ease-out);
}

.device-removal-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
}

.device-removal-dialog__heading {
  min-width: 0;
}

.device-removal-dialog__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--bad);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
}

.device-removal-dialog__heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 760;
  line-height: 1.25;
}

.device-removal-dialog__close {
  flex: none;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
}

.device-removal-dialog__body {
  display: grid;
  gap: 16px;
  padding: 0 22px 22px;
}

.device-removal-dialog__description {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
}

.device-removal-dialog__device {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
}

.device-removal-dialog__device-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 13px;
  background: var(--grad-soft);
  color: #fff;
  font-size: 14px;
  font-weight: 760;
}

.device-removal-dialog__device-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.device-removal-dialog__device-copy strong,
.device-removal-dialog__device-copy span,
.device-removal-dialog__device-copy code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-removal-dialog__device-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.device-removal-dialog__device-copy span {
  color: var(--ink-3);
  font-size: 12px;
}

.device-removal-dialog__device-copy code {
  color: var(--ink-2);
  font: 500 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.device-removal-dialog__status {
  justify-self: end;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line));
  border-radius: 999px;
  color: var(--ok);
  font-size: 11px;
  font-weight: 680;
}

.device-removal-dialog__warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 24%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--bad) 7%, transparent);
  color: color-mix(in srgb, var(--bad) 78%, var(--ink));
  font-size: 12px;
  line-height: 1.5;
}

.device-removal-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
}

.device-removal-dialog__footer button {
  min-width: 112px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
}

.device-removal-dialog__cancel {
  border: 1px solid var(--line-2);
  background: var(--surface-soft);
  color: var(--ink);
}

.device-removal-dialog__confirm {
  border: 1px solid color-mix(in srgb, var(--bad) 72%, #fff 8%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bad) 88%, #fff 12%), var(--bad));
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--bad) 28%, transparent);
}

.device-removal-dialog__close:focus-visible,
.device-removal-dialog__cancel:focus-visible,
.device-removal-dialog__confirm:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 52%, transparent);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .device-removal-dialog-layer {
    place-items: end center;
    padding: 12px;
  }

  .device-removal-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .device-removal-dialog__header {
    padding: 19px 18px 14px;
  }

  .device-removal-dialog__body {
    padding: 0 18px 18px;
  }

  .device-removal-dialog__device {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .device-removal-dialog__status {
    grid-column: 2;
    justify-self: start;
  }

  .device-removal-dialog__footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 18px 18px;
  }

  .device-removal-dialog__footer button {
    min-width: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-removal-dialog-layer,
  .device-removal-dialog {
    animation: none;
  }
}

.theme-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-cards button {
  min-height: 84px;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 12px;
}

.theme-cards button span {
  width: 100%;
  height: 24px;
  border-radius: 6px;
  background: var(--primary);
  border-right: 48px solid var(--secondary);
  box-shadow: inset -96px 0 0 var(--accent);
}

.theme-cards button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.context-scrim {
  position: fixed;
  z-index: 54;
  inset: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--scrim);
  cursor: default;
  animation: scrim-in 0.18s var(--ease-out);
}

.list-scrim {
  display: none;
}

.context-scrim:hover {
  background: var(--scrim);
}

.context-panel {
  position: fixed;
  z-index: 55;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--detail-w), calc(100vw - var(--rail-w)));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(104%);
  transition:
    transform 0.24s var(--ease-out),
    opacity 0.18s var(--ease-out);
}

.im-shell.is-detail-open .context-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.context-head {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.context-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.context-tabs {
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.context-tabs button {
  min-height: 30px;
  padding: 0 6px;
  font-size: 12px;
}

.context-body {
  padding: 14px;
}

.context-section {
  display: grid;
  gap: 14px;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 10px 10px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.activity-item b,
.activity-item span,
.activity-item small {
  min-width: 0;
}

.activity-item span {
  overflow-wrap: anywhere;
  color: var(--ink);
}

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

.member-list-actions {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 0 0 8px;
  background: linear-gradient(180deg, var(--surface) 72%, transparent);
}

.member-list-actions button {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 11px;
}

.member-card {
  min-width: 0;
  min-height: 108px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
}

.member-card-copy,
.context-member-copy,
.detail-member-copy {
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: stretch;
  gap: 4px;
}

.member-card-copy .identity-name-line,
.context-member-copy .identity-name-line,
.detail-member-copy .identity-name-line {
  width: 100%;
}

.member-card-copy .identity-metadata-line {
  justify-content: center;
}

.member-card .member-avatar-wrap,
.member-card .avatar {
  min-width: 0;
}

.member-card strong,
.member-card small,
.member-card .role-badge {
  max-width: 100%;
  min-width: 0;
}

.member-card strong,
.member-card small,
.member-card .role-badge span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card strong {
  width: auto;
  text-align: center;
}

.switch-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row.is-permission-blocked > span {
  color: var(--ink-3);
}

.switch {
  width: 42px;
  min-width: 42px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  border-color: var(--line);
  background: var(--surface-strong);
}

.switch::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--surface);
  transition: margin 0.16s ease, background 0.16s ease;
}

.switch.is-on {
  background: var(--primary);
  border-color: var(--primary);
}

.switch.is-permission-blocked {
  cursor: not-allowed;
  opacity: .58;
  filter: grayscale(.18) saturate(.75);
}

.switch.is-permission-blocked:hover {
  transform: none;
  box-shadow: none;
}

.switch.is-on::before {
  margin-left: 20px;
}

.tag-row {
  gap: 6px;
}

.empty-state,
.error-state,
.loading-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.empty-state p,
.error-state p {
  color: var(--muted);
}

.error-state {
  border-color: color-mix(in srgb, var(--danger), var(--line) 45%);
  background: color-mix(in srgb, var(--danger), transparent 94%);
}

.chat-top-stack > .connection-recovery {
  min-height: 0;
  margin: 8px 12px 0;
  padding: 10px 12px;
}

.connection-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.connection-recovery-actions .connection-recovery-logout {
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.connection-recovery-actions .connection-recovery-logout:hover,
.connection-recovery-actions .connection-recovery-logout:focus-visible {
  color: var(--ink);
}

.loading-state span {
  width: min(420px, 80%);
  height: 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  animation: pulse 1.2s ease-in-out infinite;
}

.menu-popover {
  position: fixed;
  z-index: 50;
  top: 64px;
  right: auto;
  left: 18px;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--ink), transparent 86%);
  animation: pop-in 0.14s var(--ease-out);
}

.menu-popover button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  justify-content: start;
  text-align: left;
  border-color: transparent;
  background: transparent;
}

.menu-popover button svg {
  width: 17px;
  height: 17px;
  color: var(--ink-2);
}

.menu-popover button span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-create-popover {
  width: 224px;
  padding: 7px;
  border-radius: 16px;
}

.quick-create-popover button {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 54px;
  padding: 9px 10px;
  border-radius: 12px;
}

.quick-create-popover button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 68%);
  background: color-mix(in srgb, var(--primary), transparent 91%);
}

.quick-create-popover button svg {
  width: 19px;
  height: 19px;
  justify-self: center;
  color: var(--primary);
}

.quick-create-popover button span {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.quick-create-popover button strong,
.quick-create-popover button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-create-popover button strong {
  color: var(--ink);
  font-size: 13px;
}

.quick-create-popover button small {
  color: var(--ink-3);
  font-size: 11px;
}

.overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: var(--scrim);
  animation: scrim-in 0.18s var(--ease-out);
}

.modal-layer {
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card,
.drawer-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  animation: dialog-in 0.2s var(--ease-out);
}

.modal-card.wide {
  width: min(760px, 100%);
}

.modal-card.compact {
  width: min(420px, 100%);
}

.modal-card.reaction-modal {
  width: min(440px, 100%);
  height: min(600px, calc(100vh - 36px));
  height: min(600px, calc(100dvh - 36px));
  grid-template-rows: auto minmax(0, 1fr);
}

.reaction-modal header {
  align-items: center;
  padding: 14px 16px 12px;
}

.reaction-modal header h2 {
  margin: 0;
  font-size: 16px;
}

.reaction-modal .emoji-grid.is-modal {
  padding: 12px 16px 16px;
  gap: 10px;
}

.reaction-modal .emoji-grid button {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
}

.reaction-modal .emoji-picker-view {
  min-width: 0;
  overflow: hidden;
  padding: 12px 16px 16px;
}

.reaction-modal .emoji-picker-view.is-fallback {
  grid-template-rows: auto minmax(0, 1fr);
}

.reaction-modal .emoji-picker-search:focus-within {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.reaction-modal .emoji-virtual-viewport {
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: auto;
  /* Keep the fixed-width native scrollbar on Chromium/macOS, rather than
     switching it to a transient overlay through scrollbar-color. */
  scrollbar-color: auto;
}

.reaction-modal .emoji-virtual-viewport::-webkit-scrollbar {
  width: 14px;
}

.reaction-modal .emoji-virtual-viewport::-webkit-scrollbar-thumb {
  min-height: 32px;
  border-width: 3px;
  background-color: color-mix(in srgb, var(--muted), transparent 25%);
}

.reaction-modal .emoji-picker-cell,
.reaction-modal .emoji-virtual-grid > button {
  width: 38px;
  max-width: 100%;
  justify-self: center;
}

.reaction-modal :is(.emoji-grid, .emoji-virtual-grid, .emoji-picker-categories, .emoji-picker-variants) button {
  transform: none;
  transition: background-color .15s, box-shadow .15s;
}

.reaction-modal :is(.emoji-grid, .emoji-virtual-grid, .emoji-picker-categories, .emoji-picker-variants) button:hover {
  background: var(--primary-soft);
  transform: none;
}

.reaction-modal :is(.emoji-grid, .emoji-virtual-grid, .emoji-picker-categories, .emoji-picker-variants) button:focus-visible,
.reaction-modal .emoji-virtual-viewport:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}

.reaction-modal .emoji-picker-categories button.is-active,
.reaction-modal .emoji-picker-variants button[aria-pressed="true"] {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.modal-card.read-modal {
  width: min(620px, 100%);
}

.modal-card header,
.drawer-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-card header p,
.drawer-card header p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.modal-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.modal-card.account-modal {
  width: min(480px, calc(100vw - 28px));
}

.account-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.account-profile-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background:
    radial-gradient(180px 90px at 0% 0%, color-mix(in srgb, var(--primary), transparent 78%), transparent 70%),
    color-mix(in srgb, var(--surface-soft), var(--surface) 32%);
}

.account-profile-card .avatar {
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary), transparent 72%);
}

.account-avatar-edit-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.account-name-block {
  min-width: 0;
  display: grid;
  align-items: start;
  gap: 5px;
}

.account-name-block h3 {
  min-width: 0;
}

.account-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.account-name-row .identity-name-line {
  flex: 0 1 auto;
  width: auto;
  max-width: calc(100% - 33px);
}

.account-certification-line {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
}

.account-certification-line > .certification-name-slot {
  flex: 1 1 auto;
  max-width: 100%;
}

.account-certification-line .verification-badge {
  max-width: 100%;
}

.account-profile-edit-button.group-edit-icon-button {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.account-profile-edit-button.group-edit-icon-button svg {
  width: 13px;
  height: 13px;
}

.account-profile-card h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.account-profile-card p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 62%);
  border-radius: 999px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.account-status.is-warn {
  border-color: color-mix(in srgb, var(--warn), transparent 55%);
  color: var(--warn);
}

.account-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.account-info-list > span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 18%);
}

.account-info-list small {
  color: var(--ink-3);
  font-size: 11.5px;
}

.account-info-list strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-invite-card{min-width:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--surface-soft),transparent 12%)}
.account-invite-copy{flex:1 1 150px;min-width:0;display:grid;gap:5px}
.account-invite-card small{color:var(--ink-3);font-size:11.5px}
.account-invite-copy strong{min-width:0;display:flex;align-items:center;gap:6px;color:var(--ink);font-size:14px;font-weight:760;line-height:1.45}
.account-invite-copy strong>span{min-width:0;overflow-wrap:anywhere}
.account-invite-card.is-ok{border-color:color-mix(in srgb,var(--primary),transparent 62%);background:color-mix(in srgb,var(--primary),transparent 91%)}
.account-invite-card.is-warn strong{color:var(--warn)}
.account-invite-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto}
.account-invite-actions .soft-button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:76px;height:32px;min-height:32px;padding:0 10px;border-radius:8px;font-size:12px;line-height:1;white-space:nowrap}
.account-invite-actions .soft-button svg{width:14px;height:14px;flex:none}
.account-invite-card .account-invite-actions .account-invite-copy-button{border-color:var(--primary-soft);background:var(--primary-soft);color:color-mix(in srgb,var(--primary) 40%,var(--ink));font-weight:650}
.account-invite-card .account-invite-actions .account-invite-copy-button:hover{border-color:var(--primary)}
.account-invite-card .account-invite-actions .account-invite-refresh-button{background:var(--surface);color:var(--ink-2)}
.account-invite-card .account-invite-actions .account-invite-refresh-button:hover{border-color:var(--primary);background:var(--surface-soft)}
.account-invite-loading{display:inline-flex;flex:none;color:var(--primary)}
.account-invite-loading svg{width:14px;height:14px;animation:account-invite-loading .9s linear infinite}
@keyframes account-invite-loading{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.account-invite-loading svg{animation:none}}

.account-modal-footer .danger-button {
  min-width: 118px;
}

.web-login-form {
  display: grid;
  gap: 12px;
}

.web-login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 760;
}

.web-login-form label span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 740;
}

.web-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.web-login-form input:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 32%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 84%);
}

.web-login-form .login-remember-option { flex-wrap: wrap; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: fit-content; color: var(--muted); font-size: 13px; font-weight: 680; line-height: 1.3; cursor: pointer; user-select: none; }

.web-login-form .login-remember-option input { flex: 0 0 auto; width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; accent-color: var(--primary); cursor: pointer; }

.web-login-form .login-remember-option span { color: inherit; font-size: inherit; font-weight: inherit; }

.password-input-shell {
  position: relative;
  display: block;
  width: 100%;
}

.web-login-form label .password-input-shell {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.password-input-shell input {
  padding-right: 48px !important;
}

.password-reveal-button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.password-reveal-button:hover,
.password-reveal-button:focus-visible {
  background: var(--raise);
  color: var(--ink);
}

.password-reveal-button svg {
  width: 17px;
  height: 17px;
}

.web-login-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.slide-captcha-slot:empty {
  display: none;
}

.web-slide-captcha-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, #020617, transparent 18%);
  backdrop-filter: blur(14px);
}

.web-slide-captcha-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
}

.web-slide-captcha-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.web-slide-captcha-panel strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.web-slide-captcha-panel header span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.web-slide-captcha-panel .slide-captcha-slot {
  min-height: 232px;
  display: grid;
  place-items: center;
}

.slide-captcha-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
}

.slide-captcha-box.is-image {
  width: min(360px, 100%) !important;
  border-radius: 12px;
}

.slide-captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slide-captcha-head strong {
  color: var(--ink);
  font-size: 13px;
}

.slide-captcha-head span {
  color: var(--muted);
  font-size: 12px;
}

.slide-captcha-track {
  position: relative;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
  touch-action: none;
}

.slide-captcha-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 65%), color-mix(in srgb, var(--ok), transparent 74%));
  transition: width .08s linear;
}

.slide-captcha-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 760;
  pointer-events: none;
}

.slide-captcha-thumb {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 5px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary), transparent 70%);
  transition: left .08s linear;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.slide-captcha-thumb:active {
  cursor: grabbing;
}

.slide-captcha-track input {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
}

.slide-captcha-track input:active {
  cursor: grabbing;
}

.slide-captcha-box.is-passed .slide-captcha-track {
  border-color: color-mix(in srgb, var(--ok), transparent 48%);
}

.slide-captcha-box.is-passed .slide-captcha-label {
  color: var(--ok);
}

.modal-card.enterprise-modal {
  width: min(520px, calc(100vw - 28px));
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface), #fff 3%), color-mix(in srgb, var(--surface-soft), var(--surface) 36%));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.enterprise-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.enterprise-current {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 18px;
  background:
    radial-gradient(220px 110px at 0% 0%, color-mix(in srgb, var(--primary), transparent 72%), transparent 72%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), transparent 12%), color-mix(in srgb, var(--surface), transparent 2%));
}

.enterprise-current small,
.enterprise-option small,
.enterprise-join p,
.enterprise-join label span {
  color: var(--ink-3);
}

.enterprise-current strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.enterprise-current p {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.enterprise-modal-note{margin:0;padding:10px 12px;border:1px solid color-mix(in srgb,#f59e0b,transparent 70%);border-radius:12px;background:color-mix(in srgb,#f59e0b,transparent 90%);color:var(--ink-2);font-size:12.5px}
.enterprise-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:4px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--surface-soft),transparent 34%)}.enterprise-tabs button{min-width:0;min-height:38px;border:0;border-radius:10px;background:transparent;color:var(--ink-2);font:inherit;font-size:13px;font-weight:760;cursor:pointer;transition:background .16s var(--ease-out),color .16s var(--ease-out),box-shadow .16s var(--ease-out)}.enterprise-tabs button:hover{background:color-mix(in srgb,var(--primary),transparent 92%);color:var(--ink)}.enterprise-tabs button.is-active{background:color-mix(in srgb,var(--primary),transparent 84%);color:var(--primary);box-shadow:0 10px 26px color-mix(in srgb,var(--primary),transparent 88%)}.enterprise-tabs button:focus-visible{outline:3px solid color-mix(in srgb,var(--primary),transparent 72%);outline-offset:2px}
.enterprise-default-toggle{display:inline-flex;align-items:center;justify-self:start;gap:10px;min-height:40px;padding:8px 10px;border:1px solid transparent;border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 94%);color:var(--primary);font-size:13px;font-weight:650;cursor:pointer;transition:border-color .18s ease,background .18s ease,color .18s ease}.enterprise-default-check{width:22px;height:22px;flex:0 0 22px;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--primary),transparent 24%);border-radius:7px;background:transparent;color:transparent;box-shadow:none;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease}.enterprise-default-check svg{width:15px;height:15px;stroke-width:2.4}.enterprise-default-toggle.is-on,.enterprise-default-toggle:hover:not(:disabled){border-color:color-mix(in srgb,var(--primary),transparent 62%);background:color-mix(in srgb,var(--primary),transparent 88%)}.enterprise-default-toggle.is-on .enterprise-default-check{border-color:var(--primary);background:transparent;color:var(--primary)}.enterprise-default-toggle:hover:not(:disabled) span:last-child{text-decoration:underline;text-underline-offset:3px}.enterprise-default-toggle:focus-visible{outline:3px solid color-mix(in srgb,var(--primary),transparent 68%);outline-offset:2px}.enterprise-default-toggle:disabled{cursor:not-allowed;opacity:.56}

.enterprise-list {
  display: grid;
  gap: 8px;
}

.enterprise-empty{min-height:80px;display:grid;align-items:center;padding:14px 12px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--surface-soft),transparent 36%);color:var(--ink-2);font-size:13px;line-height:1.6}

.enterprise-option{width:100%;min-width:0;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface-soft),transparent 28%);color:var(--ink);text-align:left;transition:transform .16s var(--ease-out),border-color .16s var(--ease-out),background .16s var(--ease-out)}.enterprise-option:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--primary),transparent 54%);background:color-mix(in srgb,var(--surface-strong),transparent 18%)}.enterprise-option:disabled{cursor:default;color:var(--ink)}.enterprise-option:disabled:hover,.enterprise-option.is-disabled:hover{transform:none}.enterprise-option.is-active{border-color:color-mix(in srgb,var(--primary),transparent 42%);background:color-mix(in srgb,var(--primary),transparent 86%)}.enterprise-option.is-selected{border-color:color-mix(in srgb,var(--primary),transparent 30%);background:color-mix(in srgb,var(--primary),transparent 84%)}.enterprise-option.is-disabled{border-color:color-mix(in srgb,var(--line),transparent 12%);background:color-mix(in srgb,var(--surface-soft),transparent 42%)}.enterprise-option.is-disabled:hover{border-color:color-mix(in srgb,var(--primary),transparent 68%)}
.enterprise-radio{width:18px;height:18px;display:grid;place-items:center;border:2px solid color-mix(in srgb,var(--ink-3),transparent 20%);border-radius:999px;background:var(--surface)}.enterprise-radio::after{width:8px;height:4px;border:solid #fff;border-width:0 0 2px 2px;content:"";opacity:0;transform:rotate(-45deg) translate(1px,-1px);transition:opacity .16s ease}.enterprise-option.is-selected .enterprise-radio{border-color:var(--primary);background:var(--primary)}.enterprise-option.is-selected .enterprise-radio::after{opacity:1}.enterprise-option.is-disabled .enterprise-radio{opacity:.5}

.enterprise-option strong{display:block;max-width:100%;overflow:hidden;color:var(--ink);font-size:14px;font-weight:720;text-overflow:ellipsis;white-space:nowrap}.enterprise-option small{display:block;margin-top:3px;overflow:hidden;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.enterprise-option em{justify-self:end;min-width:42px;padding:5px 8px;border-radius:999px;background:color-mix(in srgb,var(--primary),transparent 86%);color:var(--primary);font-size:11px;font-style:normal;font-weight:760;text-align:center;white-space:nowrap}.enterprise-option em.is-pending{background:color-mix(in srgb,#f59e0b,transparent 86%);color:#b7791f}.enterprise-option em.is-rejected{background:color-mix(in srgb,#ef4444,transparent 88%);color:#dc2626}.enterprise-option em.is-disabled{background:color-mix(in srgb,var(--line),transparent 48%);color:var(--ink-3)}

.enterprise-actions{display:flex;justify-content:flex-end;gap:10px}.enterprise-actions .primary-button{min-width:120px}.enterprise-actions .primary-button:disabled,.enterprise-modal .icon-action:disabled{cursor:progress;opacity:.68}.enterprise-actions .primary-button.is-loading{box-shadow:none}
.enterprise-join{display:grid;gap:12px;padding:14px;border:1px solid var(--line);border-radius:18px;background:color-mix(in srgb,var(--surface-soft),transparent 34%)}.enterprise-join strong{color:var(--ink);font-size:14px;font-weight:760}.enterprise-join p{margin-top:4px;font-size:12.5px;line-height:1.55}

.enterprise-entry-state{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--primary),transparent 70%);border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 92%);color:var(--ink-2);font-size:12.5px;line-height:1.5}.enterprise-entry-state strong{min-width:58px;color:var(--primary);font-size:12px;font-weight:780;white-space:nowrap}.enterprise-entry-state span{min-width:0;overflow-wrap:anywhere}.enterprise-entry-state.is-pending_approval strong,.enterprise-entry-state.is-pending strong,.enterprise-entry-state.is-preparing strong{color:#b7791f}.enterprise-entry-state.is-failed strong,.enterprise-entry-state.is-revoked strong{color:#dc2626}
.enterprise-entry-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid color-mix(in srgb,var(--primary),transparent 72%);border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 92%)}.enterprise-entry-card strong{display:block;color:var(--ink);font-size:13px;font-weight:760}.enterprise-entry-card small{display:block;margin-top:3px;color:var(--ink-2);font-size:12px;line-height:1.45}.enterprise-entry-card em{font-style:normal;color:var(--primary);font-size:12px;font-weight:760;white-space:nowrap}

.enterprise-join label{display:grid;gap:7px}.enterprise-join input{width:100%;min-height:42px;padding:0 12px;border:1px solid var(--line);border-radius:12px;outline:0;background:color-mix(in srgb,var(--surface),transparent 10%);color:var(--ink);font:inherit;font-size:13.5px;box-shadow:none;transition:border-color .16s var(--ease-out),box-shadow .16s var(--ease-out),background .16s var(--ease-out)}.enterprise-join input:focus{border-color:color-mix(in srgb,var(--primary),transparent 38%);background:color-mix(in srgb,var(--surface),transparent 0%);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary),transparent 82%)}.enterprise-join .primary-button{width:100%}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.contact-apply-flow {
  display: grid;
  gap: 16px;
  padding: 18px 20px 22px;
}

.contact-search-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 10%);
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong), transparent 8%), color-mix(in srgb, var(--surface), transparent 4%));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff, transparent 92%);
}

.contact-search-card-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.contact-search-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 62%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary), transparent 90%);
  color: var(--primary);
}

.contact-search-mark svg {
  width: 17px;
  height: 17px;
}

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

.contact-search-card-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
}

.contact-search-card-head small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.contact-search-field,
.contact-verify-field {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 620;
}

.contact-search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.contact-input-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-soft), transparent 3%);
  color: var(--ink-3);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.contact-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--primary), transparent 32%);
  background: color-mix(in srgb, var(--surface), transparent 0%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%);
}

.contact-input-wrap svg {
  width: 16px;
  height: 16px;
}

.contact-search-field input,
.contact-verify-field textarea {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
}

.contact-search-field input {
  min-height: 40px;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.contact-search-field input:focus,
.contact-search-field input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.contact-search-field .contact-search-button {
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--primary), #fff 10%);
  border-radius: 13px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #7ab7ff 18%), color-mix(in srgb, var(--primary), #7b68ff 24%));
  color: #fff;
  font-weight: 720;
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--primary), transparent 74%),
    inset 0 1px 0 rgba(255, 255, 255, .18);
}

.contact-search-field .contact-search-button:hover {
  border-color: color-mix(in srgb, var(--primary), #fff 24%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #8fc5ff 24%), color-mix(in srgb, var(--primary), #8a76ff 32%));
  color: #fff;
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--primary), transparent 68%),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

.contact-search-field .contact-search-button:disabled {
  opacity: .72;
  transform: none;
  cursor: wait;
}

.contact-verify-field textarea {
  min-height: 92px;
  resize: vertical;
}

.contact-search-state {
  display: grid;
  gap: 6px;
  min-height: 72px;
  align-content: center;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface), transparent 18%);
}

.contact-search-guide {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 28%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface), transparent 30%);
}

.contact-search-guide strong,
.contact-search-state strong {
  color: var(--ink);
  font-size: 14px;
}

.contact-search-guide small,
.contact-search-state small {
  color: var(--ink-3);
  font-size: 12px;
}

.contact-search-state.loading-state {
  border-style: solid;
}

.contact-search-state.loading-state span {
  width: 100%;
}

.contact-search-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 70%);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 91%), color-mix(in srgb, var(--surface-strong), transparent 8%));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary), transparent 88%);
}

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

.contact-search-result strong {
  color: var(--ink);
  font-size: 14px;
}

.contact-search-result small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.contact-apply-submit {
  width: 100%;
}

.contact-apply-flow .muted-note {
  margin: -2px 0 0;
}

.span-2 {
  grid-column: 1 / -1;
}

.modal-preview {
  min-height: 360px;
  margin: 16px;
}

.seen-list {
  display: grid;
  gap: 8px;
  padding: 16px;
  overflow: auto;
}

.seen-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(110px, 0.45fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.seen-row strong,
.seen-row small {
  display: block;
}

.seen-row small,
.seen-row span:nth-child(3),
.seen-row time {
  color: var(--muted);
  font-size: 12px;
}

.drawer-layer { display: grid; grid-template-rows: minmax(0, 1fr); align-items: stretch; justify-content: end; min-height: 0; overflow: hidden; }

.drawer-card { width: min(480px, calc(100vw - 28px)); height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; animation: drawer-in .22s var(--ease-out); }

.drawer-body { min-height: 0; padding: 16px; overflow: auto; }

.drawer-card.drawer-invite {
  width: min(520px, calc(100vw - 28px));
}

.drawer-card.drawer-group-create {
  width: min(560px, calc(100vw - 28px));
}

.drawer-card.drawer-invite .drawer-body,
.drawer-card.drawer-group-create .drawer-body { display: grid; overflow: hidden; }

/* Optional errors and summaries belong to the fields, never to implicit rows.
   On short windows only the fields and candidates scroll; actions stay visible. */
.invite-friends-panel,
.group-create-panel { min-height: 0; height: 100%; display: flex; flex-direction: column; gap: 14px; }

.group-member-picker-fields { flex: 0 1 auto; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; }
.group-member-picker-fields > * { flex: 0 0 auto; }
.group-member-picker-fields > .invite-search-note { margin: 0; }

:is(.invite-friends-panel, .group-create-panel) > .invite-friend-list { flex: 1 0 72px; }
:is(.invite-friends-panel, .group-create-panel) > .group-create-actions { flex: 0 0 auto; }
.group-create-confirm-card strong { overflow-wrap: anywhere; }

.group-create-name,
.invite-search-field { display: grid; gap: 8px; color: var(--ink-2); font-size: 12px; font-weight: 800; }

.group-create-name input,
.invite-search-field input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface-soft); color: var(--ink); font: inherit; outline: none; }

.group-create-name input { height: 44px; }
.invite-search-field input { height: 42px; }

.group-create-name input:focus,
.invite-search-field input:focus { border-color: color-mix(in srgb, var(--primary), var(--line) 18%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%); }

.invite-target-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 42%);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 46%), var(--surface));
}

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

.invite-target-card strong {
  color: var(--ink);
  font-size: 15px;
}

.invite-target-card small,
.invite-search-note,
.invite-friend-copy small {
  color: var(--ink-2);
}

.invite-search-note {
  padding: 0 2px;
  font-size: 12.5px;
  line-height: 1.6;
}

.invite-friend-list { min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 10px; padding-right: 4px; }

.invite-selection-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; color: var(--ink-2); font-size: 12px; font-weight: 760; }

.invite-selection-summary button { min-height: 28px; padding: 0 10px; border-radius: 10px; color: var(--primary); background: color-mix(in srgb, var(--primary-soft), transparent 26%); }
.group-picker-summary-actions { display: flex; gap: 6px; }
.invite-selection-summary .group-picker-select-all { min-height: 28px; white-space: nowrap; }
.invite-selection-summary .group-picker-select-all:disabled { color: var(--ink-2); background: var(--raise); cursor: not-allowed; }

.group-create-confirm-card { display: grid; gap: 6px; padding: 16px; border: 1px solid color-mix(in srgb, var(--primary), var(--line) 38%); border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 44%), var(--surface)); }

.group-create-confirm-card small,
.group-create-confirm-card p { margin: 0; color: var(--ink-2); }

.group-create-confirm-card strong { color: var(--ink); font-size: 18px; }

.group-create-selected-list .invite-friend-row { grid-template-columns: auto minmax(0, 1fr) auto; }

.invite-friend-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); transition: transform .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out); }

.invite-friend-row:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary), var(--line) 48%); background: var(--surface); }

.invite-friend-row.is-disabled { opacity: .72; }

.invite-friend-row.is-selected { border-color: color-mix(in srgb, var(--primary), var(--line) 28%); background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%); }

.invite-friend-copy { min-width: 0; }

.invite-friend-copy strong,
.invite-friend-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.invite-friend-copy strong { color: var(--ink); font-size: 14px; }

.invite-friend-copy small { margin-top: 3px; font-size: 12px; }

.status-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 11.5px; white-space: nowrap; }

.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ink-3); }

.status-dot[data-status="online"]::before { background: var(--ok); }

.status-dot[data-status="offline"]::before { background: var(--muted); }

.invite-friend-row button { min-height: 34px; padding: 0 12px; border-radius: 11px; white-space: nowrap; }

.invite-friend-row button:disabled { cursor: not-allowed; color: var(--ink-3); background: var(--raise); box-shadow: none; }

.group-create-actions { padding-top: 12px; border-top: 1px solid var(--line); background: var(--surface); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.group-create-actions button { min-height: 42px; border-radius: 13px; }

.drawer-card.drawer-edit-profile {
  width: min(520px, calc(100vw - 28px));
}

.drawer-card.drawer-edit-remark {
  width: min(480px, calc(100vw - 28px));
}

.edit-profile-panel {
  display: grid;
  gap: 14px;
}

.edit-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 42%);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 46%), var(--surface));
}

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

.edit-profile-card strong {
  color: var(--ink);
  font-size: 15px;
}

.edit-profile-card small {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
}

.profile-edit-form {
  padding: 0;
  overflow: visible;
}

.profile-edit-form input,
.profile-edit-form select {
  min-height: 42px;
}

.remark-edit-form {
  display: grid;
  gap: 10px;
}

.remark-edit-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.remark-edit-form textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

.remark-edit-form p {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
}

.edit-profile-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
}

.edit-profile-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--raise);
  color: var(--ink);
}

.edit-profile-actions .primary-button {
  border: 0;
  color: #fff;
}

.tool-grid {
  display: grid;
  gap: 10px;
}

.tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tool-card p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.toast-stack {
  position: fixed;
  z-index: 90;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 36px));
  height: 104px;
  pointer-events: none;
  perspective: 900px;
  transition: height .28s var(--ease-out);
}

.toast-stack:hover,
.toast-stack:focus-within {
  height: min(312px, calc(100vh - 36px));
}

.toast {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
  transform:
    translate3d(0, calc(var(--toast-depth) * 16px), calc(var(--toast-depth) * -1px))
    scale(calc(1 - var(--toast-depth) * .045));
  opacity: calc(1 - var(--toast-depth) * .08);
  transition:
    transform .35s cubic-bezier(.25,.75,.6,.98),
    opacity .24s ease,
    border-color .18s ease,
    background .18s ease;
  will-change: transform;
}

.toast-stack:hover .toast,
.toast-stack:focus-within .toast {
  transform: translate3d(0, calc(var(--toast-depth) * 82px), 0) scale(1);
  opacity: 1;
}

.toast-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.toast-content strong,
.toast-content p {
  overflow-wrap: anywhere;
}

.toast-close {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.toast-close:hover {
  background: color-mix(in srgb, var(--ink), transparent 92%);
  color: var(--ink);
}

.toast[data-tone="warn"] {
  border-left-color: var(--warn);
}

.toast[data-tone="danger"] {
  border-left-color: var(--danger);
}

.toast p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

/* Global page-loading surfaces (login overlay + in-app thin bar).
   Body-level fixed layer: z-index 980 sits above the message interaction
   overlay host (220) and below the slide-captcha mask (1200), so the captcha
   stays visible and clickable on top of the login overlay. Both surfaces are
   pointer-events: none — they never intercept clicks. */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.page-loading-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 64%, transparent);
  backdrop-filter: blur(3px);
}

.page-loading-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.page-loading-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-top-color: var(--primary);
  animation: page-loading-spin 0.8s linear infinite;
}

.page-loading-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 980;
  overflow: hidden;
  pointer-events: none;
}

.page-loading-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 999px;
  background: var(--primary);
  animation: page-loading-slide 1.1s ease-in-out infinite;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes page-loading-slide {
  0% {
    left: -38%;
  }
  100% {
    left: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading-spinner,
  .page-loading-bar::before {
    animation: none;
  }

  .page-loading-bar::before {
    left: 0;
    width: 100%;
    opacity: 0.55;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawer-in {
  from {
    transform: translateX(18px);
  }
  to {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1220px) {
  .im-shell,
  .im-shell.is-detail-open {
    grid-template-columns: var(--rail-w) minmax(292px, var(--side-w)) minmax(0, 1fr);
  }

  .context-panel {
    position: fixed;
    z-index: 55;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, calc(100vw - var(--rail-w)));
    border-left: 1px solid var(--line);
  }

  .im-shell.is-detail-open .context-panel {
    display: grid;
  }
}

@media (max-width: 980px) {
  :root {
    --side-w: 312px;
  }

  .topbar-actions .ok-chip,
  .topbar-actions .alert-chip {
    display: none;
  }

  .content-grid,
  .content-grid.three {
    grid-template-columns: 1fr;
  }

  .group-members-list {
    grid-template-columns: 1fr;
  }

  .composer-tool i {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --rail-w: 64px;
    --mobile-side-w: min(300px, calc(100vw - var(--rail-w) - 36px));
  }

  .im-shell,
  .im-shell.is-detail-open {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .brand-button,
  .rail-user {
    width: 48px;
  }

  .rail-item {
    width: 48px;
  }

  .rail-label {
    display: none;
  }

  .side-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: var(--rail-w);
    width: var(--mobile-side-w);
    transform: translateX(calc(-100% - var(--rail-w)));
    transition: transform 0.18s ease;
    border-left: 1px solid var(--line);
  }

  .im-shell.is-list-open .side-panel {
    transform: translateX(0);
  }

  .list-scrim {
    position: fixed;
    z-index: 58;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(var(--rail-w) + var(--mobile-side-w));
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--scrim);
    animation: scrim-in 0.18s var(--ease-out);
  }

  .list-scrim:hover {
    background: var(--scrim);
  }

  .list-toggle {
    display: inline-grid;
  }

  .workspace-topbar {
    min-height: 62px;
    padding: 10px 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions > button:not(.primary-button):not(.detail-action):not(.icon-action),
  .conversation-hero .hero-actions,
  .room-strip-actions {
    display: none;
  }

  .room-strip,
  .conversation-hero,
  .message-scroll,
  .composer-panel,
  .page-scroll {
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .message-row,
  .message-row.is-me {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-row > .avatar {
    display: none;
  }

  .room-strip-main {
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
  }

  .composer-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .composer-tool {
    min-width: 58px;
    justify-content: center;
  }

  .composer-tool i {
    display: none;
  }

  .emoji-popover {
    left: calc(var(--rail-w) + 12px);
    right: 12px;
    bottom: 172px;
    width: auto;
  }

  .seen-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .seen-row span:nth-child(3),
  .seen-row time {
    grid-column: 2;
  }

  .composer-footer {
    align-items: stretch;
  }

  .composer-footer span {
    display: none;
  }

  .form-grid,
  .info-grid,
  .theme-cards {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .video-grid {
    grid-template-columns: 1fr;
    min-height: 520px;
  }
}

.im-shell { --radius: 12px; }

.brand-button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 8px 22px rgba(79, 140, 255, 0.42);
}

.brand-button.has-logo {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 22px rgba(79, 140, 255, 0.24);
}
.rail-item { border-radius: 14px; }
.rail-item:hover {
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
}
.rail-item.is-active {
  border: 1px solid color-mix(in srgb, var(--primary), transparent 60%);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary), transparent 84%),
    color-mix(in srgb, var(--secondary), transparent 87%));
  color: var(--primary);
  box-shadow: none;
}
.rail-item.is-active::before { background: linear-gradient(180deg, #4f8cff, #7c6bff); }
.rail-badge { background: linear-gradient(135deg, #ff6f7d, #ff4d62); box-shadow: 0 4px 12px rgba(255, 77, 98, 0.4); }

.filter-tabs { gap: 4px; padding: 4px; border-radius: 12px; }
.filter-tabs button { border: 0; border-radius: 9px; }
.filter-tabs button.is-active {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary), transparent 84%),
    color-mix(in srgb, var(--secondary), transparent 88%));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 62%);
}

.conversation-card { border-radius: 14px; }
.conversation-card.is-active,
.plain-row.is-active,
.file-card.is-active {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary), transparent 84%),
    color-mix(in srgb, var(--secondary), transparent 89%));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 64%);
}
.conversation-card.is-active::before { background: linear-gradient(180deg, #4f8cff, #7c6bff); }

.bubble {
  border-radius: 16px;
  border-top-left-radius: 6px;
}
.message-row.is-me .bubble {
  border: 0;
  border-radius: 16px;
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary), transparent 70%);
}
.message-row.is-me .bubble p,
.message-row.is-me .bubble a { color: #fff; }
.message-row.is-me .bubble blockquote { border-left-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.12); }
.message-row.is-me .bubble blockquote b,
.message-row.is-me .bubble blockquote span { color: rgba(255, 255, 255, 0.9); }

.composer {
  border-radius: 18px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink), transparent 90%);
}

.quick-reaction-bar { border-radius: 999px; box-shadow: 0 16px 38px color-mix(in srgb, var(--ink), transparent 78%); }
.quick-reaction-bar button { border-radius: 50%; }

.is-primary,
[data-variant="primary"] {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.36);
}
.is-primary:hover,
[data-variant="primary"]:hover { background: linear-gradient(135deg, #5b95ff 0%, #8676ff 100%); }

.rail-ico { display: grid; place-items: center; }
.rail-ico svg { width: 22px; height: 22px; }
.rail-item { gap: 0; }
.brand-button { border-radius: 14px; }

.avatar {
  border-radius: 13px;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.26);
}
.avatar-user { background: linear-gradient(135deg, #b66bff 0%, #7c6bff 100%); }
.avatar.is-system { background: linear-gradient(135deg, #3a4670 0%, #566089 100%); box-shadow: none; }
.avatar-soft {
  background: color-mix(in srgb, var(--primary), transparent 86%);
  color: var(--primary);
  box-shadow: none;
}
.avatar-xl { border-radius: 20px; }

.icon-action svg { width: 18px; height: 18px; display: block; }
.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  color: var(--ink-2, var(--ink));
  background: transparent;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-action:hover {
  background: color-mix(in srgb, var(--ink), transparent 92%);
  color: var(--ink);
}
.icon-action.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.icon-action.is-primary {
  color: #fff;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.34);
}
.icon-action.is-primary:hover { background: linear-gradient(135deg, #5b95ff 0%, #8676ff 100%); color: #fff; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}
.panel-head strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
  color: var(--ink);
}
.panel-head-acts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.announcement-top-button {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 10%);
  color: color-mix(in srgb, var(--muted), var(--primary) 18%);
  line-height: 0;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.announcement-top-button svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.announcement-top-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 66%);
  color: var(--primary);
}

.announcement-top-button span {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: #ff5c7a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(255, 92, 122, .26);
}

.announcement-top-button.has-unread {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 44%);
}

.message-sound-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 10%);
  color: color-mix(in srgb, var(--muted), var(--primary) 18%);
  line-height: 0;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.message-sound-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.message-sound-toggle:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 66%);
  color: var(--primary);
}

.message-sound-toggle.is-on {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 35%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 54%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary), transparent 78%);
}

.theme-quick-toggle {
  position: relative;
  width: 64px;
  min-width: 64px;
  height: 32px;
  min-height: 32px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid #27272a;
  background: #09090b;
  color: #71717a;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.theme-quick-toggle:hover {
  color: #e4e4e7;
  border-color: #3f3f46;
  background: #09090b;
}

.theme-quick-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 40%);
  outline-offset: 2px;
}

.theme-quick-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-quick-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #71717a;
  opacity: 1;
  pointer-events: none;
}

.theme-quick-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #27272a;
  border: 0;
  box-shadow: none;
  transition: transform .24s ease, background .2s ease, color .2s ease;
  pointer-events: none;
}

.theme-quick-toggle.is-light .theme-quick-thumb {
  transform: translateX(32px);
  color: #374151;
  background: #e5e7eb;
  box-shadow: none;
}

body[data-theme="aurora"] .theme-quick-toggle {
  background: #fff;
  border-color: #e5e7eb;
  color: #111827;
}

body[data-theme="aurora"] .theme-quick-toggle:hover {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}

body[data-theme="aurora"] .theme-quick-icon {
  color: #111827;
}

body[data-theme="midnight"] .theme-quick-toggle {
  background: #09090b;
  border-color: #27272a;
  color: #71717a;
}

body[data-theme="midnight"] .theme-quick-toggle:hover {
  background: #09090b;
  color: #e4e4e7;
  border-color: #3f3f46;
}

body[data-theme="midnight"] .theme-quick-thumb {
  background: #27272a;
  color: #fff;
  box-shadow: none;
}

.theme-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink), transparent 94%);
  border: 1px solid color-mix(in srgb, var(--ink), transparent 90%);
}
.theme-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-2, var(--ink));
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.theme-toggle button svg { width: 17px; height: 17px; }
.theme-toggle button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.30);
}

.side-section-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3, var(--ink-2));
  background: color-mix(in srgb, var(--ink), transparent 92%);
}

:root {
  --bg: #070a12;
  --bg-soft: #0b0f1a;
  --ink: #e8edf9;
  --ink-2: #9aa6c2;
  --ink-3: #5c6680;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .025);
  --glass: rgba(17, 22, 36, .55);
  --raise: rgba(255, 255, 255, .04);
  --brand: #5b9dff;
  --brand-2: #8b7bff;
  --cyan: #6ad6ff;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .14));
  --ok: #37e0a6;
  --warn: #ffcc6b;
  --danger: #ff6f7d;
  --bad: #ff6f7d;
  --surface: rgba(255, 255, 255, .035);
  --surface-soft: rgba(255, 255, 255, .04);
  --surface-strong: rgba(255, 255, 255, .08);
  --primary: #5b9dff;
  --primary-soft: rgba(79, 140, 255, .14);
  --secondary: #8b7bff;
  --accent: #ff6f7d;
  --muted: #9aa6c2;
  --soft: #5c6680;
  --bubble-me: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --bubble-other: rgba(255, 255, 255, .05);
  --scrim: rgba(4, 7, 14, .62);
  --rail-w: 74px;
  --side-w: 332px;
  --detail-w: 312px;
  --radius: 14px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --sh: 0 12px 40px rgba(0, 0, 0, .45);
  --sh-sm: 0 6px 20px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body,
body[data-theme="aurora"],
body[data-theme="teal"],
body[data-theme="graphite"],
body[data-theme="midnight"] {
  --bg: #070a12;
  --bg-soft: #0b0f1a;
  --ink: #e8edf9;
  --ink-2: #9aa6c2;
  --ink-3: #5c6680;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .025);
  --glass: rgba(17, 22, 36, .55);
  --raise: rgba(255, 255, 255, .04);
  --brand: #5b9dff;
  --brand-2: #8b7bff;
  --cyan: #6ad6ff;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .14));
  --ok: #37e0a6;
  --warn: #ffcc6b;
  --danger: #ff6f7d;
  --bad: #ff6f7d;
  --surface: rgba(255, 255, 255, .035);
  --surface-soft: rgba(255, 255, 255, .04);
  --surface-strong: rgba(255, 255, 255, .08);
  --primary: #5b9dff;
  --primary-soft: rgba(79, 140, 255, .14);
  --secondary: #8b7bff;
  --accent: #ff6f7d;
  --muted: #9aa6c2;
  --soft: #5c6680;
  --bubble-me: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --bubble-other: rgba(255, 255, 255, .05);
  --scrim: rgba(4, 7, 14, .62);
  color-scheme: dark;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(79, 140, 255, .20), transparent 60%),
    radial-gradient(900px 500px at 8% 4%, rgba(124, 107, 255, .16), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(106, 214, 255, .07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body:not([data-theme="aurora"]) {
  --ink-2: #b8c4dc;
  --ink-3: #8794b2;
  --muted: #b8c4dc;
  --soft: #8794b2;
  --line: rgba(203, 213, 225, .12);
  --line-2: rgba(203, 213, 225, .20);
  --surface-soft: rgba(255, 255, 255, .055);
  --surface-strong: rgba(255, 255, 255, .10);
}

body[data-theme="aurora"] {
  --bg: #e9edf6;
  --bg-soft: #ffffff;
  --ink: #1b2336;
  --ink-2: #56627d;
  --ink-3: #93a0b8;
  --line: rgba(20, 30, 55, .10);
  --line-2: rgba(20, 30, 55, .17);
  --panel: rgba(20, 30, 55, .02);
  --glass: rgba(255, 255, 255, .72);
  --raise: rgba(20, 30, 55, .045);
  --grad-soft: linear-gradient(135deg, rgba(79, 140, 255, .14), rgba(124, 107, 255, .12));
  --surface: rgba(255, 255, 255, .82);
  --surface-soft: rgba(20, 30, 55, .045);
  --surface-strong: rgba(20, 30, 55, .08);
  --muted: #56627d;
  --soft: #93a0b8;
  --bubble-other: #eef2f8;
  --scrim: rgba(40, 52, 86, .32);
  --sh: 0 14px 44px rgba(35, 48, 82, .16);
  --sh-sm: 0 6px 20px rgba(35, 48, 82, .10);
  color-scheme: light;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(79, 140, 255, .14), transparent 60%),
    radial-gradient(900px 500px at 8% 4%, rgba(124, 107, 255, .12), transparent 55%),
    #e6eaf4;
}

body[data-theme="aurora"] .im-shell {
  background: linear-gradient(180deg, #ffffff, #f4f6fb);
}

body[data-theme="aurora"] .app-rail {
  background: rgba(244, 247, 252, .82);
}

body[data-theme="aurora"] .side-panel,
body[data-theme="aurora"] .context-panel {
  background: rgba(248, 250, 253, .74);
}

body[data-theme="aurora"] .workspace,
body[data-theme="aurora"] .chat-workspace {
  background: rgba(250, 252, 255, .78);
}

body[data-theme="aurora"] .workspace-topbar,
body[data-theme="aurora"] .pane-head,
body[data-theme="aurora"] .stage-head {
  background: rgba(252, 253, 255, .82);
}

body[data-theme="aurora"] .composer-panel,
body[data-theme="aurora"] .conversation-card,
body[data-theme="aurora"] .panel,
body[data-theme="aurora"] .set-group,
body[data-theme="aurora"] .fcard,
body[data-theme="aurora"] .modal-card,
body[data-theme="aurora"] .drawer-card,
body[data-theme="aurora"] .menu-popover {
  background: rgba(255, 255, 255, .86);
}

body[data-theme="aurora"] .bubble {
  background: #eef2f8;
  color: #1b2336;
}

body[data-theme="aurora"] .message-row.is-inbox-message .bubble {
  border-color: rgba(37, 99, 235, .18);
  background:
    linear-gradient(135deg, rgba(219, 234, 254, .92), rgba(255, 255, 255, .96) 74%),
    #fff;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .08);
}

body[data-theme="aurora"] .message-row.is-inbox-message .bubble p {
  color: #1f2a44;
}

body[data-theme="aurora"] .message-row.is-me .bubble {
  color: #fff;
}

body[data-theme="aurora"] .message-row.is-failed .bubble,
body[data-theme="aurora"] .message-row.is-me.is-failed .bubble {
  border: 1px solid rgba(226, 86, 106, .42);
  background: linear-gradient(180deg, rgba(255, 238, 241, .96), rgba(255, 229, 233, .9));
  color: #8f2433;
  box-shadow: 0 14px 34px rgba(226, 86, 106, .10);
}

/* User presence intelligence and 30-day behavior analysis. */
.topbar-behavior-entry {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft), transparent 18%);
  color: var(--ink-2);
}

.topbar-behavior-entry:hover,
.topbar-behavior-entry:focus-visible {
  border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
}

.topbar-behavior-entry svg {
  width: 15px;
  height: 15px;
}

.inline-status[data-status="offline"] {
  color: var(--ink-3);
}

.inline-status[data-status="unknown"] {
  color: var(--muted);
  font-weight: 560;
}

.behavior-intelligence-layer {
  z-index: 82;
  background: color-mix(in srgb, var(--scrim), transparent 30%);
  backdrop-filter: blur(1px);
}

.modal-card.behavior-intelligence-modal {
  width: min(960px, calc(100vw - 48px));
  height: min(790px, calc(100vh - 42px));
  max-height: min(820px, calc(100vh - 42px));
  border-radius: 18px;
  box-shadow: 0 30px 80px color-mix(in srgb, #050914, transparent 45%);
}

.behavior-intelligence-modal .behavior-modal-titlebar {
  align-items: center;
  padding: 16px 20px;
}

.behavior-modal-titlebar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.behavior-modal-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 20px 16px;
  scrollbar-gutter: stable;
}

.behavior-interval-quality {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 8px 12px 0 40px;
  color: var(--ink-3);
  font-size: 11px;
}

.behavior-profile-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-bottom: 14px;
}

.behavior-profile-identity,
.behavior-profile-presence,
.behavior-range-tools,
.behavior-panel-head,
.behavior-modal-footer,
.behavior-modal-footer > div,
.behavior-risk-evidence summary,
.behavior-session-note {
  display: flex;
  align-items: center;
}

.behavior-profile-identity {
  min-width: 0;
  gap: 11px;
}

.avatar.behavior-profile-avatar {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
}

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

.behavior-profile-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.behavior-profile-copy span,
.behavior-panel-head p,
.behavior-session-note,
.behavior-modal-footer p,
.behavior-risk-evidence small {
  color: var(--muted);
  font-size: 11.5px;
}

.behavior-profile-presence {
  min-width: 0;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.behavior-profile-presence > span:not(:last-child)::after {
  content: "·";
  margin-left: 7px;
  color: var(--line-2);
}

.behavior-profile-presence .behavior-ip-lock::after,
.behavior-profile-presence .behavior-risk-pill::after {
  content: none;
}

.behavior-live-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok);
  font-weight: 700;
}

.behavior-live-state > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor, transparent 86%);
}

.behavior-live-state[data-status="offline"] {
  color: var(--ink-3);
}

.behavior-ip-lock {
  display: inline-flex;
  color: var(--ink-3);
}

.behavior-ip-lock svg {
  width: 13px;
  height: 13px;
}

.behavior-risk-pill,
.behavior-settlement,
.behavior-summary-state,
.behavior-merge-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-style: normal;
  font-weight: 680;
}

.behavior-risk-pill {
  padding: 5px 9px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 35%);
  color: var(--ink-2);
}

.behavior-risk-pill[data-risk="medium"] {
  background: color-mix(in srgb, var(--warn), transparent 88%);
  color: var(--warn);
}

.behavior-risk-pill[data-risk="high"] {
  background: color-mix(in srgb, var(--danger), transparent 89%);
  color: var(--danger);
}

.behavior-range-tools {
  position: relative;
  justify-content: flex-end;
  min-width: 0;
}

.behavior-date-range {
  position: relative;
  min-width: 0;
}

.behavior-date-range-trigger {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-soft), transparent 20%);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 620;
}

.behavior-date-range-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.behavior-date-range-trigger svg {
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.behavior-date-range-trigger:hover,
.behavior-date-range-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 54%);
  background: color-mix(in srgb, var(--primary), transparent 92%);
  color: var(--primary);
}

.behavior-date-range-trigger:focus-visible,
.behavior-date-range-popover button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 25%);
  outline-offset: 2px;
}

.behavior-date-range-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: 0;
  width: min(338px, calc(100vw - 48px));
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 72%);
  border-radius: 13px;
  background: var(--bg-soft);
  color: var(--ink-2);
  box-shadow: 0 18px 46px color-mix(in srgb, #050914, transparent 76%);
}

.behavior-date-range-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.behavior-date-range-quick button,
.behavior-date-range-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft), transparent 12%);
  color: var(--ink-2);
  font-size: 11.5px;
}

.behavior-date-range-quick button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary), transparent 58%);
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  font-weight: 700;
}

.behavior-date-range-hint,
.behavior-date-range-error {
  min-height: 16px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.behavior-date-range-error {
  color: var(--danger);
}

.behavior-date-range-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 7px;
  align-items: center;
}

.behavior-date-range-actions .primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.behavior-detail-region {
  position: relative;
  min-width: 0;
}

.behavior-detail-region .behavior-range-tools {
  margin-bottom: 12px;
}

.behavior-detail-shield {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), transparent 48%);
  backdrop-filter: blur(1px);
}

.behavior-detail-shield > span {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.behavior-detail-shield svg { width: 18px; height: 18px; flex-shrink: 0; }
.behavior-chart-placeholder, .behavior-timeline-placeholder {
  display: grid;
  align-content: space-evenly;
  min-height: 270px;
}
.behavior-chart-placeholder > span, .behavior-timeline-placeholder > span {
  display: block;
  height: 1px;
  background: var(--line);
}
.behavior-timeline-placeholder > span {
  height: 42px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--line), transparent 55%);
}

.behavior-analysis-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, .98fr) minmax(0, 1.05fr);
  gap: 14px;
}

.behavior-overview-panel,
.behavior-timeline-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 32%);
}

.behavior-timeline-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.behavior-panel-head {
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 12px;
}

.behavior-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.behavior-panel-head h3 svg {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.behavior-panel-head p {
  margin: 2px 0 0;
}

.behavior-metric-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface), transparent 35%);
}

.behavior-metric-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.behavior-metric-tabs button.is-active {
  background: color-mix(in srgb, var(--primary), transparent 87%);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 82%);
}

.behavior-chart-wrap {
  display: grid;
  --behavior-plot-top: 8px;
  --behavior-plot-bottom: 20px;
  --behavior-plot-mid: calc((100% + var(--behavior-plot-top) - var(--behavior-plot-bottom)) / 2);
  grid-template-rows: auto 246px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 270px;
}

.behavior-chart-scale {
  position: relative;
  height: 246px;
  color: var(--muted);
  font-size: 10.5px;
}

.behavior-chart-scale > span { position: absolute; right: 4px; transform: translateY(-50%); }
.behavior-chart-scale > span:first-child { top: var(--behavior-plot-top); }
.behavior-chart-scale > span:nth-child(2) { top: var(--behavior-plot-mid); }
.behavior-chart-scale > span:last-child { top: calc(100% - var(--behavior-plot-bottom)); }

.behavior-chart-unit {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 18px;
}

.behavior-chart {
  position: relative;
  height: 246px;
  display: grid;
  grid-template-columns: repeat(var(--behavior-day-count, 30), minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  padding-top: 8px;
}

.behavior-chart-guide {
  position: absolute;
  z-index: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: color-mix(in srgb, var(--line), transparent 25%);
  pointer-events: none;
}

.behavior-chart-guide.is-top { top: var(--behavior-plot-top); }
.behavior-chart-guide.is-mid { top: var(--behavior-plot-mid); }
.behavior-chart-guide.is-base { bottom: var(--behavior-plot-bottom); }

.behavior-chart-day {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 238px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 20px;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.behavior-chart-column {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.behavior-chart-column > i {
  width: min(8px, 74%);
  height: var(--behavior-bar-height);
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--primary), #fff 58%);
  transition: height .18s var(--ease-out), background .15s var(--ease-out), box-shadow .15s var(--ease-out);
}

.behavior-chart-day.is-positive .behavior-chart-column > i {
  min-height: 3px;
}

.behavior-chart-day.is-unknown .behavior-chart-column {
  align-items: center;
}

.behavior-chart-unknown {
  width: 1em;
  white-space: normal;
  overflow-wrap: anywhere;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
}

.behavior-chart-day:hover .behavior-chart-column > i,
.behavior-chart-day:focus-visible .behavior-chart-column > i {
  background: color-mix(in srgb, var(--primary), #fff 32%);
}

.behavior-chart-day.is-selected .behavior-chart-column > i {
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary), #fff 24%), 0 7px 16px color-mix(in srgb, var(--primary), transparent 74%);
}

.behavior-chart-column > em {
  position: absolute;
  bottom: calc(var(--behavior-bar-height) + 4px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e3d;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface), transparent 5%);
}

.behavior-chart-day small {
  min-width: 25px;
  justify-self: center;
  padding-top: 5px;
  font-size: 9.5px;
  white-space: nowrap;
}

.behavior-chart-day:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 25%);
  outline-offset: 2px;
  border-radius: 5px;
}

.behavior-chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 26px;
  padding: 1px 2px 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.behavior-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.behavior-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--primary), #fff 58%);
}

.behavior-chart-legend i.is-risk {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e3d;
}

.behavior-chart-legend i.is-selected {
  border: 2px solid var(--primary);
  background: transparent;
}

.behavior-day-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface), transparent 28%);
}

.behavior-day-summary > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
}

.behavior-day-summary > div:last-child { border-right: 0; }
.behavior-day-summary strong { color: var(--ink); font-size: 12px; }
.behavior-day-summary span,
.behavior-day-summary small { color: var(--muted); font-size: 10px; }
.behavior-day-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.behavior-summary-state {
  width: fit-content;
  padding: 3px 7px;
  background: color-mix(in srgb, var(--ink-3), transparent 88%);
  color: var(--ink-2) !important;
}

.behavior-summary-state.is-live,
.behavior-settlement.is-live {
  background: color-mix(in srgb, var(--ok), transparent 87%);
  color: var(--ok) !important;
}

.behavior-session-note {
  gap: 6px;
  margin: 9px 0 0;
}

.behavior-session-note svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.behavior-settlement {
  padding: 5px 9px;
  background: color-mix(in srgb, var(--ink-3), transparent 88%);
  color: var(--ink-2);
  font-size: 10.5px;
}

.behavior-interval-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
}

.behavior-interval {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface), transparent 24%);
  overflow: hidden;
}

.behavior-interval[open] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 52%);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary), transparent 94%);
}

.behavior-interval summary {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  grid-template-areas: "chevron title badge lock" "chevron network network lock";
  align-items: center;
  gap: 2px 7px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.behavior-interval summary::-webkit-details-marker { display: none; }
.behavior-interval-chevron { grid-area: chevron; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); }
.behavior-interval-chevron svg { width: 14px; height: 14px; transition: transform .15s var(--ease-out); }
.behavior-interval[open] .behavior-interval-chevron svg { transform: rotate(90deg); }
.behavior-interval-title { grid-area: title; min-width: 0; color: var(--ink); font-size: 12.5px; }
.behavior-interval-title small { color: var(--muted); font-size: 11px; }
.behavior-merge-pill { grid-area: badge; padding: 4px 7px; background: color-mix(in srgb, var(--primary), transparent 88%); color: var(--primary); font-size: 9.5px; }
.behavior-interval-lock { grid-area: lock; color: var(--ink-3); }
.behavior-interval-lock svg { width: 14px; height: 14px; }
.behavior-interval-network { grid-area: network; min-width: 0; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

.behavior-event-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 1px 12px 13px 45px;
  list-style: none;
}

.behavior-event-list::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 20px;
  left: 50px;
  width: 1px;
  background: color-mix(in srgb, var(--primary), transparent 58%);
}

.behavior-event-list li {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 9px;
  min-height: 38px;
  align-items: start;
  padding: 5px 0;
}

.behavior-event-list li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid color-mix(in srgb, var(--surface), transparent 4%);
  border-radius: 50%;
  background: var(--primary);
}

.behavior-event-list time {
  padding-left: 16px;
  color: var(--muted);
  font-size: 10.5px;
}

.behavior-event-list li > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--ink-2);
  font-size: 11.5px;
}

.behavior-event-list strong { font-weight: 620; }
.behavior-event-list small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.behavior-risk-evidence {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface), transparent 28%);
}

.behavior-risk-evidence summary {
  min-height: 52px;
  gap: 9px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.behavior-risk-evidence summary::-webkit-details-marker { display: none; }
.behavior-risk-evidence summary > svg:first-child { width: 21px; height: 21px; color: var(--ink-2); }
.behavior-risk-evidence summary > svg:last-child { width: 15px; height: 15px; margin-left: auto; color: var(--ink-3); }
.behavior-risk-evidence summary span { display: grid; gap: 2px; }
.behavior-risk-evidence summary strong { color: var(--ink); font-size: 11.5px; }
.behavior-risk-evidence > div { padding: 0 12px 12px 42px; color: var(--muted); font-size: 10.5px; }
.behavior-risk-evidence ul { margin: 0; padding-left: 16px; }

.behavior-timeline-state,
.behavior-chart-empty,
.behavior-denied {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.behavior-timeline-state strong,
.behavior-chart-empty strong,
.behavior-denied strong { color: var(--ink); }
.behavior-timeline-state p,
.behavior-chart-empty span,
.behavior-denied p { margin: 0; font-size: 11.5px; }
.behavior-timeline-state > svg,
.behavior-denied > svg { width: 28px; height: 28px; color: var(--primary); }
.behavior-denied { min-height: 320px; grid-template-columns: auto minmax(0, 360px); text-align: left; }
.behavior-denied.is-error > svg,
.behavior-timeline-state.is-error > svg { color: var(--danger); }

.behavior-loading-ring {
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--primary), transparent 72%);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: behavior-spin .8s linear infinite;
}

@keyframes behavior-spin {
  to { transform: rotate(360deg); }
}

.behavior-chart-skeleton {
  height: 270px;
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  align-items: end;
  gap: 7px;
  padding: 12px 8px 28px 32px;
}

.behavior-chart-skeleton i {
  height: var(--skeleton-height);
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--primary), transparent 86%);
  animation: pulse 1.2s ease-in-out infinite alternate;
}

.behavior-load-more {
  width: 100%;
  min-height: 36px;
  color: var(--primary);
}

.behavior-intelligence-modal .behavior-modal-footer {
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
}

.behavior-modal-footer p {
  min-width: 0;
  gap: 7px;
  margin: 0;
}

.behavior-modal-footer p svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.behavior-modal-footer > div { gap: 8px; }
.behavior-modal-footer button { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; }
.behavior-modal-footer button svg { width: 14px; height: 14px; }
.behavior-modal-footer .primary-button { min-width: 92px; justify-content: center; }

body[data-theme="aurora"] .behavior-intelligence-modal,
body[data-theme="aurora"] .behavior-overview-panel,
body[data-theme="aurora"] .behavior-timeline-panel,
body[data-theme="aurora"] .behavior-interval,
body[data-theme="aurora"] .behavior-risk-evidence,
body[data-theme="aurora"] .behavior-day-summary {
  box-shadow: 0 12px 34px rgba(40, 70, 150, .055);
}

body[data-theme="aurora"] .behavior-intelligence-layer {
  background: rgba(235, 240, 250, .58);
}

/* The modal body owns scrolling. Keep both panels and their children in
   normal flow so long timelines cannot shrink underneath risk evidence. */
.behavior-modal-scroll > * { flex-shrink: 0; }
.behavior-overview-panel, .behavior-timeline-panel { min-height: 0; }
.behavior-panel-head { flex-wrap: wrap; }
.behavior-panel-head > div { min-width: 0; }
.behavior-chart-day:first-of-type small { justify-self: start; }
.behavior-chart-day:last-of-type small { justify-self: end; }
.behavior-profile-copy, .behavior-profile-presence, .behavior-session-note,
.behavior-day-summary, .behavior-risk-evidence, .behavior-modal-footer { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .modal-card.behavior-intelligence-modal {
    width: min(760px, calc(100vw - 24px));
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  .behavior-profile-strip {
    grid-template-columns: minmax(180px, 1fr) auto;
  }

  .behavior-profile-presence {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .behavior-analysis-grid {
    grid-template-columns: 1fr;
  }

  .behavior-detail-shield { align-items: start; }
  .behavior-detail-shield > span {
    position: sticky;
    top: 20px;
    margin-top: 32px;
  }
}

@media (max-width: 620px) {
  .behavior-intelligence-layer { padding: 6px; }
  .modal-card.behavior-intelligence-modal { width: calc(100vw - 12px); height: calc(100vh - 12px); max-height: calc(100vh - 12px); border-radius: 14px; }
  .behavior-modal-scroll { padding: 12px; }
  .behavior-profile-strip { grid-template-columns: 1fr; gap: 10px; }
  .behavior-profile-presence,
  .behavior-range-tools { grid-column: auto; grid-row: auto; justify-content: flex-start; }
  .behavior-range-tools,
  .behavior-date-range,
  .behavior-date-range-trigger { width: 100%; }
  .behavior-date-range-trigger { justify-content: flex-start; }
  .behavior-date-range-popover { right: auto; left: 0; width: min(338px, calc(100vw - 36px)); }
  .behavior-panel-head { align-items: flex-start; }
  .behavior-chart { gap: 2px; }
  .behavior-chart-legend { gap: 9px; overflow-x: auto; }
  .behavior-day-summary { grid-template-columns: 1fr 1fr; }
  .behavior-day-summary > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .behavior-intelligence-modal .behavior-modal-footer { align-items: stretch; flex-direction: column; }
  .behavior-modal-footer > div { justify-content: flex-end; }
}

@media (max-width: 390px) {
  .behavior-date-range-popover { width: calc(100vw - 36px); padding: 12px; }
  .behavior-date-range-actions { grid-template-columns: auto 1fr auto auto; }
}

body[data-theme="aurora"] .message-row.is-failed .bubble p {
  color: #8f2433;
}

body[data-theme="aurora"] .notice-modal-icon {
  color: #2563eb;
  border-color: rgba(37, 99, 235, .18);
  background: linear-gradient(145deg, #eff6ff, #eef2ff);
}

body[data-theme="aurora"] .notice-modal-body {
  border-color: rgba(148, 163, 184, .26);
  background:
    linear-gradient(180deg, #ffffff, #f9fbff),
    var(--surface);
}

body[data-theme="aurora"] .notice-modal-content {
  color: #172033;
}

body[data-theme="aurora"] .notice-modal-meta {
  border-top-color: rgba(226, 232, 240, .95);
  color: #8391aa;
}

body[data-theme="aurora"] .notice-modal-meta strong {
  color: #64748b;
}

body[data-theme="aurora"] .notice-modal-actions button:not(.primary-button):not(.danger-button) {
  color: #52617a;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-head {
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 165, 250, .12), transparent 34%),
    #ffffff;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-body {
  border-color: rgba(203, 213, 225, .88);
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    #ffffff;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-content {
  color: #172033;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-meta {
  border-top-color: rgba(226, 232, 240, .95);
  background: #f8fbff;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-meta strong {
  color: #2563eb;
  background: #eef5ff;
}

body[data-theme="aurora"] .announcement-top-button {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(203, 213, 225, .9);
  color: #60708d;
}

body[data-theme="aurora"] .announcement-top-button:hover {
  background: #eef5ff;
  border-color: rgba(96, 137, 255, .42);
  color: #315fe9;
}

body[data-theme="aurora"] .message-sound-toggle {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(203, 213, 225, .9);
  color: #60708d;
}

body[data-theme="aurora"] .message-sound-toggle:hover {
  background: #eef5ff;
  border-color: rgba(96, 137, 255, .42);
  color: #315fe9;
}

body[data-theme="aurora"] .message-sound-toggle.is-on {
  background: #eef5ff;
  border-color: rgba(96, 137, 255, .56);
  color: #315fe9;
  box-shadow: 0 10px 22px rgba(96, 137, 255, .16);
}

body[data-theme="aurora"] .announcement-top-button span {
  border-color: #ffffff;
  background: #f0526d;
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(240, 82, 109, .28);
}

body[data-theme="aurora"] .announcement-row {
  border-color: rgba(226, 232, 240, .92);
  background:
    linear-gradient(90deg, rgba(96, 165, 250, .42) 0 3px, transparent 3px),
    #ffffff;
}

body[data-theme="aurora"] .announcement-row:hover {
  border-color: rgba(96, 137, 255, .36);
  background:
    linear-gradient(90deg, rgba(96, 137, 255, .72) 0 3px, transparent 3px),
    #f7faff;
}

body[data-theme="aurora"] .announcement-row.is-unread {
  background:
    linear-gradient(90deg, #ff6b86 0 3px, transparent 3px),
    linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
}

body[data-theme="aurora"] .announcement-row-title-line strong {
  color: #172038;
}

body[data-theme="aurora"] .announcement-row-unread {
  color: #d7385a;
  background: #fff0f4;
}

body[data-theme="aurora"] .announcement-row-side i {
  background: #f1f5ff;
  color: #73819d;
}

body[data-theme="aurora"] .message-state[data-state="failed"],
body[data-theme="aurora"] .message-row.is-me .message-state[data-state="failed"] {
  color: #d33f58;
}

body[data-theme="aurora"] .message-state {
  color: #71809b;
  font-weight: 650;
}

body[data-theme="aurora"] .message-state[data-state="sent"],
body[data-theme="aurora"] .message-state[data-state="delivered"] {
  color: #65748f;
}

body[data-theme="aurora"] .message-row.is-me .message-state,
body[data-theme="aurora"] .message-row.is-me .message-state[data-state="read"] {
  color: #159a70;
}

body[data-theme="aurora"] .message-row.is-me button.message-state {
  text-decoration-color: rgba(21, 154, 112, .56);
}

body[data-theme="aurora"] .message-row.is-me button.message-state::before {
  color: #159a70;
}

body[data-theme="aurora"] .status-strip-stack {
  border-bottom-color: rgba(210, 220, 238, .56);
  background: rgba(250, 252, 255, .88);
}

body[data-theme="aurora"] .status-strip-stack .notice-strip {
  border-color: rgba(124, 140, 255, .16);
  border-left-color: #6a78f0;
  background: #f7f8ff;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip {
  border-color: rgba(79, 140, 255, .16);
  border-left-color: #4f8cff;
  background: #f7fbff;
  box-shadow: none;
}

body[data-theme="aurora"] .status-strip-stack .notice-strip .room-strip-main > span:first-child {
  color: #5968d8;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip .room-strip-main > span:first-child {
  color: #2f76d2;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip .room-strip-main strong {
  color: #1b2336;
  font-weight: 650;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip .room-strip-main em {
  background: #dce8ff;
  color: #356dbb;
}

body[data-theme="aurora"] .rail-item {
  color: #6b7894;
}

body[data-theme="aurora"] .rail-item:hover {
  color: #24304a;
  background: rgba(79, 140, 255, .08);
}

body[data-theme="aurora"] .rail-item.is-active {
  color: #365dff;
  border-color: rgba(82, 113, 255, .28);
  background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .13));
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .12),
    0 10px 28px rgba(79, 140, 255, .16);
}

body[data-theme="aurora"] .rail-item.is-active svg {
  stroke: currentColor;
}

body[data-theme="aurora"] .filter-tabs {
  background: rgba(255, 255, 255, .62);
  border-color: rgba(24, 34, 48, .12);
}

body[data-theme="aurora"] .filter-tabs button {
  color: #56627d;
}

body[data-theme="aurora"] .filter-tabs button.is-active {
  color: #2242a4;
  background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .12));
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .22),
    0 6px 16px rgba(79, 140, 255, .10);
}

body[data-theme="aurora"] .context-tabs button.is-active {
  color: #2242a4;
  background: linear-gradient(135deg, rgba(79, 140, 255, .17), rgba(124, 107, 255, .11));
  box-shadow: inset 0 0 0 1px rgba(82, 113, 255, .22);
}

body[data-theme="aurora"] .conversation-card.is-active,
body[data-theme="aurora"] .plain-row.is-active,
body[data-theme="aurora"] .file-card.is-active {
  color: #1b2336;
  border-color: rgba(82, 113, 255, .22);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .12), rgba(124, 107, 255, .075)),
    rgba(255, 255, 255, .92);
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .10),
    0 12px 28px rgba(35, 48, 82, .08);
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-title strong,
body[data-theme="aurora"] .plain-row.is-active strong,
body[data-theme="aurora"] .file-card.is-active strong {
  color: #172038;
}

body[data-theme="aurora"] .conversation-card.is-active .line-two,
body[data-theme="aurora"] .conversation-card.is-active .conversation-meta time,
body[data-theme="aurora"] .conversation-card.is-active .file-text small,
body[data-theme="aurora"] .plain-row.is-active small,
body[data-theme="aurora"] .file-card.is-active small {
  color: #66738f;
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-flag.is-pin,
body[data-theme="aurora"] .conversation-title .conversation-flag.is-pin {
  color: #2f9bd8;
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-flag.is-mute,
body[data-theme="aurora"] .conversation-title .conversation-flag.is-mute {
  color: #b77a11;
}

body[data-theme="aurora"] .setting-nav-row:hover {
  background: rgba(79, 140, 255, .055);
}

body[data-theme="aurora"] .setting-nav-row.is-active {
  border-color: rgba(82, 113, 255, .30);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .105), rgba(124, 107, 255, .07)),
    rgba(255, 255, 255, .86);
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .16),
    0 14px 30px rgba(48, 72, 120, .10);
}

body[data-theme="aurora"] .setting-nav-row.is-active .setting-nav-icon {
  color: #315efb;
  background: rgba(82, 113, 255, .10);
  border: 1px solid rgba(82, 113, 255, .20);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(79, 140, 255, .12);
}

body[data-theme="aurora"] .setting-nav-row.is-active strong {
  color: #172038;
}

body[data-theme="aurora"] .setting-nav-row.is-active small {
  color: #5f6f90;
}

button,
input,
textarea {
  border-radius: var(--r-sm);
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

button:hover {
  background: var(--raise);
  border-color: var(--line-2);
}

input,
textarea,
select {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
}

.im-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(300px, var(--side-w)) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 21, 34, .92), rgba(9, 12, 20, .96));
  box-shadow: var(--sh);
}

.im-shell.is-detail-open {
  grid-template-columns: var(--rail-w) minmax(300px, var(--side-w)) minmax(0, 1fr) minmax(286px, var(--detail-w));
}

.im-shell[data-view="files"],
.im-shell[data-view="settings"],
.im-shell[data-view="rtc"]:not(.is-detail-open),
.im-shell[data-view="files"].is-detail-open,
.im-shell[data-view="settings"].is-detail-open {
  grid-template-columns: var(--rail-w) minmax(300px, var(--side-w)) minmax(0, 1fr);
}

.app-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  padding: 20px 0 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 18, .5);
  color: var(--ink-3);
}

.brand-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  margin: 0 0 14px;
  border: 0;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-size: 0;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(79, 140, 255, .45);
}

.brand-button.has-logo {
  background: var(--grad);
}

.brand-button.has-logo img,
.brand-button.has-logo span {
  display: none;
}

.brand-button::after {
  content: "IM";
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.rail-nav,
.rail-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rail-footer {
  margin-top: auto;
}

.rail-item {
  position: relative;
  width: 48px;
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-3);
  transition: .18s ease;
}

.rail-item svg {
  width: 22px;
  height: 22px;
}

.rail-mark,
.rail-label {
  display: none;
}

.rail-item:hover {
  color: var(--ink);
  background: var(--raise);
}

.rail-item.is-active {
  color: #fff;
  background: var(--grad-soft);
  border-color: rgba(124, 140, 255, .35);
}

.rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad);
}

.rail-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg-soft);
  border-radius: 8px;
  background: var(--bad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.rail-user {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b4670, #5b6bb0);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.presence-dot {
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border: 2.5px solid var(--bg-soft);
  background: var(--soft);
}

.side-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(10, 14, 23, .4);
}

.account-block {
  display: none;
}

.side-panel > .panel-head {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 0;
  border: 0;
  background: transparent;
}

.side-panel > .panel-head strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: .2px;
}

.panel-head-acts {
  display: flex;
  gap: 12px;
}

.enterprise-switcher {
  width: calc(100% - 36px);
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 4px;
  padding: 10px 10px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 58%);
  border-radius: 16px;
  background:
    radial-gradient(160px 72px at 0% 0%, color-mix(in srgb, var(--primary), transparent 72%), transparent 72%),
    color-mix(in srgb, var(--surface-soft), transparent 4%);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  transition:
    transform .16s var(--ease-out),
    border-color .16s var(--ease-out),
    background .16s var(--ease-out);
}

.enterprise-switcher:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 48%);
  background:
    radial-gradient(180px 82px at 0% 0%, color-mix(in srgb, var(--primary), transparent 70%), transparent 74%),
    color-mix(in srgb, var(--surface-strong), transparent 12%);
}

.enterprise-switcher.is-readonly {
  cursor: default;
  grid-template-columns: auto minmax(0, 1fr);
}

.enterprise-switcher.is-readonly:hover,
.enterprise-switcher.is-readonly:active {
  transform: none;
}

.enterprise-switcher:active {
  transform: translateY(0);
}

.enterprise-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f8cff, #765dff);
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .2px;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary), transparent 72%);
}

.enterprise-mark.is-large {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  font-size: 16px;
}

.enterprise-mark .workspace-logo {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.enterprise-mark .workspace-logo img,
.enterprise-mark .workspace-logo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.enterprise-mark .workspace-logo img {
  display: block;
  object-fit: cover;
  opacity: 0;
}

.enterprise-mark .workspace-logo img[hidden] {
  display: none;
}

.enterprise-mark .workspace-logo-fallback {
  display: grid;
  place-items: center;
}

.enterprise-mark .workspace-logo.is-logo-loaded:not(.is-logo-broken) img {
  opacity: 1;
}

.enterprise-mark .workspace-logo.is-logo-loaded:not(.is-logo-broken) .workspace-logo-fallback {
  opacity: 0;
}

.enterprise-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 34px;
}

.enterprise-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 820;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enterprise-copy small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enterprise-code {
  color: var(--ink-3);
  font-weight: 620;
}

.enterprise-pill {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 80%);
  color: color-mix(in srgb, var(--primary), #fff 18%);
  font-size: 11px;
  font-weight: 780;
  text-align: center;
}

.icon-action,
.detail-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
}

.icon-action svg,
.detail-action svg {
  width: 16px;
  height: 16px;
}

.icon-action:hover,
.detail-action:hover,
.detail-action.is-active {
  color: var(--ink);
  border-color: var(--line-2);
}

.panel-search {
  padding: 14px 18px 12px;
  border: 0;
  background: transparent;
}

.search-field {
  height: 38px;
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 8%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: var(--ink-2);
  box-sizing: border-box;
  transition:
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    background .16s var(--ease-out);
}

.search-field:focus-within {
  border-color: rgba(91, 157, 255, .78);
  background: rgba(91, 157, 255, .08);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, .18);
}

.search-field span {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 15px;
  height: 15px;
  border-color: var(--ink-2);
  pointer-events: none;
}

.search-field span::after {
  background: var(--ink-2);
}

.search-field input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 36px;
  box-shadow: none;
  caret-color: var(--primary);
  appearance: none;
}

.search-field input:focus {
  outline: 0;
  box-shadow: none;
}

.search-field input::placeholder {
  color: color-mix(in srgb, var(--ink-2), transparent 14%);
}

.filter-tabs {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}

.filter-tabs button {
  flex: 1;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: color-mix(in srgb, var(--ink-2), #fff 8%);
  font-size: 12.5px;
  font-weight: 560;
}

.filter-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-badge {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--unread-badge-bg);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 820;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow:
    0 6px 16px var(--unread-badge-shadow),
    inset 0 0 0 1px var(--unread-badge-ring);
}

.filter-tabs button.is-active {
  color: #fff;
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .3);
}

.side-content,
.message-scroll,
.page-scroll,
.context-body,
.drawer-body {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

.side-content {
  flex: 1;
  min-height: 0;
  padding: 8px 10px 16px;
}

.side-section-head {
  min-height: auto;
  padding: 12px 10px 6px;
  color: color-mix(in srgb, var(--ink-3), #fff 12%);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.side-section-head strong {
  color: color-mix(in srgb, var(--ink-3), #fff 12%);
}

.side-section-count {
  color: color-mix(in srgb, var(--ink-3), #fff 12%);
  background: transparent;
}

.conversation-stack {
  gap: 6px;
}

.plain-list,
.file-list,
.card-list {
  gap: 2px;
}

.conversation-stack + .side-section-head {
  margin-top: 10px;
}

.group-list-sections {
  display: grid;
  gap: 12px;
}

.group-list-section {
  display: grid;
  gap: 4px;
}

.side-section-head.group-subsection-head {
  padding-top: 10px;
  padding-bottom: 4px;
}

.group-subsection-head .side-section-count {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink-2), var(--muted) 24%);
  font-size: 11px;
  letter-spacing: 0;
}

.side-empty-note {
  margin: 0 4px 2px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--line), transparent 12%);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel), transparent 36%);
  font-size: 12px;
  line-height: 1.45;
}

.side-section-head.is-mentions strong {
  color: color-mix(in srgb, var(--accent), var(--ink-3) 22%);
}

.mention-message-stack {
  display: grid;
  gap: 8px;
}

.mention-message-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition:
    border-color .18s var(--ease-out),
    background .18s var(--ease-out),
    transform .18s var(--ease-out),
    box-shadow .18s var(--ease-out);
}

.mention-message-card:hover {
  background: var(--raise);
  border-color: color-mix(in srgb, var(--primary), var(--line) 72%);
  transform: translateY(-1px);
}

.mention-message-card.is-active {
  border-color: color-mix(in srgb, var(--primary), var(--line) 45%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 82%), color-mix(in srgb, var(--secondary), transparent 88%)),
    var(--surface-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 82%);
}

.mention-message-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff805c, #ff5f7e);
  color: #fff;
  font-size: 14px;
  font-weight: 820;
  box-shadow: 0 10px 24px rgba(255, 95, 126, .18);
}

.mention-message-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mention-message-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mention-message-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-message-head time {
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
}

.mention-message-state {
  margin-left: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.mention-message-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 820;
  line-height: 18px;
  white-space: nowrap;
  letter-spacing: 0;
}

.mention-message-unread {
  background: color-mix(in srgb, var(--primary), transparent 84%);
  color: color-mix(in srgb, var(--primary), var(--ink) 18%);
}

.mention-message-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-message-meta b {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), transparent 84%);
  color: var(--accent);
  font-size: 10px;
  font-weight: 820;
}

.mention-message-card.is-read .mention-message-meta b {
  background: color-mix(in srgb, var(--ink-3), transparent 88%);
  color: var(--ink-3);
}

.mention-message-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mention-message-card.is-read .mention-message-snippet {
  color: var(--ink-3);
}

.side-section-head.is-pinned strong {
  color: color-mix(in srgb, var(--primary), var(--ink-3) 35%);
}

.directory-zone {
  display: grid;
  gap: 6px;
}

.directory-zone + .directory-zone {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.directory-modules {
  padding-bottom: 2px;
}

.directory-module {
  position: relative;
  min-height: 64px;
}

.directory-module-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.directory-entry-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0 6px;
  border: 2px solid color-mix(in srgb, var(--surface), transparent 4%);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7080, #ff4d66);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 77, 102, .28);
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
  line-height: 1;
}

body[data-theme="aurora"] .directory-entry-badge {
  border-color: #fff;
  box-shadow: 0 8px 18px rgba(255, 77, 102, .22);
}

body[data-theme="midnight"] .directory-entry-badge {
  border-color: #121826;
  box-shadow: 0 8px 18px rgba(255, 77, 102, .34);
}

.contact-alpha-list {
  display: grid;
  gap: 10px;
}

.alpha-group {
  display: grid;
  gap: 4px;
}

.alpha-title {
  padding: 6px 10px 2px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0;
}

.contact-row {
  min-height: 62px;
}

.contact-window {
  position: relative;
  min-width: 0;
  overflow-anchor: none;
}

.contact-window-heading {
  padding-bottom: 8px;
}

.contact-window-row-gap {
  padding-bottom: 6px;
}

body[data-display-density="compact"] .contact-window-row-gap {
  padding-bottom: 4px;
}

.contact-window-group-end {
  padding-bottom: 10px;
}

.contact-window-step:not([hidden]) {
  position: absolute;
  z-index: 1;
}

.contact-window-step:not([hidden]):not(:focus) {
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-window-page-step:not([hidden]) {
  margin: 8px 0;
}

.directory-sync {
  margin: 0 10px 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--ink-3);
  font-size: 12px;
}

.directory-sync.is-warn {
  border-color: rgba(255, 204, 107, .28);
  color: var(--warn);
}

.conversation-card,
.plain-row,
.file-card {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: .14s ease;
}

.conversation-card:hover,
.plain-row:hover,
.file-card:hover {
  background: var(--raise);
}

.conversation-card.is-active,
.plain-row.is-active,
.file-card.is-active {
  background: linear-gradient(135deg, rgba(79, 140, 255, .22), rgba(124, 107, 255, .15));
  border-color: rgba(124, 140, 255, .40);
  box-shadow:
    inset 0 0 0 1px rgba(124, 140, 255, .16),
    0 10px 26px rgba(31, 63, 140, .16);
}

.conversation-card.is-active::before {
  display: none;
}

.conversation-card .avatar,
.plain-row .avatar,
.file-card .file-type,
.avatar:not(.avatar-xl) {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3f7bff, #6ad6ff);
  color: #fff;
  font-size: 16px;
  font-weight: 680;
}

.conversation-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
}

.conversation-avatar-wrap .avatar {
  grid-area: 1 / 1;
}

.conversation-kind-badge {
  position: absolute;
  left: -5px;
  top: auto;
  bottom: -5px;
  z-index: 2;
  min-width: 20px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid rgba(250, 204, 21, .46);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255, 244, 187, .94), rgba(242, 190, 74, .90));
  color: #5f4308;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  box-shadow:
    0 0 0 2px var(--surface),
    0 6px 12px rgba(0, 0, 0, .24);
}

body[data-theme="aurora"] .conversation-kind-badge {
  border-color: rgba(234, 179, 8, .34);
  background: linear-gradient(135deg, #fff7d6, #f6d87a);
  color: #6b4b08;
  box-shadow:
    0 0 0 2px var(--surface),
    0 4px 10px rgba(148, 111, 18, .16);
}

.avatar-presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--soft);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .04);
}

.presence-dot[data-status="online"],
.avatar-presence[data-status="online"] {
  background: var(--ok);
}

.presence-dot[data-status="offline"],
.avatar-presence[data-status="offline"] {
  background: var(--soft);
}

.presence-dot[data-status="unknown"],
.avatar-presence[data-status="unknown"] {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--soft);
}

.avatar-soft {
  background: linear-gradient(135deg, #b66bff, #7c6bff);
  color: #fff;
}

.avatar-user,
.avatar.is-system {
  background: linear-gradient(135deg, #3a4670, #566089);
}

.line-one,
.t-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-card .line-one {
  min-width: 0;
  justify-content: space-between;
}

.conversation-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.conversation-title strong,
.conversation-card .line-one strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.conversation-flags {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: max-content;
}

.conversation-flag {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  background: transparent;
  box-shadow: none;
  transition:
    transform .16s var(--ease-out),
    filter .16s var(--ease-out);
}

.conversation-card:hover .conversation-flag {
  filter: saturate(1.08) brightness(1.06);
  transform: translateY(-1px);
}

.conversation-flag.is-pin {
  color: #6ad6ff;
  background: transparent;
}

.conversation-flag.is-mute {
  color: #ffcc6b;
  background: transparent;
}

.conversation-flag svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.35;
}

.conversation-body strong,
.file-text strong,
.plain-row strong {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
}

.line-one time,
.conversation-body span,
.file-text small,
.plain-row small,
.plain-row i,
.setting-nav-row i {
  color: var(--ink-3);
  font-size: 11.5px;
}

.conversation-title .conversation-flag {
  font-size: 0;
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(1px);
}

.conversation-title .conversation-flag.is-pin {
  color: #6ad6ff;
  background: transparent;
}

.conversation-title .conversation-flag.is-mute {
  color: #ffcc6b;
  background: transparent;
}

.conversation-title .conversation-flag svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.35;
}

.conversation-body .line-one {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conversation-body .conversation-title {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--ink);
}

.conversation-body .conversation-title strong {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 720;
}

/* All conversation types share the full first row, so time stays at the same
   right edge regardless of the unread state in the preview row. */
.conversation-card {
  grid-template-rows: 22px 20px;
  row-gap: 4px;
}

.conversation-card > .conversation-avatar-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
}

.conversation-card > .conversation-body {
  display: contents;
}

.conversation-card .line-one {
  grid-column: 2 / 4;
  grid-row: 1;
}

.conversation-card .line-two {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin-top: 0;
}

.conversation-card > .conversation-state {
  grid-column: 3;
  grid-row: 2;
}

/* Keep the group total distinct from unread badges and reserve room for the name. */
.conversation-body .conversation-group-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  min-width: max-content;
  white-space: nowrap;
  gap: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.conversation-body .conversation-group-count-value {
  flex: 0 0 auto;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.conversation-card .conversation-title > strong {
  min-width: 0;
}

.conversation-card .conversation-meta {
  flex: 0 0 auto;
  min-width: max-content;
}

.conversation-card .conversation-meta time {
  white-space: nowrap;
}

/* Keep identity content together while reserving the independent time column. */
.conversation-title > .certification-name-slot {
  flex: 0 1 auto;
  max-width: 100%;
}

.topbar-title h1.identity-name-line {
  width: 100%;
  max-width: 100%;
}

.topbar-title h1 > .identity-display-name-text {
  flex: 0 1 auto;
}

.topbar-title h1 > .certification-name-slot {
  max-width: min(18em, 60%);
}

.topbar-title > div {
  min-width: 0;
}

.topbar-title p {
  overflow-wrap: anywhere;
}

.conversation-body .conversation-title .conversation-flags {
  width: auto;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  overflow: visible;
}

.conversation-body .conversation-title .conversation-flag {
  display: inline-grid;
  place-items: center;
  overflow: visible;
}

.line-two,
.line-three {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13px;
}

.conversation-card .line-two {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card .line-two span,
.conversation-card .line-three,
.conversation-card .line-three span,
.conversation-summary {
  color: var(--ink-2);
}

.conversation-card .line-one time,
.conversation-meta time {
  color: color-mix(in srgb, var(--ink-3), #fff 10%);
  font-weight: 560;
}

.conversation-card.is-active .line-two,
.conversation-card.is-active .line-two span,
.conversation-card.is-active .line-three,
.conversation-card.is-active .line-three span,
.conversation-card.is-active .conversation-summary {
  color: color-mix(in srgb, var(--ink-2), #fff 10%);
}

.conversation-card.is-active .line-one time,
.conversation-card.is-active .conversation-meta time {
  color: color-mix(in srgb, var(--ink-2), #fff 8%);
}

.conversation-summary {
  min-width: 0;
}

.conversation-summary.is-mention {
  color: var(--ink-2);
}

.conversation-mention-mark {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-right: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 95, 126, .14);
  color: #ff637a;
  font-style: normal;
  font-weight: 820;
}

body[data-theme="aurora"] .conversation-summary.is-mention {
  color: #5f6f8f;
}

body[data-theme="aurora"] .conversation-mention-mark {
  background: rgba(226, 72, 96, .11);
  color: #dc3752;
}

.line-three {
  display: none;
}

.conversation-state {
  min-width: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.conversation-state b {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(79, 140, 255, .4);
}

.conversation-state b.is-alert {
  background: var(--unread-badge-bg);
  box-shadow:
    0 5px 14px var(--unread-badge-shadow),
    inset 0 0 0 1px var(--unread-badge-ring);
}

.conversation-state b.is-muted {
  border: 1px solid color-mix(in srgb, #eef3fb, transparent 18%);
  background: linear-gradient(180deg, #eef3fb 0%, #cbd6e6 100%);
  color: #334155;
  box-shadow:
    0 4px 12px rgba(10, 18, 32, .24),
    inset 0 1px 0 rgba(255, 255, 255, .72);
}

.conversation-card.is-active .conversation-state b.is-muted {
  border-color: rgba(255, 255, 255, .72);
  background: linear-gradient(180deg, #f8fbff 0%, #d7e1ef 100%);
  color: #253348;
  box-shadow:
    0 4px 12px rgba(12, 20, 36, .26),
    inset 0 1px 0 rgba(255, 255, 255, .85);
}

body[data-theme="aurora"] .conversation-state b.is-muted {
  border-color: rgba(100, 116, 139, .24);
  background: linear-gradient(180deg, #e7edf6 0%, #bac6d7 100%);
  color: #27364c;
  box-shadow:
    0 3px 9px rgba(64, 78, 104, .16),
    inset 0 1px 0 rgba(255, 255, 255, .72);
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-state b.is-muted {
  border-color: rgba(82, 113, 255, .24);
  background: linear-gradient(180deg, #eef4ff 0%, #cbd8ee 100%);
  color: #24324a;
}

.settings-nav-list {
  gap: 12px;
  padding: 4px 10px 18px;
}

.settings-side-panel {
  background: rgba(10, 14, 23, .42);
}

.settings-side-head {
  flex: 0 0 auto;
  padding: 24px 28px 18px;
}

.settings-side-head h1 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 720;
  letter-spacing: 0;
}

.setting-nav-row {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 76px;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
}

.setting-nav-row:hover {
  background: rgba(255, 255, 255, .035);
}

.setting-nav-row.is-active {
  border-color: rgba(124, 140, 255, .36);
  background: linear-gradient(135deg, rgba(79, 140, 255, .16), rgba(124, 107, 255, .12));
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .12);
}

.setting-nav-icon,
.settings-pane-icon {
  display: inline-grid;
  place-items: center;
  color: var(--ink-2);
}

.setting-nav-icon {
  width: 34px;
  height: 34px;
}

.setting-nav-row.is-active .setting-nav-icon {
  color: #fff;
}

.setting-nav-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.setting-nav-row strong {
  font-size: 17px;
  font-weight: 650;
}

.setting-nav-row small {
  margin-top: 3px;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.workspace-topbar {
  min-height: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 23, .5);
  backdrop-filter: blur(10px);
}

.topbar-title {
  flex: 1;
  min-width: 0;
  gap: 12px;
}

.topbar-title h1 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 660;
}

.topbar-title p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.subtitle-sep {
  color: var(--ink-3);
}

[data-login-ip-region] {
  color: var(--muted);
}

[data-login-ip-region][data-status="online"] {
  color: var(--ok);
}

.inline-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok);
  font-weight: 650;
}

.inline-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor, transparent 82%);
}

.inline-status[data-status="offline"] {
  color: var(--ink-3);
}

body[data-theme="aurora"] .workspace-topbar .inline-status[data-status="offline"],
body[data-theme="aurora"] .workspace-topbar [data-login-ip-region] {
  color: var(--muted);
  font-weight: 650;
}

body[data-theme="aurora"] .workspace-topbar .inline-status[data-status="online"],
body[data-theme="aurora"] .workspace-topbar [data-login-ip-region][data-status="online"] {
  color: #087f5b;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions > button:not(.icon-action):not(.detail-action) {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 12.5px;
}

.topbar-actions > button[data-action="rtc-audio"] svg {
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -2px;
}

.topbar-actions .primary-button,
.primary-button {
  border: 0;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 140, 255, .35);
}

.chat-entry-button,
.topbar-actions .chat-entry-button,
.directory-card-actions .chat-entry-button {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
}

.chat-entry-button:hover,
.topbar-actions .chat-entry-button:hover,
.directory-card-actions .chat-entry-button:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 55%);
  background: transparent;
  color: var(--ink);
}

.ok-chip,
.alert-chip {
  display: none;
}

.room-strip {
  margin: 14px 22px 0;
  padding: 12px 16px;
  border: 1px solid rgba(124, 140, 255, .22);
  border-radius: 14px;
  background: var(--grad-soft);
}

.room-strip-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.room-strip-main > span:first-child {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 700;
}

.room-strip span,
.room-strip strong {
  color: var(--ink);
  font-size: 12.5px;
}

.room-strip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.room-strip-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
}

.status-strip-stack {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  gap: 3px;
  padding: 3px 16px 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 66%);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  backdrop-filter: blur(10px);
}

.status-strip-stack .room-strip {
  margin: 0;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 2px 6px 2px 8px;
  border-left-width: 2px;
  border-radius: 8px;
  box-shadow: none;
}

.status-strip-stack .room-strip-main {
  min-width: 0;
  min-height: 18px;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.status-strip-stack .room-strip-main:hover {
  transform: none;
  box-shadow: none;
}

.status-strip-stack .room-strip-main > span:first-child {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
}

.status-strip-stack .room-strip-main strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 540;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip-stack .room-strip-main em {
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(91, 157, 255, .14);
  color: #8bb9ff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 760;
}

.notice-strip {
  border-color: rgba(124, 140, 255, .15);
  border-left-color: #7c8cff;
  background: color-mix(in srgb, #7c8cff, var(--surface) 94%);
}

.pinned-strip {
  border-color: rgba(106, 214, 255, .15);
  border-left-color: #6ad6ff;
  background: color-mix(in srgb, #6ad6ff, var(--surface) 94%);
}

.pinned-strip svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.35;
}

.room-strip-close {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
}

.room-strip-close:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: var(--raise);
}

.room-strip-close svg {
  width: 10px;
  height: 10px;
}

.notice-modal {
  width: min(520px, calc(100vw - 36px));
}

/* Compact call notices use content directly, without the announcement body wrapper. */
.rtc-license-notice {
  --rtc-notice-padding: clamp(18px, 4vw, 24px);
  width: min(420px, calc(100vw - 32px));
}

.rtc-license-notice .notice-modal-head {
  padding: 22px var(--rtc-notice-padding) 0;
  border-bottom: 0;
}

.rtc-license-notice .notice-modal-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.rtc-license-notice .notice-modal-content {
  padding: 16px var(--rtc-notice-padding) 22px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.rtc-license-notice .notice-modal-actions {
  padding: 0 var(--rtc-notice-padding) 22px;
  border-top: 0;
  justify-content: flex-end;
}

.rtc-license-notice .notice-modal-actions .primary-button {
  min-width: 88px;
}

.notice-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 18%);
}

.announcement-center-modal .notice-modal-head {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.notice-modal-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.notice-modal-head-actions .soft-button {
  min-height: 34px;
  white-space: nowrap;
}

.notice-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.notice-modal-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 15px;
  color: #7dd3fc;
  background:
    radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--primary), white 18%) 0 1px, transparent 2px),
    linear-gradient(145deg, rgba(96, 165, 250, .16), rgba(99, 102, 241, .10));
}

.notice-modal-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.notice-modal-icon.is-danger {
  border-color: rgba(248, 113, 113, .34);
  color: #fecaca;
  background: linear-gradient(145deg, rgba(248, 113, 113, .18), rgba(127, 29, 29, .18));
}

.notice-modal-body {
  display: grid;
  gap: 18px;
  margin: 20px 22px 8px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 20%);
  border-radius: 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 6%), color-mix(in srgb, var(--surface), transparent 0%)),
    var(--surface);
}

.notice-modal-content {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.85;
  letter-spacing: 0;
}

.notice-modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
}

.notice-modal-meta strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-delete-preview {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 55%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.admin-delete-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-delete-preview strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 22px 22px;
  border-top: 0;
}

.notice-modal-actions button:not(.primary-button):not(.danger-button) {
  min-height: 40px;
  padding: 0 16px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.notice-modal-actions .primary-button {
  min-width: 92px;
  min-height: 40px;
}

.notice-modal-actions .danger-button {
  min-width: 104px;
  min-height: 40px;
  padding: 0 16px;
  border-color: color-mix(in srgb, var(--danger), transparent 30%);
  color: #1b2336;
  background: var(--danger);
}

.notice-modal-actions .danger-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger), #000 12%);
}

.notice-modal-actions .danger-button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.announcement-detail-modal {
  width: min(540px, calc(100vw - 36px));
}

.announcement-detail-modal .notice-modal-head {
  padding: 22px 22px 17px;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--primary), transparent 88%), transparent 34%),
    var(--surface);
}

.announcement-detail-modal .notice-modal-title {
  gap: 14px;
}

.announcement-detail-modal .notice-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
}

.announcement-detail-modal .notice-modal-title h2 {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-detail-modal .notice-modal-body {
  gap: 0;
  margin: 18px 22px 18px;
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--line-2), transparent 14%);
  border-radius: 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 2%), color-mix(in srgb, var(--surface), transparent 0%)),
    var(--surface);
}

.announcement-detail-modal .notice-modal-content {
  min-height: 88px;
  padding: 22px 24px 20px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.75;
}

.announcement-detail-modal .notice-modal-meta {
  padding: 14px 24px;
  border-top-color: color-mix(in srgb, var(--line), transparent 14%);
  background: color-mix(in srgb, var(--surface-soft), transparent 20%);
}

.announcement-detail-modal .notice-modal-meta strong {
  min-height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.announcement-detail-modal .notice-modal-actions {
  padding: 4px 22px 22px;
}

.announcement-detail-modal .notice-modal-actions .primary-button {
  min-width: 100px;
}

.announcement-center-modal {
  width: min(620px, calc(100vw - 36px));
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(66vh, 600px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 20px 24px;
}

.announcement-row {
  box-sizing: border-box;
  width: 100%;
  display: block;
  min-height: 108px;
  padding: 17px 16px 18px 20px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 12%);
  border-radius: 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 74%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--surface-soft), var(--surface) 34%);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  line-height: normal;
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.announcement-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 50%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--primary-soft), var(--surface) 72%);
}

.announcement-row.is-unread {
  border-color: color-mix(in srgb, var(--primary), transparent 44%);
  background:
    linear-gradient(90deg, #ff6b86 0 3px, transparent 3px),
    color-mix(in srgb, var(--primary-soft), var(--surface) 74%);
}

.announcement-row-copy {
  width: 100%;
  min-height: 72px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  overflow: hidden;
}

.announcement-row-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.announcement-row-title-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.announcement-row-title-line strong {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink), #ffffff 10%);
  font-size: 16px;
  font-weight: 860;
  line-height: 1.42;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-row-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-row-side {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
  min-width: max-content;
  white-space: nowrap;
}

.announcement-row-unread {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #ff6b86;
  background: color-mix(in srgb, #ff6b86, transparent 88%);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.announcement-row-side time {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.announcement-row-side i {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), transparent 16%);
  font-style: normal;
  font-size: 17px;
  line-height: 1;
}

.announcement-empty {
  display: grid;
  gap: 6px;
  padding: 38px 18px;
  border: 1px dashed var(--line-2);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.announcement-empty strong {
  color: var(--ink);
  font-size: 16px;
}

@media (max-width: 520px) {
  .notice-modal-head,
  .announcement-center-modal .notice-modal-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 16px 16px 14px;
  }

  .notice-modal-head-actions .soft-button {
    padding: 0 10px;
  }

  .announcement-list {
    max-height: min(64vh, 520px);
    gap: 12px;
    padding: 18px 14px 20px;
  }

  .announcement-row {
    min-height: 106px;
    padding: 16px 15px 17px 18px;
  }

  .announcement-row-copy {
    min-height: 68px;
  }

  .announcement-row-side {
    justify-content: flex-end;
    width: auto;
    min-width: max-content;
  }

  .announcement-row-side time,
  .announcement-row-side i,
  .announcement-row-unread {
    flex: 0 0 auto;
  }

  .notice-modal-body {
    margin: 14px 16px 4px;
    padding: 16px;
  }

  .notice-modal-actions {
    padding: 14px 16px 16px;
  }
}

.announcement-empty p {
  margin: 0;
  font-size: 13px;
}

.pinned-message-list {
  display: grid;
  gap: 8px;
}

.pinned-message-card {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.pinned-message-card:hover {
  border-color: rgba(106, 214, 255, .28);
  background: var(--raise);
}

.pin-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(106, 214, 255, .12);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 780;
}

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

.pin-copy strong,
.pin-copy small,
.pin-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-copy strong {
  color: var(--ink);
  font-size: 12.5px;
}

.pin-copy small {
  color: var(--ink-2);
  font-size: 12px;
}

.pin-copy em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
}

.message-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 18px 22px 8px;
  background: transparent;
  overflow-x: hidden;
}

.message-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.message-recovery-feedback {
  position: absolute;
  inset: 0 12px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

.message-recovery-feedback[hidden] { display: none; }
.message-recovery-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 8px 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--layer-surface, var(--bg));
  color: var(--ink);
  overflow-wrap: anywhere;
  pointer-events: auto;
}
/* Only the explanation scrolls in short message panes; retry stays reachable
   beside it and the card never paints over the composer below the stage. */
.message-recovery-copy { min-width: 0; min-height: 0; max-height: 100%; overflow-y: auto; }
.message-recovery-card p { margin: 4px 0 0; color: var(--muted); }

.message-stage .message-scroll {
  flex: 1 1 auto;
}

.message-flow {
  max-width: none;
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.scroll-to-latest-button {
  position: absolute;
  right: 28px;
  bottom: 18px;
  z-index: 12;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line), transparent 18%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface), transparent 6%);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(5, 10, 24, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.94);
  transition:
    opacity .16s var(--ease-out),
    transform .16s var(--ease-out),
    border-color .16s var(--ease-out),
    background .16s var(--ease-out);
}

.scroll-to-latest-button[hidden] {
  display: none;
}

.scroll-to-latest-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-to-latest-button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  background: color-mix(in srgb, var(--primary), var(--surface) 74%);
  color: #fff;
}

.scroll-to-latest-button svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 720px) {
  .scroll-to-latest-button {
    right: 16px;
    bottom: 14px;
  }
}

.chat-history-state {
  align-self: center;
  width: min(460px, 92%);
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: auto 0;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel), transparent 14%);
}

.chat-history-state strong {
  color: var(--ink);
}

.chat-history-state p {
  max-width: 34em;
  color: var(--muted);
}

.chat-history-state > span {
  width: min(260px, 72%);
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary), transparent 46%), transparent);
  animation: pulse 1.2s ease-in-out infinite;
}

.history-limit-notice {
  align-self: center;
  max-width: min(620px, 92%);
  padding: 7px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 62%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 92%);
}

button.history-limit-notice {
  font: inherit;
  cursor: pointer;
}

.history-limit-notice.is-loading {
  border-color: color-mix(in srgb, var(--primary), transparent 66%);
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.history-limit-notice.is-action {
  color: color-mix(in srgb, var(--warn), var(--ink) 18%);
}

.timeline-marker,
.system-line,
.unread-boundary {
  align-self: center;
  color: var(--ink-3);
  font-size: 11px;
}

.timeline-marker {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}

.system-line span {
  background: transparent;
}

.message-row.is-jump-highlight .bubble,
.system-line.is-jump-highlight span {
  animation: messageJumpPulse 1.35s ease both;
}

@keyframes messageJumpPulse {
  0% {
    outline: 1px solid rgba(255, 198, 92, 0);
    box-shadow: 0 0 0 0 rgba(255, 198, 92, 0);
  }
  18% {
    outline: 1px solid rgba(255, 198, 92, .72);
    box-shadow: 0 0 0 5px rgba(255, 198, 92, .16), 0 12px 30px rgba(255, 198, 92, .12);
  }
  100% {
    outline: 1px solid rgba(255, 198, 92, 0);
    box-shadow: 0 0 0 0 rgba(255, 198, 92, 0);
  }
}

.unread-boundary {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px auto;
  color: var(--warn);
}

.unread-boundary::before,
.unread-boundary::after {
  content: "";
  height: 1px;
  flex: 1;
  background: color-mix(in srgb, var(--warn), transparent 64%);
}

.unread-boundary span {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 62%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 90%);
  white-space: nowrap;
}

.message-row {
  box-sizing: border-box;
  width: min(100%, 680px);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  max-width: min(74%, 680px);
  min-width: 0;
  margin: 0;
}

.message-row.is-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row > .avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  font-size: 13px;
}

.message-stack {
  flex: 0 1 auto;
  width: fit-content;
  display: grid;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
}

.message-row.is-me .message-stack {
  justify-items: end;
}

.message-meta {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
}

.message-meta > .message-sender-name {
  display: contents;
}

.message-meta > .message-sender-name > .identity-display-name-text {
  order: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta > .message-sender-role {
  display: contents;
}

.message-meta > .message-sender-role > .message-sender-role {
  order: 1;
}

.message-meta > .message-sender-name > .certification-name-slot {
  order: 2;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(112px, 30vw);
  overflow: hidden;
}

.message-meta > .message-sender-name > .certification-name-slot .verification-badge {
  max-width: 100%;
}

.message-sender-role {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(124, 140, 255, .18);
  border-radius: 999px;
  line-height: 1;
  transform: translateY(-.5px);
}

.message-sender-role svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.message-sender-role.is-owner {
  border-color: rgba(255, 213, 128, .55);
  background: linear-gradient(135deg, #ffd66f, #ff8c42);
  color: #3d2300;
  box-shadow: 0 7px 16px rgba(255, 154, 66, .24);
}

.message-sender-role.is-admin {
  width: 19px;
  height: 19px;
  min-width: 19px;
  min-height: 19px;
  border-color: rgba(106, 214, 255, .36);
  background: linear-gradient(135deg, rgba(91, 157, 255, .95), rgba(106, 214, 255, .86));
  color: #061529;
  box-shadow: 0 7px 16px rgba(91, 157, 255, .24);
}

.message-sender-role.is-admin svg {
  width: 10.5px;
  height: 10.5px;
}

.message-row.is-me .message-meta {
  justify-content: flex-end;
}

.bubble {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: none;
}

.message-row.is-me .bubble {
  border: 0;
  border-radius: 16px 16px 5px 16px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 140, 255, .32);
}

.message-mention-inline {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 1px 7px 2px;
  border: 1px solid var(--mention-user-ring);
  border-radius: 999px;
  background: var(--mention-user-bg);
  color: var(--mention-user-ink);
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.message-mention-inline.is-all {
  border-color: var(--mention-all-ring);
  background: var(--mention-all-bg);
  color: var(--mention-all-ink);
}

button.message-mention-inline {
  cursor: pointer;
}

button.message-mention-inline:hover,
button.message-mention-inline:focus-visible {
  background: var(--mention-user-hover-bg);
  outline: 2px solid color-mix(in srgb, var(--mention-user-ring), transparent 35%);
  outline-offset: 1px;
}

button.message-mention-inline.is-all:hover,
button.message-mention-inline.is-all:focus-visible {
  background: var(--mention-all-hover-bg);
  outline-color: color-mix(in srgb, var(--mention-all-ring), transparent 35%);
}

.message-row.is-me .message-mention-inline {
  --mention-user-bg: rgba(255, 255, 255, .92);
  --mention-user-ink: #2f63c7;
  --mention-user-ring: rgba(255, 255, 255, .68);
  --mention-user-hover-bg: #fff;
  --mention-all-bg: rgba(255, 246, 214, .96);
  --mention-all-ink: #9a5b00;
  --mention-all-ring: rgba(180, 112, 0, .38);
  --mention-all-hover-bg: #fff0c2;
}

.message-row.is-system-notice {
  max-width: min(74%, 760px);
}

.message-row.is-system-notice .message-avatar {
  width: 38px;
  height: 38px;
}

.message-row.is-inbox-message .message-meta strong {
  color: var(--ink);
  font-weight: 800;
}

.message-row.is-inbox-message .bubble {
  border-color: color-mix(in srgb, var(--primary), var(--line) 70%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), transparent 64%), transparent 72%),
    color-mix(in srgb, var(--surface-strong), var(--surface) 58%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary), transparent 92%);
}

.message-row.is-inbox-message .bubble p {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.65;
}

.message-row.is-failed .bubble {
  border: 1px solid rgba(255, 111, 125, .4);
  background: rgba(255, 111, 125, .12);
  color: #ffd9dd;
}

.bubble blockquote {
  margin: 0 0 8px;
  border-left: 2.5px solid var(--brand);
  border-radius: 6px;
  background: rgba(79, 140, 255, .08);
  color: var(--ink-2);
}

.message-quote {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 9px 11px 9px 12px;
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 14%);
  border-left: 3px solid color-mix(in srgb, var(--primary), var(--line) 18%);
  border-radius: 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 88%), transparent 38%),
    color-mix(in srgb, var(--surface-strong), var(--surface) 62%);
  color: var(--muted);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.message-quote:hover,
.message-quote:focus-visible {
  border-color: color-mix(in srgb, var(--primary), var(--line) 38%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 74%);
  outline: none;
}

.message-quote-author {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink), var(--muted) 22%);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-quote-author span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 650;
}

.message-quote-author b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
}

.message-quote-text {
  display: -webkit-box;
  overflow: hidden;
  color: color-mix(in srgb, var(--muted), var(--ink) 16%);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.message-row.is-me .message-quote {
  border-color: rgba(255, 255, 255, .22);
  border-left-color: rgba(255, 255, 255, .72);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .16), transparent 42%),
    rgba(255, 255, 255, .13);
  color: rgba(255, 255, 255, .78);
}

.message-row.is-me .message-quote:hover,
.message-row.is-me .message-quote:focus-visible {
  background: rgba(255, 255, 255, .2);
}

.message-row.is-me .message-quote-author {
  color: rgba(255, 255, 255, .86);
}

.message-row.is-me .message-quote-author span,
.message-row.is-me .message-quote-text {
  color: rgba(255, 255, 255, .74);
}

.message-row.is-me .message-quote-author b {
  color: rgba(255, 255, 255, .96);
}

.attachment-card {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .04);
}

.attachment-card .file-type,
.file-type {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--grad-soft);
  color: var(--brand);
}

.attachment-image-card,
.attachment-video-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.attachment-image-card.has-media {
  width: min(180px, 100%);
  aspect-ratio: var(--media-ratio, 4 / 3);
  min-height: 84px;
  display: grid;
  place-items: center;
}

.attachment-video-card {
  width: min(190px, 100%);
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  overflow: visible;
}

.attachment-image-card.is-placeholder,
.attachment-video-card.is-placeholder {
  width: min(120px, 100%);
  aspect-ratio: var(--media-ratio, 4 / 3);
  min-height: 84px;
  display: grid;
  place-items: center;
}

.attachment-image-card:hover,
.attachment-video-card:hover {
  background: transparent;
}

.attachment-image-card img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 140px;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: color-mix(in srgb, var(--surface-soft), #000 3%);
}

.attachment-video-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: var(--media-ratio, 16 / 9);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 80px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #060a12;
}

.attachment-video-thumb img,
.attachment-video-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.attachment-video-thumb > i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 10, 22, .66);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
  backdrop-filter: blur(8px);
}

.media-play-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.attachment-video-info {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 3px;
  padding: 0 2px;
  text-align: left;
}

.attachment-video-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.attachment-thumbnail-status {
  position: absolute;
  inset: 10px 10px auto auto;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 10, 22, .68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  z-index: 5;
}

.attachment-thumbnail-status.is-ready {
  background: rgba(22, 101, 52, .76);
}

.attachment-thumbnail-status.is-pending {
  background: rgba(146, 64, 14, .76);
}

.attachment-thumbnail-status.is-failed {
  background: rgba(153, 27, 27, .78);
}

.attachment-media-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #fff;
  background: rgba(9, 14, 26, .72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 6;
}

.attachment-media-progress i {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7da2ff, #7b5cff);
}

.attachment-media-progress em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.attachment-media-progress.is-failed {
  background: rgba(186, 40, 57, .82);
}

.attachment-media-placeholder {
  min-height: 82px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--brand), #fff 22%);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .13), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #000 18%), color-mix(in srgb, var(--primary-2), #000 24%));
}

.attachment-media-placeholder svg {
  width: 32px;
  height: 32px;
  color: #fff;
  opacity: .92;
}

.attachment-image-card .attachment-media-placeholder {
  width: min(120px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.attachment-image-card.is-preview-error,
.attachment-video-card.is-preview-error {
  display: block;
  width: min(140px, 70vw);
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 35%);
  background: color-mix(in srgb, var(--surface-soft), var(--danger) 8%);
}

.attachment-card.is-preview-error.is-preview-unavailable {
  border-color: var(--line);
  background: var(--surface-soft);
}

.attachment-media-error {
  display: grid;
  gap: 8px;
  padding: 12px;
  text-align: left;
}

.attachment-media-error .attachment-media-placeholder {
  min-height: 63px;
  border-radius: 12px;
}

.attachment-media-error strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.attachment-media-error small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.attachment-media-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-media-error-actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--surface), var(--brand) 8%);
  font-size: 12px;
  font-weight: 700;
}

.attachment-file-card {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  width: min(420px, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  color: #1b2336;
  background: #f8fbff;
  border-color: rgba(79, 140, 255, .22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .74),
    0 10px 24px rgba(23, 35, 60, .08);
}

.attachment-file-card .file-type {
  width: 44px;
  min-width: 44px;
  height: 44px;
  color: #4f7df0;
  background: linear-gradient(135deg, #edf4ff, #e5ebff);
}

.attachment-file-copy {
  min-width: 0;
  overflow: hidden;
}

.attachment-file-copy strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  color: #172038;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-copy small {
  display: block;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: #5f6f8f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-action {
  align-self: center;
  padding: 5px 10px;
  border: 1px solid rgba(79, 140, 255, .22);
  border-radius: 999px;
  background: #eaf2ff;
  color: #2f63c7;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.message-row.is-me .attachment-file-card {
  background: #ffffff;
  border-color: rgba(255, 255, 255, .72);
  box-shadow:
    inset 0 0 0 1px rgba(88, 126, 236, .08),
    0 12px 28px rgba(14, 30, 74, .18);
}

.message-row.is-me .attachment-file-card .file-type {
  color: #4f7df0;
  background: linear-gradient(135deg, #edf4ff, #e8ecff);
}

.message-row.is-me .attachment-file-copy strong {
  color: #172038;
}

.message-row.is-me .attachment-file-copy small {
  color: #66738f;
}

.message-row.is-me .attachment-file-action {
  border-color: rgba(79, 140, 255, .22);
  background: #eaf2ff;
  color: #2f63c7;
}

.message-row.is-me .bubble.is-attachment-bubble {
  width: fit-content;
  inline-size: fit-content;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: end;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(124, 154, 220, .34);
  background: linear-gradient(180deg, #eef4ff 0%, #e7efff 100%);
  color: #172038;
  box-shadow: 0 12px 28px rgba(59, 96, 164, .16);
}

.bubble.is-attachment-bubble {
  width: fit-content;
  inline-size: fit-content;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: start;
  display: block;
  overflow: hidden;
}

.bubble.is-attachment-bubble .attachment-card {
  width: fit-content;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: start;
  margin-top: 0;
}

.bubble.is-attachment-bubble .attachment-image-card.has-media {
  width: 130px;
  inline-size: 130px;
  aspect-ratio: var(--media-ratio, 16 / 9);
  max-width: 100%;
  max-inline-size: 100%;
  contain: inline-size;
}

.bubble.is-attachment-bubble .attachment-image-card img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  object-fit: cover;
}

.bubble.is-attachment-bubble .attachment-video-card {
  width: 168px;
  inline-size: 168px;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  contain: inline-size;
  overflow: hidden;
}

.bubble.is-attachment-bubble .attachment-video-thumb {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
}

.bubble.is-attachment-bubble .media-play-dot {
  width: 24px;
  height: 24px;
}

.bubble.is-attachment-bubble .media-play-dot svg {
  width: 13px;
  height: 13px;
}

.bubble.is-attachment-bubble .attachment-thumbnail-status {
  inset: 6px 6px auto auto;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  font-size: 10px;
}

.bubble.is-attachment-bubble .attachment-image-card .attachment-media-placeholder {
  width: 130px;
  max-width: 100%;
  min-height: 70px;
}

.bubble.is-attachment-bubble .attachment-image-card.is-placeholder {
  width: 130px;
  inline-size: 130px;
  max-width: 100%;
  max-inline-size: 100%;
}

.bubble.is-attachment-bubble .attachment-video-info strong,
.bubble.is-attachment-bubble .attachment-video-meta {
  min-width: 0;
  max-width: 100%;
}

.bubble.is-attachment-bubble .attachment-file-card {
  width: 280px;
  inline-size: 280px;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  contain: inline-size;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, auto);
}

.bubble.is-attachment-bubble .attachment-file-action {
  max-width: 86px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.message-row.is-me .bubble.is-attachment-bubble p,
.message-row.is-me .bubble.is-attachment-bubble a,
.message-row.is-me .bubble.is-attachment-bubble .attachment-video-info strong {
  color: #172038;
}

.message-row.is-me .bubble.is-attachment-bubble .attachment-video-meta {
  color: #657490;
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-card {
  color: #e8edf9;
  background: rgba(17, 24, 39, .96);
  border-color: rgba(148, 163, 184, .24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .03),
    0 12px 28px rgba(0, 0, 0, .22);
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-card .file-type {
  color: #9cc9ff;
  background: rgba(91, 157, 255, .18);
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-copy strong {
  color: #f8fafc;
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-copy small {
  color: #b8c4dc;
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-action {
  border-color: rgba(91, 157, 255, .25);
  background: rgba(91, 157, 255, .18);
  color: #d9e8ff;
}

body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble {
  border-color: rgba(124, 154, 220, .24);
  background: linear-gradient(180deg, rgba(17, 24, 39, .95) 0%, rgba(10, 15, 28, .97) 100%);
  color: #e8edf9;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-card {
  color: #e8edf9;
  background: rgba(15, 23, 42, .94);
  border-color: rgba(148, 163, 184, .24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .035),
    0 12px 28px rgba(0, 0, 0, .22);
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-card .file-type {
  color: #9cc9ff;
  background: linear-gradient(135deg, rgba(91, 157, 255, .20), rgba(139, 123, 255, .18));
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-copy strong,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble p,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble a,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble .attachment-video-info strong {
  color: #f8fafc;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-copy small,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble .attachment-video-meta {
  color: #b8c4dc;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-action {
  border-color: rgba(91, 157, 255, .28);
  background: rgba(91, 157, 255, .18);
  color: #d9e8ff;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-image-card img,
body:not([data-theme="aurora"]) .message-row.is-me .attachment-video-thumb {
  border-color: rgba(148, 163, 184, .22);
  background: #060a12;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-media-placeholder {
  color: #9cc9ff;
  background:
    radial-gradient(circle at 50% 42%, rgba(148, 163, 184, .14), transparent 38%),
    linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(30, 41, 59, .96));
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-image-card .attachment-media-placeholder {
  border-color: rgba(148, 163, 184, .22);
}

.bubble.is-sticker-bubble,
.message-row.is-me .bubble.is-sticker-bubble {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.bubble.is-sticker-bubble .message-quote {
  max-width: min(240px, 100%);
  margin-bottom: 8px;
}

.message-row.is-failed .bubble.is-sticker-bubble {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.message-row.is-failed .bubble.is-sticker-bubble .sticker-message-stage {
  outline: 1px solid rgba(255, 111, 125, .45);
  outline-offset: 2px;
}

.message-quote-body,
.reply-copy.has-thumb {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.message-quote-thumb,
.reply-thumb {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.message-quote-thumb img,
.reply-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-message {
  width: min(var(--sticker-w, 160px), 228px, 54vw);
  max-width: 100%;
  display: grid;
  gap: 6px;
}

.sticker-message-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--sticker-ratio, 1);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
}

.sticker-media-static,
.sticker-media-animated {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.sticker-message.has-animated .sticker-media-static {
  display: none;
}

.sticker-play-button {
  display: none;
}

.sticker-message-fallback {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

:is([data-reduced-chat-motion], [data-workspace-idle]) .message-row,
:is([data-reduced-chat-motion], [data-workspace-idle]) .emoji-popover,
:is([data-reduced-chat-motion], [data-workspace-idle]) .emoji-panel-body {
  animation: none;
}

:is([data-reduced-chat-motion], [data-workspace-idle]) .sticker-message.has-animated .sticker-media-static {
  display: block;
}

:is([data-reduced-chat-motion], [data-workspace-idle]) .sticker-message.has-animated .sticker-media-animated {
  display: none;
}

[data-reduced-chat-motion]:not([data-workspace-idle]) .sticker-message.has-animated.is-playing .sticker-media-static {
  display: none;
}

[data-reduced-chat-motion]:not([data-workspace-idle]) .sticker-message.has-animated.is-playing .sticker-media-animated {
  display: block;
}

:is([data-reduced-chat-motion], [data-workspace-idle]) .sticker-message.has-animated .sticker-play-button {
  position: absolute;
  inset: auto 8px 8px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

[data-reduced-chat-motion]:not([data-workspace-idle]) .sticker-message.has-animated.is-playing .sticker-play-button {
  display: none;
}

@media (max-width: 820px) {
  .sticker-message {
    width: min(var(--sticker-w, 148px), 188px, 58vw);
  }
}

/* GIF attachments share sticker bubble decoration without changing message semantics. */
body .message-row .bubble.is-attachment-bubble:has(.attachment-image-card > img[data-gif-src]),
.message-row.is-sticker-message .bubble.is-sticker-bubble,
body:not([data-theme="aurora"]) .message-row.is-sticker-message .bubble.is-sticker-bubble,
body:not([data-theme="aurora"]) .message-row.is-me.is-sticker-message .bubble.is-sticker-bubble,
body[data-theme="aurora"] .message-row.is-sticker-message .bubble.is-sticker-bubble,
body[data-theme="aurora"] .message-row.is-me.is-sticker-message .bubble.is-sticker-bubble {
  width: fit-content;
  inline-size: fit-content;
  max-width: min(228px, 54vw);
  max-inline-size: min(228px, 54vw);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  overflow: visible;
}

.message-row.is-sticker-message .sticker-message-stage {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.message-row.is-sticker-message .sticker-media-static,
.message-row.is-sticker-message .sticker-media-animated {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Preserve the original GIF pixels and transparent regions inside its existing size. */
body .message-row .bubble.is-attachment-bubble .attachment-image-card:has(> img[data-gif-src]),
body .message-row .bubble.is-attachment-bubble .attachment-image-card > img[data-gif-src] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .message-row .bubble.is-attachment-bubble .attachment-image-card > img[data-gif-src] {
  object-fit: contain;
}

.message-foot {
  min-height: 22px;
  gap: 7px;
  margin: 0 4px;
  color: var(--ink-3);
  font-size: 11px;
}

.message-row.is-me .message-foot {
  justify-content: flex-end;
}

.message-state {
  padding: 0;
  background: transparent;
  color: var(--ink-3);
}

.message-state[data-state="failed"] {
  color: var(--bad);
  background: transparent;
}

.message-actions button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
}

.composer-panel {
  flex: 0 0 auto;
  margin: 8px 18px 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
  box-shadow: var(--sh-sm);
}

.composer-shell {
  max-width: none;
  gap: 0;
}

.reply-bar {
  margin: 9px 12px 0;
  border-color: var(--line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 82%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--surface-strong), var(--surface) 54%);
}

.reply-copy {
  min-height: 34px;
  display: grid;
  gap: 2px;
  padding-left: 9px;
}

.reply-copy b {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-copy em {
  max-width: 100%;
  color: var(--muted);
  line-height: 1.35;
}

.reply-clear-button {
  min-width: 54px;
  height: 30px;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 72%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 54%);
  color: var(--primary);
  font-weight: 760;
}

.reply-clear-button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 45%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 30%);
  color: var(--primary);
}

.composer-panel.is-editing {
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--primary), transparent 86%);
}

.composer-edit-bar {
  min-height: 48px;
  margin: 9px 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 70%);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 78%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--surface-strong), var(--surface) 48%);
}

.composer-edit-mark {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  flex: 0 0 30px;
  height: 30px;
  max-height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 22%);
  color: var(--primary);
}

.composer-edit-mark svg {
  width: 16px !important;
  min-width: 16px;
  max-width: 16px;
  height: 16px !important;
  min-height: 16px;
  max-height: 16px;
  display: block;
  flex: 0 0 16px;
}

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

.composer-edit-copy b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.composer-edit-copy em {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-edit-cancel {
  width: auto;
  min-width: 54px;
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 720;
}

.composer-edit-cancel:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
  color: var(--primary);
}

.composer-edit-bar svg,
.message-action-popover svg {
  width: 16px !important;
  max-width: 16px;
  height: 16px !important;
  max-height: 16px;
  display: block;
  flex: 0 0 16px;
}

.composer-input {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0;
  cursor: text;
}

.composer-input textarea {
  min-height: 32px;
  max-height: 110px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.composer-input textarea::placeholder {
  color: var(--ink-3);
}

.composer-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.composer-toolbar {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 13px 14px 8px;
}

.composer-tool {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
}

.composer-tool:hover {
  color: var(--ink);
  background: var(--raise);
}

.composer-tool svg {
  width: 18px;
  height: 18px;
}

.composer-tool.is-pending::after {
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  background: var(--warn);
}

.send-button { flex: 0 0 auto; height: 40px; min-height: 40px; min-width: 78px; padding: 0 20px; border-radius: 12px; font-size: 14px; font-weight: 640; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1; white-space: nowrap; transform: none; transition: box-shadow .16s var(--ease-out), filter .16s var(--ease-out), opacity .16s var(--ease-out); }

.send-button:hover,
.send-button:focus-visible { background: var(--grad); color: #fff; transform: none; filter: brightness(1.04); box-shadow: 0 10px 24px rgba(79, 140, 255, .38); }

.send-button:active { opacity: .92; transform: none; filter: brightness(.98); }

.send-button svg { width: 16px; height: 16px; display: block; flex: 0 0 16px; }

.composer-hint {
  padding: 0 14px 11px;
  color: var(--ink-3);
  font-size: 11px;
}

.context-scrim {
  display: none;
}

.context-panel {
  position: static;
  z-index: auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: rgba(10, 14, 23, .42);
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
}

.im-shell:not(.is-detail-open) .context-panel {
  display: none;
}

.context-head {
  min-height: 60px;
  padding: 18px 18px 10px;
  border-bottom: 0;
}

.context-head h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 660;
}

.context-head p {
  color: var(--ink-2);
}

.context-tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.context-tabs button {
  flex: 1;
  min-height: 30px;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
}

.context-tabs button.is-active {
  color: #fff;
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .3);
}

.context-panel.context-tab-overview.context-kind-group .context-tabs,
.context-panel.context-tab-overview.context-kind-single .context-tabs {
  display: none;
}

.context-panel.context-kind-rtc .context-tabs {
  display: none;
}

.context-panel.context-kind-rtc .context-body {
  background: var(--surface);
}

.rtc-detail-context {
  min-height: 100%;
  align-content: start;
}

.rtc-detail-context .rtc-detail-profile-card {
  overflow: visible;
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background:
    radial-gradient(220px 150px at 50% 0%, color-mix(in srgb, var(--primary), transparent 84%), transparent 70%),
    color-mix(in srgb, var(--surface-soft), var(--surface) 44%);
  box-shadow: none;
}

.rtc-detail-context .rtc-detail-profile-card .avatar {
  margin-top: 0;
}

.rtc-detail-context .info-list {
  grid-template-columns: 1fr;
}

.rtc-detail-context .info-list > span {
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 36%);
}

.rtc-detail-actions {
  margin-top: auto;
}

.rtc-detail-actions .primary-button,
.rtc-detail-actions .rtc-detail-dial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  max-height: 44px;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary), transparent 74%);
}

.rtc-detail-actions .primary-button svg,
.rtc-detail-actions .rtc-detail-dial-button svg {
  display: block;
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
}

.im-shell[data-view="rtc"].is-detail-open .context-scrim {
  display: none;
}

.context-body {
  flex: 1;
  min-height: 0;
  padding: 18px;
}

.context-section {
  gap: 18px;
}

.profile-large,
.context-section > .profile-large.compact {
  justify-items: center;
  grid-template-columns: 1fr;
  text-align: center;
  padding: 6px 0 0;
}

.context-section .profile-large .avatar,
.profile-large .avatar-xl {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  font-size: 26px;
}

.profile-large h3,
.profile-large h2 {
  color: var(--ink);
  font-size: 17px;
}

.group-profile-hero .detail-title-row h2,
.group-profile-hero .detail-title-row h2 > span,
.group-detail-hero .detail-title-row h3,
.group-detail-hero .detail-title-row h3 > span {
  max-width: min(100%, 560px);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.group-profile-hero .detail-title-row h2,
.group-detail-hero .detail-title-row h3 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-large p {
  color: var(--ink-2);
  font-size: 12.5px;
}

.notice-box,
.ctx-card,
.info-list > span,
.info-grid > span,
.panel,
.feature-panel,
.file-focus,
.rtc-stage,
.empty-state,
.error-state {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .02);
}

.notice-box {
  background: var(--grad-soft);
}

body[data-theme="midnight"] .group-members-panel {
  border-color: var(--line);
  background: rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .group-member-row {
  border-color: rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .group-member-row:hover {
  border-color: rgba(96, 165, 250, .32);
  background: rgba(96, 165, 250, .08);
}

body[data-theme="midnight"] .group-members-head button {
  background: rgba(96, 165, 250, .12);
  color: #93c5fd;
}

.notice-box strong,
.panel-head h3,
.info-list strong,
.info-grid strong {
  color: var(--ink);
}

.notice-box p,
.info-list small,
.info-grid small,
.panel-head span,
.muted {
  color: var(--ink-2);
}

.member-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.member-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.member-filter-field {
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 8%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: var(--ink-2);
  box-sizing: border-box;
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out);
}

.member-filter-field:focus-within {
  border-color: rgba(91, 157, 255, .78);
  background: rgba(91, 157, 255, .08);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, .16);
}

.member-filter-field svg {
  width: 15px;
  height: 15px;
  color: var(--ink-2);
}

.member-filter-field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  caret-color: var(--primary);
}

.member-filter-field input::placeholder {
  color: color-mix(in srgb, var(--ink-2), transparent 14%);
}

.member-filter-clear {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
}

.member-filter-count {
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}

.member-filter-scope {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.member-filter-empty {
  display: grid;
  gap: 5px;
  padding: 18px 14px;
  border: 1px dashed color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 13px;
  color: var(--ink-2);
  text-align: center;
}

.member-filter-empty strong {
  color: var(--ink);
}

.reaction-unread-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, #facc15, transparent 50%);
  border-radius: 7px;
  background: color-mix(in srgb, #facc15, transparent 86%);
  color: color-mix(in srgb, #facc15, var(--ink) 24%);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  line-height: 17px;
  white-space: nowrap;
  letter-spacing: 0;
}

.reaction-unread-badge.is-muted {
  border-color: color-mix(in srgb, #d8b84a, transparent 60%);
  background: color-mix(in srgb, #d8b84a, transparent 91%);
  color: color-mix(in srgb, #d8b84a, var(--ink-2) 35%);
}

.member-card {
  min-height: 86px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
}

.member-card:hover {
  border-color: var(--line);
  background: var(--raise);
}

.switch {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, .1);
}

.switch::before {
  width: 18px;
  height: 18px;
  margin: 2px;
}

.switch.is-on {
  background: var(--grad);
}

.switch.is-on::before {
  margin-left: 18px;
}

.switch.is-pending {
  cursor: progress;
  opacity: .72;
}

.switch.is-pending::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(255, 255, 255, .72);
  border-top-color: transparent;
  border-radius: 999px;
  animation: switch-spin .8s linear infinite;
}

.switch-loading-text {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

@keyframes switch-spin {
  to { transform: rotate(360deg); }
}

.locked-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: color-mix(in srgb, var(--ok), var(--ink) 22%);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.locked-toggle em {
  font-style: normal;
}

.locked-toggle .switch {
  display: block;
}

.switch.is-readonly {
  cursor: default;
  opacity: .88;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok), transparent 58%);
}

.switch-row.is-policy > span {
  color: var(--ink);
}

.context-kind-single .context-tabs,
.context-kind-system .context-tabs {
  grid-auto-flow: initial;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.context-kind-system .context-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.context-profile-card,
.context-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.context-profile-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 14px;
  overflow: hidden;
  text-align: center;
}

.context-profile-card .profile-cover {
  position: absolute;
  inset: 0 0 auto;
  height: 96px;
  background:
    radial-gradient(140px 90px at 18% 24%, rgba(255, 255, 255, .24), transparent 62%),
    radial-gradient(160px 130px at 86% 78%, rgba(124, 107, 255, .58), transparent 62%),
    linear-gradient(135deg, rgba(79, 140, 255, .95), rgba(124, 107, 255, .92));
  opacity: .95;
}

.context-profile-card .profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(118deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 24px);
}

.context-profile-card .avatar {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  margin-top: 28px;
  border-radius: 22px;
  font-size: 26px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

.context-profile-card.group-profile .avatar,
.context-profile-card.system-profile .avatar {
  margin-top: 0;
  background: var(--grad);
}

.context-profile-card h3,
.context-card h3 {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 16px;
  font-weight: 680;
}

.context-profile-card p,
.context-card p {
  position: relative;
  z-index: 1;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.context-badges,
.context-action-grid {
  position: relative;
  z-index: 1;
}

.context-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.context-badges .chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-action-grid {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 8px;
}

.context-action-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.context-action-grid button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
}

.context-action-grid svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.context-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.context-card.accent-card {
  background: var(--grad-soft);
  border-color: rgba(124, 140, 255, .24);
}

.context-card.compact-card {
  padding: 12px 14px;
}

.safety-card {
  gap: 14px;
}

.safety-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.safety-card-head h3 {
  margin: 0;
}

.safety-card-head span {
  color: var(--ink-3);
  font-size: 12px;
}

.safety-action-grid {
  display: grid;
  gap: 10px;
}

.safety-action-button {
  width: 100%;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line), var(--surface) 18%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 16%);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  transition: transform .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out);
}

.safety-action-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), var(--line) 48%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 58%);
}

.safety-action-title {
  color: inherit;
  font-size: 14px;
  font-weight: 760;
}

.safety-action-note {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.35;
}

.safety-action-button.is-danger {
  border-color: color-mix(in srgb, var(--danger), var(--line) 70%);
  background: color-mix(in srgb, var(--danger), var(--surface) 94%);
  color: var(--danger);
}

.safety-action-button.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), var(--line) 34%);
  background: color-mix(in srgb, var(--danger), var(--surface) 88%);
}

.safety-action-button.is-warning {
  border-color: color-mix(in srgb, var(--warn), var(--line) 70%);
  background: color-mix(in srgb, var(--warn), var(--surface) 94%);
  color: var(--warn);
}

.safety-action-button.is-warning:hover {
  border-color: color-mix(in srgb, var(--warn), var(--line) 34%);
  background: color-mix(in srgb, var(--warn), var(--surface) 88%);
}

.safety-action-button.is-danger .safety-action-note,
.safety-action-button.is-warning .safety-action-note {
  color: color-mix(in srgb, currentColor, var(--ink-3) 46%);
}

.context-section-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.context-section-head h3,
.context-section-head span {
  min-width: 0;
}

.context-section-head span {
  color: var(--ink-3);
  font-size: 12px;
}

.context-section-head button {
  flex: none;
  color: var(--primary);
  font-size: 12px;
}

.context-kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.context-kv:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.context-kv span {
  color: var(--ink-3);
}

.context-kv strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 620;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-file-list,
.context-member-strip {
  display: grid;
  gap: 9px;
}

.context-file-mini {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  color: var(--ink);
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.context-file-mini:hover {
  border-color: rgba(124, 140, 255, .3);
  background: var(--raise);
  transform: translateY(-1px);
}

.context-file-mini .file-type,
.context-file-mini .avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.context-file-mini .file-type {
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  overflow: hidden;
  color: var(--primary);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.context-file-mini > span:last-child {
  min-width: 0;
  overflow: hidden;
}

.context-file-mini strong,
.context-file-mini small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-file-mini strong {
  font-size: 12.5px;
}

.context-file-mini small {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.context-member-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.context-member-pill {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--ink);
  transition: background .16s ease;
}

.context-member-pill:hover {
  background: var(--raise);
}

.context-member-pill .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 13px;
}

.context-member-pill strong,
.context-member-pill small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-member-pill strong {
  font-size: 11.5px;
}

.context-member-pill small {
  color: var(--ink-3);
  font-size: 10.5px;
}

.context-kind-single .tag-row {
  justify-content: center;
}

.page-workspace {
  background: transparent;
}

.page-scroll {
  flex: 1;
  min-height: 0;
  padding: 22px 24px;
}

.content-grid,
.content-grid.three {
  grid-template-columns: minmax(0, 1fr);
}

.file-focus {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
}

.preview-canvas {
  min-height: 360px;
  border-color: rgba(124, 140, 255, .22);
  border-radius: 16px;
  background: var(--grad-soft);
}

.preview-canvas span,
.modal-preview span,
.preview-mini span {
  border-radius: 14px;
  background: var(--grad);
}

.file-focus-foot {
  color: var(--ink);
}

.theme-cards button,
.set-item {
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
}

.theme-cards button.is-active,
.set-item.on,
.theme-cards button:hover {
  background: var(--grad-soft);
  color: #fff;
  border-color: rgba(124, 140, 255, .28);
}

.video-grid {
  min-height: 520px;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.video-grid div {
  border-color: var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(40, 50, 80, .5), rgba(20, 26, 44, .7));
}

.video-grid span {
  border-radius: 30px;
  background: var(--grad);
}

.call-controls {
  justify-content: center;
  padding-top: 14px;
}

.modal-card,
.drawer-card,
.menu-popover,
.emoji-popover,
.toast {
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(13, 17, 28, .99));
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.modal-card header,
.drawer-card header,
.modal-card footer {
  border-color: var(--line);
}

.tool-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, .03);
}

.toast {
  border-left-color: var(--ok);
}

.emoji-popover {
  bottom: 136px;
  padding: 12px;
  border-radius: 18px;
}

.emoji-head {
  align-items: center;
  margin-bottom: 10px;
}

.emoji-head span {
  flex: 1;
}

.emoji-close {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  color: var(--ink-3);
  font-weight: 800;
}

.emoji-close:hover {
  color: var(--ink);
  background: var(--raise);
}

.mention-popover {
  position: fixed;
  z-index: 62;
  left: calc(var(--rail-w) + var(--side-w) + 28px);
  bottom: 150px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(360px, calc(100vh - 180px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(13, 17, 28, .99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  animation: pop-in .14s var(--ease-out);
}

.mention-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.mention-head strong {
  color: var(--ink);
}

.mention-head span,
.mention-empty {
  color: var(--ink-3);
  font-size: 12px;
}

.mention-list {
  display: grid;
  gap: 4px;
  padding: 8px;
  overflow: auto;
}

.mention-item {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.mention-item:hover {
  border-color: var(--line);
  background: var(--raise);
}

.mention-item.is-all {
  border-color: rgba(255, 205, 86, .28);
  background: rgba(255, 205, 86, .08);
}

.mention-item.is-all:hover {
  border-color: rgba(255, 205, 86, .46);
  background: rgba(255, 205, 86, .13);
}

.mention-all-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 205, 86, .18);
  color: #ffd166;
  font-weight: 850;
}

.mention-item .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 13px;
}

.mention-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.mention-empty {
  padding: 18px 12px;
  text-align: center;
}

.member-popover {
  position: absolute;
  z-index: 18;
  left: 0;
  top: 0;
  width: 244px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(13, 17, 28, .99));
  box-shadow: 0 22px 50px rgba(0, 0, 0, .48);
  animation: pop-in .14s var(--ease-out);
}

.member-popover-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.member-popover-head .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.member-popover-head strong,
.member-popover-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-popover-head small {
  color: var(--ink-3);
  font-size: 12px;
}

.member-popover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.member-popover-actions button {
  min-height: 32px;
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
}

.member-profile-modal {
  width: min(420px, calc(100vw - 32px));
}

.member-profile-management { padding: 12px 18px; border-top: 1px solid var(--line); min-width: 0; }
.member-profile-management-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.member-profile-management-actions button,
.member-profile-confirm-actions button { min-width: 0; min-height: 40px; padding: 8px; white-space: normal; overflow-wrap: anywhere; }
.member-profile-removal-confirm,
.member-profile-mute-confirm { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); }
.member-profile-removal-confirm p,
.member-profile-mute-confirm p { margin: 0 0 10px; overflow-wrap: anywhere; }
.member-profile-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.member-profile-confirm-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.member-profile-confirm-actions button > span[aria-hidden] { display: inline-flex; flex: 0 0 auto; }
.member-profile-confirm-actions .member-profile-danger-button { border-color: var(--danger); background: var(--danger); color: #fff; }
.member-profile-confirm-actions .member-profile-danger-button:hover:not(:disabled) { background: color-mix(in srgb, var(--danger), #000 10%); }
.member-profile-mute-error { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--danger); }
.member-profile-mute-error > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.member-profile-mute-error > button { flex: 0 0 auto; min-height: 36px; }
@media (max-width: 420px) {
  .member-profile-management { padding-inline: 12px; }
  .member-profile-management-actions { gap: 6px; }
  .member-profile-management-actions button { padding-inline: 4px; font-size: 12px; }
  .member-profile-confirm-actions button { gap: 4px; padding-inline: 6px; }
}

.member-profile-hero {
  padding: 18px 18px 6px;
}

.user-profile-avatar-preview {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.user-profile-avatar-preview:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 34%);
  outline-offset: 3px;
}

.member-info-list {
  padding: 12px 18px 18px;
}

.composer-panel {
  margin: 8px 18px 14px;
}

.composer-footer {
  padding: 8px 12px 7px;
}

.composer-input-row {
  align-items: flex-end;
  gap: 14px;
  padding: 10px 14px 8px;
}

.composer-input {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
}

.composer-input textarea {
  height: auto;
  min-height: 40px;
  max-height: calc(1.55em * 4 + 14px);
  padding: 7px 0;
  line-height: 1.55;
  resize: none;
  overflow-y: hidden;
  outline: none;
  box-shadow: none;
  transition: height 0.12s var(--ease-out);
}

.composer-input textarea:focus {
  outline: none;
  box-shadow: none;
}

.composer-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 12px;
}

.composer-hint > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-limit {
  flex: 0 0 auto;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.16s var(--ease-out);
}

.composer-limit b {
  font-weight: 700;
}

.composer-limit.is-warn {
  color: var(--warn);
}

.composer-limit.is-limit {
  color: var(--bad);
}

.app-rail {
  background: rgba(7, 10, 18, .78);
}

.rail-item {
  color: var(--ink-3);
}

.rail-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
}

.rail-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .14));
  border-color: rgba(124, 140, 255, .35);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .12);
}

.rail-badge {
  background: var(--bad);
  border-color: var(--bg-soft);
  box-shadow: 0 3px 10px rgba(255, 111, 125, .28);
}

.message-row {
  white-space: normal;
  position: relative;
}

.message-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.message-avatar:hover {
  transform: none;
  box-shadow: 0 10px 22px rgba(124, 107, 255, .24);
}

.message-foot {
  width: fit-content;
  position: static;
}

.message-row.is-me .message-foot {
  justify-self: end;
  justify-items: end;
  text-align: right;
}

.message-row.is-me .message-state {
  color: var(--ok);
}

.message-row.is-me button.message-state {
  text-decoration: underline dotted rgba(55, 224, 166, .5);
  text-underline-offset: 3px;
}

.message-row.is-me button.message-state::before {
  content: "✓";
  margin-right: 4px;
  color: var(--ok);
  letter-spacing: 0;
}

.message-actions {
  position: static;
  z-index: auto;
  width: auto;
  border-radius: 12px;
  background: rgba(14, 19, 32, .72);
  backdrop-filter: blur(12px);
}

.message-row.is-me .message-actions {
  justify-content: flex-end;
}

.message-actions button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--ink-2);
}

.message-actions button:hover {
  color: var(--ink);
  background: var(--raise);
}

.message-actions .danger-button,
.message-row.is-failed .message-actions .danger-button {
  color: var(--bad);
  border-color: rgba(255, 111, 125, .32);
  background: rgba(255, 111, 125, .08);
}

.message-click-target {
  cursor: pointer;
  transition:
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    transform .16s var(--ease-out);
}

.message-click-target:hover {
  border-color: rgba(124, 140, 255, .32);
  box-shadow: 0 0 0 1px rgba(124, 140, 255, .10);
}

.message-bubble-line{position:relative;display:block;width:fit-content;max-width:100%;min-width:0}

.message-bubble-line > .bubble{min-width:0;max-width:100%}

.message-row.is-me .message-bubble-line,
.message-row.is-outgoing .message-bubble-line{justify-self:end}

.message-hover-time{position:absolute;z-index:4;top:50%;display:inline-flex;align-items:center;max-width:min(112px,32vw);min-height:24px;padding:0 8px;overflow:hidden;border:1px solid rgba(148,163,184,.24);border-radius:999px;background:rgba(15,23,42,.76);color:rgba(226,232,240,.92);font-size:11px;font-variant-numeric:tabular-nums;line-height:1;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-50%);transition:opacity .14s var(--ease-out),visibility .14s var(--ease-out);box-shadow:0 8px 20px rgba(15,23,42,.16);backdrop-filter:blur(10px)}

.message-row:not(.is-me):not(.is-outgoing) .message-hover-time{left:calc(100% + 8px)}

.message-row.is-me .message-hover-time,
.message-row.is-outgoing .message-hover-time{right:calc(100% + 8px)}

.message-row:hover .message-hover-time,
.message-row:focus-within .message-hover-time{opacity:1;visibility:visible}

body[data-theme="aurora"] .message-hover-time {
  border-color: rgba(127, 151, 191, .22);
  background: rgba(255, 255, 255, .86);
  color: #53627f;
  box-shadow: 0 8px 20px rgba(80, 103, 150, .14);
}

.message-row.is-readonly-notice .bubble,
.message-row.is-readonly-notice .message-avatar {
  cursor: default;
}

.message-row.is-readonly-notice .bubble:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 70%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary), transparent 92%);
  transform: none;
}

.message-row.is-menu-open {
  z-index: 90;
}

.message-row.is-member-menu-open {
  z-index: 95;
}

.message-row.is-menu-open .message-stack {
  z-index: 91;
}

.message-row.is-menu-open .message-click-target {
  border-color: rgba(124, 140, 255, .52);
  box-shadow: 0 0 0 2px rgba(91, 157, 255, .18), 0 16px 42px rgba(0, 0, 0, .22);
}

.message-action-popover {
  position: absolute;
  z-index: 120;
  top: 0;
  left: 0;
  width: min(260px, calc(100vw - 48px));
  max-height: min(360px, calc(100vh - 220px));
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(14, 18, 30, .99));
  color: var(--ink);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .52);
  backdrop-filter: blur(16px);
  animation: message-menu-in .14s var(--ease-out);
}

.message-action-popover[data-placement="above"] {
  animation-name: message-menu-up;
}

.message-interaction-overlay-host {
  position: fixed;
  z-index: 220;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  contain: layout style;
}

.message-interaction-overlay-host:empty,
.message-interaction-overlay-host[data-anchor-visible="false"] {
  visibility: hidden;
}

.message-interaction-overlay-host > .message-action-popover,
.message-interaction-overlay-host > .member-popover {
  position: absolute;
  right: auto;
  bottom: auto;
  margin: 0;
  pointer-events: auto;
  animation: message-overlay-fade .12s var(--ease-out);
}

.message-interaction-overlay-host > .member-popover {
  z-index: 130;
}

@keyframes message-overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.message-reaction-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px 5px;
  border-bottom: 1px solid var(--line);
}

.message-reaction-row button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 18px;
  transition: background .14s var(--ease-out), transform .14s var(--ease-out);
}

.message-reaction-row button:hover {
  background: var(--raise);
  transform: translateY(-1px) scale(1.06);
}

.message-reaction-row .reaction-more {
  margin-left: auto;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--font);
}

.message-reaction-row .reaction-more svg {
  width: 15px;
  height: 15px;
}

.message-stack > .reaction-strip {
  box-sizing: border-box;
  width: fit-content;
  inline-size: fit-content;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: start;
  align-self: start;
  justify-content: flex-start;
}

.message-row:not(.is-me) .message-stack > .reaction-strip {
  justify-self: start;
  justify-content: flex-start;
}

.message-row.is-me .message-stack > .reaction-strip {
  justify-self: end;
  justify-content: flex-end;
}

.message-stack>.reaction-strip{gap:6px;margin-top:5px;padding:0 2px;align-items:center}
.message-row:not(.is-me) .message-stack>.reaction-strip{margin-left:2px}
.message-row.is-me .message-stack>.reaction-strip{margin-right:2px}
.reaction-strip button{height:22px;min-height:22px;gap:3px;padding:0 7px 0 6px;border:1px solid color-mix(in srgb,var(--primary),var(--line) 80%);background:color-mix(in srgb,var(--surface),var(--primary-soft) 38%);color:color-mix(in srgb,var(--ink),var(--primary) 22%);line-height:1;justify-content:center}
.reaction-strip button span{display:inline-flex;align-items:center;justify-content:center;width:15px;height:16px;font-size:14px;line-height:16px;transform:none}
.reaction-strip button strong{display:inline-flex;align-items:center;justify-content:center;min-width:7px;height:16px;font:750 12px/16px var(--font);color:color-mix(in srgb,var(--muted),var(--primary) 36%);font-variant-numeric:tabular-nums}
.reaction-strip button:hover,.reaction-strip button:focus-visible{border-color:color-mix(in srgb,var(--primary),var(--line) 32%);background:color-mix(in srgb,var(--surface),var(--primary-soft) 68%);transform:translateY(-1px)}
.reaction-strip button.is-mine{color:var(--primary);border-color:color-mix(in srgb,var(--primary),transparent 34%);background:linear-gradient(135deg,color-mix(in srgb,var(--primary),transparent 84%),color-mix(in srgb,var(--secondary),transparent 88%))}
.reaction-strip button.is-mine strong{color:color-mix(in srgb,var(--primary),var(--ink) 10%)}

.message-action-list,
.message-action-danger {
  display: grid;
  gap: 1px;
}

.message-action-list button,
.message-action-danger button {
  min-height: 32px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
}

.message-action-list button:hover,
.message-action-danger button:hover {
  background: var(--raise);
}

.message-action-list svg,
.message-action-danger svg {
  width: 15px;
  height: 15px;
  color: var(--ink-2);
}

.message-action-list span,
.message-action-danger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-action-list em {
  color: var(--ink-3);
  font-size: 12px;
  font-style: normal;
}

.message-action-danger em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.message-action-danger {
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.message-action-danger button {
  color: var(--bad);
}

.message-action-danger button.message-report-action {
  order: 99;
}

.message-action-danger svg {
  color: var(--bad);
}

.message-action-danger button.is-disabled {
  color: var(--ink-3);
}

.message-action-danger button.is-disabled svg {
  color: var(--ink-3);
}

.message-action-danger button.is-disabled:hover {
  background: var(--surface-soft);
}

@keyframes message-menu-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes message-menu-up {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.read-modal.seen-modal {
  width: min(360px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 40px));
  grid-template-rows: auto auto minmax(0, 1fr);
  border-radius: 18px;
}

.seen-modal .seen-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px 12px;
}

.seen-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.seen-ok {
  color: var(--ok);
  letter-spacing: 0;
}

.mini-bubble {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.seen-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.seen-tabs button {
  flex: none;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
}

.seen-tabs button.is-active,
.seen-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--grad-soft);
}

.seen-list.seen-body {
  gap: 0;
  padding: 6px;
}

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

.seen-glabel {
  padding: 8px 10px 4px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.seen-modal .seen-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
}

.seen-modal .seen-row:hover {
  background: var(--raise);
}

.seen-modal .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 13px;
}

.seen-avatar-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.seen-avatar-button:hover,
.seen-avatar-button:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary), transparent 86%),
    0 8px 18px rgba(124, 107, 255, .16);
  transform: none;
}

.seen-person {
  flex: 1;
  min-width: 0;
}

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

.seen-result {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.seen-result i {
  color: var(--ok);
  font-style: normal;
  letter-spacing: 0;
}

.react-tag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 16px;
}

.seen-row.is-unread {
  opacity: .72;
}

.seen-reactions-body {
  border-top: 1px solid var(--line);
}

.seen-reaction-row .seen-result {
  gap: 7px;
}

.seen-reaction-row .seen-result time {
  color: var(--ink-3);
  font-size: 11px;
}

.seen-reaction-row.is-removed {
  opacity: .62;
}

.seen-empty,
.seen-reactions-empty {
  margin: 6px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-soft), transparent 28%);
}

.seen-empty strong,
.seen-reactions-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
}

.seen-empty p,
.seen-reactions-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.panel-search.is-simple {
  padding-bottom: 6px;
}

.panel-search.is-simple .search-field {
  margin-bottom: 2px;
}

.file-category-list {
  display: grid;
  gap: 8px;
  padding: 0 8px 14px;
}

.file-category-row {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  transition:
    border-color .16s var(--ease-out),
    background .16s var(--ease-out),
    color .16s var(--ease-out),
    transform .16s var(--ease-out);
}

.file-category-row:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .035);
  transform: translateY(-1px);
}

.file-category-row.is-active {
  color: var(--ink);
  border-color: rgba(124, 140, 255, .34);
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .12);
}

.file-category-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.file-category-row.is-active .file-category-icon {
  color: var(--primary);
}

.file-category-icon svg {
  width: 17px;
  height: 17px;
}

.file-category-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-category-row small {
  color: var(--ink-3);
  font-size: 11.5px;
}

.context-overview {
  gap: 16px;
}

.detail-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 6px 0 16px;
  text-align: center;
}

.detail-avatar {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  font-size: 26px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

.group-detail-hero .detail-avatar,
.single-detail-hero .detail-avatar {
  background: linear-gradient(135deg, #4f8cff, #62d2ff);
}

.single-detail-hero .detail-avatar {
  background: linear-gradient(135deg, #8f57ff, #58c7ff);
}

.single-detail-hero {
  position: relative;
  padding: 8px 0 16px;
}

.single-detail-hero .detail-cover {
  width: 100%;
  height: 108px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(140px 90px at 20% 28%, rgba(255, 255, 255, .28), transparent 62%),
    radial-gradient(180px 140px at 86% 84%, rgba(124, 107, 255, .58), transparent 60%),
    radial-gradient(160px 120px at 60% 0%, rgba(106, 214, 255, .28), transparent 60%),
    linear-gradient(135deg, #4f8cff, #7c6bff);
  box-shadow: var(--sh-sm);
}

.single-detail-hero .detail-avatar {
  margin-top: -46px;
  border: 4px solid var(--bg-soft);
}

.detail-hero h3 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: 0;
}

.detail-hero p {
  max-width: 100%;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}

.detail-actions {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.detail-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-actions.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-actions button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 650;
}

.detail-actions svg {
  width: 16px;
  height: 16px;
}

.context-kind-group .context-overview {
  gap: 14px;
}

.context-kind-group .context-overview .detail-actions {
  gap: 10px;
  margin-top: 4px;
}

.context-kind-group .context-overview .detail-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1;
  box-shadow: none;
}

.context-kind-group .context-overview .detail-actions button svg {
  width: 15px;
  height: 15px;
}

.context-kind-group .context-overview .detail-actions .primary-button {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary), transparent 80%);
}

.context-kind-group .context-overview .detail-actions .primary-button svg {
  color: #fff;
}

.context-kind-group .context-overview .detail-actions button:not(.primary-button) {
  border-color: color-mix(in srgb, var(--line), transparent 12%);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 38%);
  color: var(--ink);
}

.context-kind-group .context-overview .detail-actions button:not(.primary-button) svg {
  color: var(--primary);
}

.user-action-panel {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.user-action-panel.is-compact {
  margin-top: 0;
}

.user-action-grid {
  display: grid;
  gap: 8px;
}

.user-action-grid.is-profile-primary {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .82fr);
}

.user-action-grid.is-primary {
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .78fr));
}

.user-action-grid.is-contact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-action-grid.is-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-action-grid.is-profile-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-action-grid.is-profile-danger {
  grid-template-columns: minmax(0, 1fr);
}

.user-action-grid.is-relation-only {
  grid-template-columns: minmax(0, 1fr);
}

.user-action {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 11px;
  border-color: color-mix(in srgb, var(--line), var(--primary) 10%);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 45%);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.user-action.is-disabled,
.user-action:disabled {
  cursor: not-allowed;
  opacity: .68;
  box-shadow: none;
}

.user-action-panel.is-relation-only {
  gap: 6px;
}

.relation-action-note {
  margin: 0;
  text-align: center;
}

.direct-not-friend-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning), var(--line) 45%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning), var(--surface) 88%);
}

.direct-not-friend-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.direct-not-friend-copy strong {
  font-size: 12.5px;
  color: var(--ink);
}

.direct-not-friend-copy span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}

.direct-not-friend-banner .user-action {
  min-height: 34px;
  border-radius: 9px;
}

.user-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), var(--line) 40%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 34%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary), transparent 88%);
}

.user-action.is-main {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary), transparent 74%);
}

.user-action.is-main:hover {
  color: #fff;
  box-shadow: 0 18px 38px color-mix(in srgb, var(--primary), transparent 68%);
}

.user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 58%);
  background: color-mix(in srgb, var(--danger), transparent 91%);
  color: var(--danger);
}

.user-action.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), transparent 34%);
  background: color-mix(in srgb, var(--danger), transparent 86%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--danger), transparent 88%);
}

.user-action.is-warning {
  border-color: color-mix(in srgb, var(--warn), transparent 54%);
  background: color-mix(in srgb, var(--warn), transparent 89%);
  color: var(--warn);
}

.user-action svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.user-action span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .022);
}

.detail-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-card-head span:first-child {
  min-width: 0;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 640;
  letter-spacing: .4px;
}

.detail-card-head span:last-child {
  color: var(--ink-3);
  font-size: 12px;
}

.detail-card-head button {
  flex: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 640;
}

.detail-card p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.context-kind-group .context-overview .detail-card {
  gap: 12px;
  padding: 14px 14px 15px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface), transparent 8%);
}

.context-kind-group .context-overview .detail-card-head {
  min-height: 18px;
  align-items: baseline;
}

.context-kind-group .context-overview .detail-card-head span:first-child {
  font-size: 12px;
  font-weight: 640;
  letter-spacing: .4px;
}

.context-kind-group .context-overview .detail-card-head button:not(.group-edit-icon-button) {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 640;
  line-height: 1.2;
  box-shadow: none;
}

.context-kind-group .context-overview .detail-card-head button:not(.group-edit-icon-button):hover {
  background: transparent;
  color: color-mix(in srgb, var(--primary), var(--ink) 14%);
  transform: none;
}

.context-kind-group .context-overview .detail-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.chat-key-account-bar {
  position: relative;
  z-index: 4;
  min-width: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--warn), transparent 76%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--warn), var(--surface) 94%), color-mix(in srgb, var(--surface), transparent 4%));
}

.chat-key-account-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.chat-key-account-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.chat-key-account-head {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 9px;
  /* Keep the collapse chevron clear of the absolutely positioned close hit area. */
  padding: 8px 48px 8px 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.chat-key-account-head:hover {
  background: color-mix(in srgb, var(--warn), transparent 92%);
}

.chat-key-account-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn), transparent 84%);
  color: var(--warn);
}

.chat-key-account-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.chat-key-account-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

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

.chat-key-account-title strong {
  color: color-mix(in srgb, var(--warn), var(--ink) 26%);
  font-size: 12px;
  font-weight: 820;
}

.chat-key-account-title small {
  color: var(--ink-3);
  font-size: 11px;
}

.chat-key-account-count {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 86%);
  color: color-mix(in srgb, var(--warn), var(--ink) 18%);
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}

.chat-key-account-chevron {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: transform .16s var(--ease-out);
}

.chat-key-account-chevron svg {
  width: 14px;
  height: 14px;
}

.chat-key-account-bar:not(.is-open) .chat-key-account-chevron {
  transform: rotate(-90deg);
}

.chat-key-account-list {
  position: absolute;
  top: 100%;
  right: 12px;
  left: 12px;
  min-width: 0;
  max-height: min(44vh, 360px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 10px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 70%);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: color-mix(in srgb, var(--surface), var(--warn) 3%);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--ink), transparent 84%);
  overscroll-behavior: contain;
}

.chat-key-account-bar:not(.is-open) .chat-key-account-list {
  display: none;
}

.chat-key-account-item {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 76%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--raise), var(--warn) 5%);
  color: var(--ink);
  text-align: left;
}

.chat-key-account-item:hover {
  border-color: color-mix(in srgb, var(--warn), transparent 48%);
  background: color-mix(in srgb, var(--raise), var(--warn) 10%);
}

.chat-key-account-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn);
}

.chat-key-account-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-key-account-main strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
}

.chat-key-account-main small {
  color: var(--ink-3);
  font-size: 11px;
}

.chat-key-account-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: color-mix(in srgb, var(--warn), var(--ink) 20%);
  font-size: 10.5px;
  font-weight: 780;
  white-space: nowrap;
}

.chat-key-account-meta em {
  font-style: normal;
}

.chat-key-account-state {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--warn), transparent 72%);
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.chat-key-account-state button {
  min-width: 64px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 55%);
  border-radius: 9px;
  background: color-mix(in srgb, var(--raise), var(--warn) 7%);
  color: var(--ink);
}

.chat-key-account-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--warn), transparent 70%);
  border-top-color: var(--warn);
  border-radius: 50%;
  animation: behavior-spin .8s linear infinite;
}

.chat-key-account-head:focus-visible,
.chat-key-account-item:focus-visible,
.chat-key-account-state button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 48%);
  outline-offset: -3px;
}

@media (max-width: 390px) {
  .chat-key-account-head {
    grid-template-columns: 20px minmax(0, 1fr) auto 18px;
    gap: 7px;
    padding-inline: 12px;
  }

  .chat-key-account-icon {
    width: 20px;
    height: 20px;
    border-radius: 7px;
  }

  .chat-key-account-title small {
    display: none;
  }

  .chat-key-account-count {
    padding-inline: 6px;
  }

  .chat-key-account-list {
    right: 6px;
    left: 6px;
    max-height: min(52vh, 320px);
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }
}

.chat-key-account-empty {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, var(--warn), transparent 70%);
  border-radius: 10px;
  color: var(--ink-3);
}

.chat-key-account-empty strong,
.chat-key-account-empty small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.chat-key-account-empty strong {
  color: var(--ink);
  font-weight: 760;
}

.detail-member-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.detail-member,
.detail-member-more {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  color: var(--ink);
  text-align: center;
}

.detail-member .avatar,
.detail-member-more {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.detail-member .avatar {
  font-size: 13px;
}

.detail-member strong,
.detail-member small,
.detail-member-more strong,
.detail-member-more small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-member strong,
.detail-member-more strong {
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 650;
}

.detail-member small,
.detail-member-more small {
  color: var(--ink-3);
  font-size: 10.5px;
}

.detail-member-more {
  align-content: center;
  border: 1px dashed rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .025);
}

.owner-crown {
  position: absolute;
  top: -4px;
  right: calc(50% - 32px);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb75f, #ff815f);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  box-shadow: 0 6px 16px rgba(255, 129, 95, .26);
}

.detail-setting-row,
.detail-kv {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}

.detail-setting-row:first-of-type,
.detail-kv:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.detail-kv strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 620;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-card.drawer-group-managers,
.drawer-card.drawer-group-blacklist {
  width: min(520px, calc(100vw - 28px));
  background:
    radial-gradient(420px 220px at 70% 0%, rgba(91, 157, 255, .12), transparent 62%),
    linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(12, 16, 27, .995));
}

.drawer-card.drawer-group-managers header,
.drawer-card.drawer-group-blacklist header {
  padding: 20px 22px 16px;
}

.drawer-card.drawer-group-managers .drawer-body,
.drawer-card.drawer-group-blacklist .drawer-body {
  padding: 18px 22px 24px;
}

.governance-drawer {
  display: grid;
  gap: 14px;
}

.governance-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(106, 214, 255, .18);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(91, 157, 255, .12), rgba(124, 107, 255, .08));
}

.governance-summary.is-danger {
  border-color: rgba(255, 111, 125, .22);
  background: linear-gradient(135deg, rgba(255, 111, 125, .10), rgba(255, 181, 95, .06));
}

.governance-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(91, 157, 255, .16);
  color: var(--primary);
}

.governance-summary.is-danger .governance-mark {
  background: rgba(255, 111, 125, .14);
  color: var(--bad);
}

.governance-mark svg {
  width: 19px;
  height: 19px;
}

.governance-summary strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.governance-summary p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}

.governance-list {
  display: grid;
  gap: 10px;
}

.governance-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .025);
  transition:
    border-color .16s var(--ease-out),
    background .16s var(--ease-out),
    transform .16s var(--ease-out);
}

.governance-row:hover {
  border-color: rgba(124, 140, 255, .28);
  background: rgba(255, 255, 255, .045);
  transform: translateY(-1px);
}

.governance-row.is-danger:hover {
  border-color: rgba(255, 111, 125, .28);
}

.governance-row .avatar {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 16px;
}

.governance-copy {
  min-width: 0;
}

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

.governance-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 690;
}

.governance-copy small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.governance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.governance-chips i {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(124, 140, 255, .20);
  border-radius: 999px;
  background: rgba(124, 140, 255, .08);
  color: var(--ink-2);
  font-size: 10.5px;
  font-style: normal;
}

.governance-row.is-danger .governance-chips i {
  border-color: rgba(255, 111, 125, .20);
  background: rgba(255, 111, 125, .08);
}

.governance-action {
  min-width: 58px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  color: var(--ink);
  font-size: 12px;
  font-weight: 640;
}

.governance-action:hover {
  border-color: rgba(124, 140, 255, .32);
  background: var(--raise);
}

@media (max-width: 1180px) {
  .im-shell.is-detail-open {
    grid-template-columns: var(--rail-w) minmax(288px, 320px) minmax(0, 1fr);
  }

  .context-panel {
    position: fixed;
    z-index: 55;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, calc(100vw - var(--rail-w)));
    transform: translateX(104%);
    opacity: 0;
    pointer-events: none;
    transition: transform .24s var(--ease-out), opacity .18s var(--ease-out);
  }

  .im-shell.is-detail-open .context-panel {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .context-scrim {
    display: block;
    left: calc(var(--rail-w) + 320px);
  }
}

@media (max-width: 760px) {
  :root {
    --rail-w: 64px;
    --mobile-side-w: min(300px, calc(100vw - var(--rail-w) - 36px));
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"] {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .brand-button,
  .rail-user {
    width: 42px;
  }

  .rail-item {
    width: 48px;
  }

  .side-panel {
    width: var(--mobile-side-w);
    background: rgba(10, 14, 23, .96);
  }

  .context-scrim {
    left: var(--rail-w);
  }

  .workspace-topbar {
    height: 64px;
    min-height: 64px;
    padding: 0 12px;
  }

  .topbar-actions > button:not(.primary-button):not(.detail-action):not(.icon-action) {
    display: none;
  }

  .room-strip {
    margin: 10px 12px 0;
    padding: 9px 10px;
  }

  .rtc-idle-workspace .page-scroll {
    padding: 14px 12px;
  }

  .rtc-empty-panel {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    min-height: auto;
    padding: 20px;
  }

  .rtc-empty-visual {
    width: 82px;
    height: 82px;
    border-radius: 24px;
  }

  .rtc-empty-icon svg {
    width: 34px;
    height: 34px;
  }

  .rtc-empty-copy h2 {
    font-size: 22px;
  }

  .rtc-empty-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rtc-empty-actions button {
    justify-content: center;
    padding: 0 10px;
  }

  .rtc-record-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .rtc-record-card button {
    grid-column: 2 / -1;
  }

  .message-scroll,
  .page-scroll {
    padding-left: 12px;
    padding-right: 12px;
  }

  .message-row,
  .message-row.is-me {
    max-width: 94%;
  }

  .message-hover-time {
    display: none;
  }

  .message-row > .avatar {
    display: grid;
  }

  .composer-panel {
    margin: 8px 10px 12px;
  }

  .reply-bar {
    margin: 8px 10px 0;
    gap: 8px;
  }

  .reply-copy b {
    max-width: 96px;
  }

  .reply-clear-button {
    min-width: 48px;
    padding: 0 8px;
  }

  .composer-hint {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .mention-popover {
    left: calc(var(--rail-w) + 12px);
    right: 12px;
    width: auto;
    bottom: 158px;
  }

  .member-popover {
    left: 0;
    top: 42px;
    width: min(244px, calc(100vw - var(--rail-w) - 34px));
  }

  .composer-actions button:not(.primary-button) {
    display: none;
  }

  .account-profile-card,
  .account-info-list {
    grid-template-columns: 1fr;
  }

  .account-profile-card {
    justify-items: center;
    text-align: center;
  }

.context-panel {
  width: min(360px, calc(100vw - var(--rail-w)));
}
}

.directory-detail-shell {
  width: min(1120px, 100%);
  display: grid;
  gap: 18px;
  margin: 0 auto;
}

.directory-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(124, 140, 255, .24);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .14), rgba(124, 107, 255, .08)),
    rgba(255, 255, 255, .025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.directory-summary-mark,
.directory-avatar {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.directory-summary-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f8cff, #6ad6ff);
  box-shadow: 0 16px 32px rgba(79, 140, 255, .18);
}

.directory-summary.is-requests .directory-summary-mark {
  background: linear-gradient(135deg, #ff9a3d, #ff4f6d);
  box-shadow: 0 16px 32px rgba(255, 111, 78, .18);
}

.directory-summary.is-blacklist .directory-summary-mark {
  background: linear-gradient(135deg, #ff6464, #a855f7);
  box-shadow: 0 16px 32px rgba(255, 100, 100, .16);
}

.directory-summary-copy {
  min-width: 0;
}

.directory-summary-copy small,
.directory-section-title span,
.directory-card-foot,
.request-copy small,
.directory-group-title small,
.directory-notice,
.blacklist-copy small,
.blacklist-copy em {
  color: var(--ink-3);
}

.directory-summary-copy small {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 750;
}

.directory-summary-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.18;
}

.directory-summary-copy p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.directory-summary-stats {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  gap: 8px;
}

.directory-summary-stats span,
.directory-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
}

.directory-summary-stats strong,
.directory-metrics strong {
  color: var(--ink);
  font-size: 15px;
}

.directory-summary-stats small,
.directory-metrics small {
  color: var(--ink-3);
  font-size: 11px;
}

.directory-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.directory-section-title strong {
  color: var(--ink);
  font-size: 15px;
}

.friend-request-list,
.blacklist-record-list {
  display: grid;
  gap: 12px;
}

.friend-request-card,
.directory-group-card,
.blacklist-record-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), transform .16s var(--ease-out);
}

.friend-request-card:hover,
.directory-group-card:hover,
.blacklist-record-card:hover {
  border-color: rgba(124, 140, 255, .35);
  background: rgba(255, 255, 255, .04);
  transform: translateY(-1px);
}

.friend-request-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.request-person,
.directory-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.directory-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #4f8cff, #6ad6ff);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  user-select: none;
}

.directory-avatar.is-request {
  background: linear-gradient(135deg, #ff9a3d, #ff4f6d);
}

.directory-avatar.is-group i {
  position: absolute;
  left: -6px;
  top: auto;
  bottom: -6px;
  min-width: 21px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(255, 221, 126, .72);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1a8, #ffd66d);
  color: #754600;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(245, 188, 54, .22), 0 0 0 2px var(--surface);
}

.directory-avatar.is-blocked {
  background: linear-gradient(135deg, #ff6464, #a855f7);
}

.request-copy,
.directory-group-title,
.blacklist-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.request-copy strong,
.directory-group-title strong,
.blacklist-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-status {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .035);
  font-size: 11px;
  font-weight: 700;
}

.directory-status.is-pending {
  border-color: rgba(255, 204, 107, .30);
  color: #ffcc6b;
  background: rgba(255, 204, 107, .08);
}

.directory-status.is-done,
.directory-status.is-live {
  border-color: rgba(42, 224, 169, .28);
  color: var(--ok);
  background: rgba(42, 224, 169, .08);
}

.directory-status.is-rejected {
  border-color: rgba(255, 111, 111, .30);
  color: var(--danger);
  background: rgba(255, 111, 111, .08);
}

.request-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .026);
  line-height: 1.55;
}

.directory-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.directory-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.directory-card-actions button,
.soft-button {
  min-height: 36px;
  padding: 0 14px;
}

.soft-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .035);
}

.soft-button:hover {
  border-color: rgba(124, 140, 255, .34);
  background: rgba(124, 140, 255, .10);
}

.directory-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.directory-group-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.directory-group-card.is-api {
  border-style: dashed;
}

.directory-notice {
  min-height: 42px;
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(106, 214, 255, .07);
  line-height: 1.55;
}

.directory-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.blacklist-record-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
}

.blacklist-copy em {
  font-style: normal;
  font-size: 11px;
}

body[data-theme="aurora"] .directory-summary {
  border-color: rgba(82, 113, 255, .22);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .13), rgba(124, 107, 255, .09)),
    rgba(255, 255, 255, .92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .72),
    0 14px 34px rgba(35, 48, 82, .08);
}

body[data-theme="aurora"] .directory-summary-copy small {
  color: #6f7d99;
}

body[data-theme="aurora"] .directory-summary-copy h2 {
  color: #172038;
}

body[data-theme="aurora"] .directory-summary-copy p {
  color: #4f5f7c;
}

body[data-theme="aurora"] .directory-summary-stats span,
body[data-theme="aurora"] .directory-metrics span {
  border-color: rgba(24, 34, 48, .13);
  background: rgba(255, 255, 255, .62);
}

body[data-theme="aurora"] .directory-summary-stats strong,
body[data-theme="aurora"] .directory-metrics strong {
  color: #172038;
}

body[data-theme="aurora"] .directory-summary-stats small,
body[data-theme="aurora"] .directory-metrics small {
  color: #75839f;
}

body[data-theme="aurora"] .directory-section-title strong {
  color: #172038;
}

body[data-theme="aurora"] .directory-section-title span,
body[data-theme="aurora"] .directory-card-foot,
body[data-theme="aurora"] .directory-group-title small,
body[data-theme="aurora"] .request-copy small,
body[data-theme="aurora"] .blacklist-copy small,
body[data-theme="aurora"] .blacklist-copy em {
  color: #66738f;
}

body[data-theme="aurora"] .directory-group-card,
body[data-theme="aurora"] .friend-request-card,
body[data-theme="aurora"] .blacklist-record-card {
  border-color: rgba(24, 34, 48, .14);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 26px rgba(35, 48, 82, .06);
}

body[data-theme="aurora"] .directory-group-card:hover,
body[data-theme="aurora"] .friend-request-card:hover,
body[data-theme="aurora"] .blacklist-record-card:hover {
  border-color: rgba(82, 113, 255, .28);
  background: rgba(255, 255, 255, .96);
}

body[data-theme="aurora"] .directory-group-card.is-api {
  border-color: rgba(115, 127, 150, .24);
}

body[data-theme="aurora"] .directory-group-title strong,
body[data-theme="aurora"] .request-copy strong,
body[data-theme="aurora"] .blacklist-copy strong {
  color: #172038;
}

body[data-theme="aurora"] .directory-notice,
body[data-theme="aurora"] .request-message {
  color: #5c6b86;
  background: rgba(79, 140, 255, .075);
  border: 1px solid rgba(79, 140, 255, .06);
}

body[data-theme="aurora"] .directory-status {
  border-color: rgba(24, 34, 48, .13);
  color: #56627d;
  background: rgba(255, 255, 255, .72);
}

body[data-theme="aurora"] .directory-status.is-pending {
  border-color: rgba(214, 146, 37, .28);
  color: #a76516;
  background: rgba(255, 184, 77, .12);
}

body[data-theme="aurora"] .directory-status.is-done,
body[data-theme="aurora"] .directory-status.is-live {
  border-color: rgba(26, 169, 122, .28);
  color: #158768;
  background: rgba(26, 169, 122, .10);
}

body[data-theme="aurora"] .directory-status.is-rejected {
  border-color: rgba(220, 72, 72, .26);
  color: #b63232;
  background: rgba(220, 72, 72, .10);
}

body[data-theme="aurora"] .soft-button {
  color: #24304a;
  border-color: rgba(24, 34, 48, .14);
  background: rgba(255, 255, 255, .72);
}

@media (max-width: 920px) {
  .directory-summary,
  .blacklist-record-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .directory-summary-stats,
  .blacklist-record-card .directory-card-actions {
    grid-column: 1 / -1;
  }

  .directory-summary-stats,
  .directory-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blacklist-record-card .directory-card-actions {
    justify-content: flex-start;
  }
}

:root,
body[data-theme="midnight"] {
  --layer-surface: #111827;
  --layer-surface-2: #0d1220;
  --layer-border: rgba(148, 163, 184, .18);
  --layer-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

body[data-theme="aurora"] {
  --layer-surface: #ffffff;
  --layer-surface-2: #f7f9fd;
  --layer-border: #dfe6f2;
  --layer-shadow: 0 24px 64px rgba(35, 48, 82, .22);
}

.modal-card,
.modal-card.enterprise-modal,
.drawer-card,
.drawer-card.drawer-group-managers,
.drawer-card.drawer-group-blacklist,
.menu-popover,
.emoji-popover,
.mention-popover,
.member-popover,
.message-action-popover,
.toast {
  border-color: var(--layer-border) !important;
  background: linear-gradient(180deg, var(--layer-surface), var(--layer-surface-2)) !important;
  box-shadow: var(--layer-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.toast {
  border-left-color: var(--ok) !important;
}

.toast[data-tone="success"],
.toast[data-tone="ok"] {
  border-left-color: var(--ok) !important;
}

.toast[data-tone="warn"],
.toast[data-tone="warning"] {
  border-left-color: var(--warn) !important;
}

.toast[data-tone="danger"],
.toast[data-tone="error"] {
  border-left-color: var(--danger) !important;
}

body[data-theme="aurora"] .toast-close:hover {
  background: rgba(15, 23, 42, .06);
}

@media (max-width: 520px) {
  .toast-stack {
    top: 12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 24px));
  }

  .toast-stack:hover .toast,
  .toast-stack:focus-within .toast {
    transform: translate3d(0, calc(var(--toast-depth) * 86px), 0) scale(1);
  }
}

body[data-theme="aurora"] .seen-tabs {
  background: #fff;
}

body[data-theme="aurora"] .seen-tabs button {
  color: #52617a;
}

body[data-theme="aurora"] .seen-tabs button.is-active {
  color: #21449a;
  background: linear-gradient(135deg, #e8efff 0%, #f0edff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .22),
    0 8px 18px rgba(79, 140, 255, .10);
}

body[data-theme="aurora"] .seen-tabs button.is-active span {
  color: #20b982;
}

.brand-button:focus-visible,
.rail-user:focus-visible,
.enterprise-switcher:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary), transparent 82%),
    0 10px 28px color-mix(in srgb, var(--primary), transparent 76%);
}

.brand-button:active,
.rail-user:active,
.enterprise-switcher:active {
  opacity: 1;
  transform: scale(.98);
}

body[data-theme="aurora"] .brand-button:focus-visible,
body[data-theme="aurora"] .rail-user:focus-visible {
  box-shadow:
    0 0 0 3px rgba(79, 140, 255, .18),
    0 10px 28px rgba(79, 140, 255, .20);
}

body[data-theme="aurora"] .rail-user {
  background: linear-gradient(135deg, #4b5b93, #6676ba);
  box-shadow: 0 10px 24px rgba(64, 76, 122, .20);
}

body[data-theme="aurora"] .rail-user:hover {
  background: linear-gradient(135deg, #4659a1, #6a6ff0);
}

body[data-theme="aurora"] .enterprise-switcher {
  border-color: rgba(24, 34, 48, .13);
  background:
    radial-gradient(150px 70px at 0% 0%, rgba(79, 140, 255, .10), transparent 72%),
    rgba(255, 255, 255, .72);
  box-shadow: 0 12px 30px rgba(35, 48, 82, .07);
}

body[data-theme="aurora"] .enterprise-switcher:hover,
body[data-theme="aurora"] .enterprise-switcher:focus-visible {
  border-color: rgba(82, 113, 255, .34);
  background:
    radial-gradient(170px 78px at 0% 0%, rgba(79, 140, 255, .15), transparent 74%),
    #fff;
}

body[data-theme="aurora"] .enterprise-switcher.is-readonly:hover,
body[data-theme="aurora"] .enterprise-switcher.is-readonly:focus-visible {
  border-color: rgba(24, 34, 48, .13);
  background:
    radial-gradient(150px 70px at 0% 0%, rgba(79, 140, 255, .10), transparent 72%),
    rgba(255, 255, 255, .72);
}

.member-avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.member-avatar-wrap.is-large {
  align-self: center;
}

.owner-crown{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;width:20px;height:20px;border:1px solid rgba(255,213,128,.55);border-radius:999px;background:linear-gradient(135deg,#ffd66f,#ff8c42);color:#3d2300;box-shadow:0 7px 16px rgba(255,154,66,.24);}
.owner-crown svg{width:11px;height:11px;stroke-width:2.2;}
.admin-shield{position:absolute;right:-6px;bottom:-5px;display:grid;place-items:center;width:19px;height:19px;border:1px solid rgba(106,214,255,.36);border-radius:999px;background:linear-gradient(135deg,rgba(91,157,255,.95),rgba(106,214,255,.86));color:#061529;box-shadow:0 7px 16px rgba(91,157,255,.24);}
.admin-shield svg{width:10.5px;height:10.5px;stroke-width:2.2;}
.role-badge{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:19px;padding:0 7px;border:1px solid rgba(124,140,255,.18);border-radius:7px;background:rgba(124,140,255,.08);color:var(--ink-2);font-size:10.5px;font-weight:650;line-height:1;white-space:nowrap;}
.role-badge svg{width:11px;height:11px;}
.role-badge.is-owner{border-color:rgba(255,190,92,.34);background:linear-gradient(135deg,rgba(255,205,112,.20),rgba(255,140,66,.12));color:#ffbd63;}
.role-badge.is-admin{border-color:rgba(106,214,255,.28);background:rgba(106,214,255,.10);color:var(--primary);}
.owner-inline{display:inline-flex;align-items:center;gap:6px;vertical-align:middle;}
.owner-inline b{color:var(--ink);font-weight:680;}
.owner-inline .role-badge{min-height:19px;padding-inline:6px;font-size:10px;}
.role-member-card{position:relative;transition:transform .16s var(--ease-out),border-color .16s var(--ease-out),background .16s var(--ease-out);}
.role-member-card:hover{transform:translateY(-1px);}
.role-member-card.is-owner{border-color:rgba(255,190,92,.22);background:radial-gradient(90px 50px at 50% 0%,rgba(255,190,92,.14),transparent 72%),var(--raise);}
.role-detail-member .role-badge{margin-top:0;}

.member-role-modal{width:min(560px,calc(100vw - 32px));border-radius:22px;}
.member-role-modal header{align-items:flex-start;padding:22px 24px 18px;}
.member-role-modal header h2{margin:0;font-size:22px;font-weight:780;letter-spacing:0;}
.member-role-modal header p{margin-top:6px;font-size:13px;}
.member-role-body{min-height:0;display:grid;gap:16px;padding:20px 24px 18px;overflow:auto;}
.member-role-hero{display:grid;grid-template-columns:78px minmax(0,1fr);align-items:center;gap:20px;padding:20px;border:1px solid var(--line);border-radius:18px;background:radial-gradient(220px 110px at 0% 0%,rgba(91,157,255,.14),transparent 72%),var(--surface);}
.member-role-hero h3{margin:0 0 6px;color:var(--ink);font-size:21px;font-weight:780;line-height:1.12;}
.member-role-hero p{margin:0 0 12px;color:var(--ink-2);font-size:14px;line-height:1.35;}
.member-role-info{display:grid;gap:0;margin:0;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.025);}
.member-role-info>span{display:grid;grid-template-columns:118px minmax(0,1fr);align-items:center;gap:16px;min-height:58px;padding:14px 18px;border-bottom:1px solid var(--line);}
.member-role-info>span:last-child{border-bottom:0;}
.member-role-info>span>small{color:var(--ink-3);font-size:13px;line-height:1.2;}
.member-role-info>span>strong{min-width:0;color:var(--ink);font-size:14px;font-weight:680;line-height:1.35;}
.member-role-info .member-role-user-id{grid-template-columns:118px minmax(0,1fr);}
.member-role-user-id strong{width:100%;overflow:hidden;text-align:left;white-space:nowrap;}
.member-role-user-id .copy-user-id-button{width:fit-content;max-width:100%;overflow:hidden;}
.member-role-user-id .copy-user-id-button span{overflow:hidden;text-overflow:ellipsis;}
.member-role-modal footer{align-items:center;padding:16px 24px 22px;gap:10px;}
.member-role-modal footer button{min-height:42px;padding-inline:18px;border-radius:14px;font-weight:700;}
.member-role-modal .is-permission-blocked{color:var(--ink-2);background:rgba(255,255,255,.04);cursor:not-allowed;}
.member-role-modal .is-permission-blocked:hover{border-color:var(--line);background:rgba(255,255,255,.04);transform:none;}

.governance-mark.is-owner,
.governance-row.is-owner .avatar {
  background: linear-gradient(135deg, rgba(255, 213, 111, .22), rgba(255, 140, 66, .16));
  color: #ffbd63;
}

.governance-row.is-owner {
  border-color: rgba(255, 190, 92, .22);
}

.governance-row .role-badge {
  justify-self: end;
}

body[data-theme="aurora"] .owner-crown{border-color:rgba(209,128,25,.22);color:#653800;box-shadow:0 9px 18px rgba(218,130,24,.16)}
body[data-theme="aurora"] .role-badge.is-owner{color:#a56300;background:#fff6df}
body[data-theme="aurora"] .role-badge.is-admin{color:#1662bd;background:#e9f5ff}
body[data-theme="aurora"] .admin-shield{border-color:rgba(40,116,206,.22);background:linear-gradient(135deg,#dff0ff,#89c9ff);color:#123f75;box-shadow:0 7px 15px rgba(40,116,206,.15)}
body[data-theme="aurora"] .member-role-hero{background:radial-gradient(240px 120px at 0% 0%,rgba(79,140,255,.11),transparent 72%),#fff}
body[data-theme="aurora"] .member-role-modal{background:#fff!important}
body[data-theme="aurora"] .member-role-info{background:#fff}
body[data-theme="aurora"] .member-role-info>span>small{color:#71809a}
body[data-theme="aurora"] .member-role-modal .is-permission-blocked{color:#66738b;background:#f6f8fc}
body[data-theme="aurora"] .member-role-modal .is-permission-blocked:hover{border-color:rgba(24,34,48,.14);background:#f6f8fc}

@media (max-width: 560px) {
  .member-role-modal header,.member-role-body,.member-role-modal footer{padding-inline:16px}
  .member-role-hero{grid-template-columns:62px minmax(0,1fr);gap:14px;padding:16px}
  .member-role-info>span{grid-template-columns:88px minmax(0,1fr);gap:10px;padding-inline:14px}
}

body[data-theme="aurora"] .switch{background:#e8edf6;box-shadow:inset 0 0 0 1px rgba(20,30,55,.08)}
body[data-theme="aurora"] .switch.is-on{background:var(--grad);box-shadow:none}

.mute-strip{border-color:rgba(255,184,77,.28);background:linear-gradient(135deg,rgba(255,184,77,.12),rgba(255,111,97,.08)),var(--surface)}
.mute-strip.is-scheduled{border-color:rgba(91,157,255,.26);background:linear-gradient(135deg,rgba(91,157,255,.12),rgba(124,111,255,.08)),var(--surface)}
.mute-strip .room-strip-main>span:first-child{color:var(--warn)}
.mute-strip.is-scheduled .room-strip-main>span:first-child{color:var(--primary)}
.group-governance-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:4px}
.group-governance-action-grid .group-mute-control{grid-column:1/-1}
.group-settings-section{display:grid;gap:10px;margin-top:12px}
.group-settings-section:first-of-type{margin-top:0}
.group-settings-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.group-settings-section-head strong{color:var(--ink);font-size:13px;font-weight:780}
.group-settings-section-head small{max-width:190px;color:var(--ink-3);font-size:11px;line-height:1.45;text-align:right}
.group-settings-section.is-danger .group-settings-section-head strong{color:var(--bad)}
.group-mute-control,.group-mute-list-entry{display:grid;gap:12px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--raise)}
.group-manage-setting-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}
.group-setting-tile{min-height:56px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--raise),var(--surface) 24%)}
.group-setting-tile.is-wide{grid-column:1/-1}
.group-setting-tile:last-child{border-bottom:1px solid var(--line)}
.group-mute-control.is-active{border-color:rgba(255,184,77,.28);background:radial-gradient(160px 80px at 0% 0%,rgba(255,184,77,.12),transparent 72%),var(--raise)}
.group-mute-control.is-scheduled{border-color:rgba(91,157,255,.24)}
.group-mute-control.is-readonly,.group-mute-list-entry.is-readonly{border-style:dashed;opacity:.82}
.group-mute-copy{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:10px}
.group-mute-copy b,.group-mute-inline b{display:block;color:var(--ink);font-size:13px;font-weight:720}
.group-mute-copy b{display:flex;align-items:center;gap:6px}
.group-mute-copy small,.group-mute-inline small{display:block;margin-top:3px;color:var(--ink-3);font-size:11px;line-height:1.45}
.group-mute-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:12px;color:var(--warn);background:rgba(255,184,77,.11)}
.group-mute-icon.is-danger{color:var(--bad);background:rgba(255,99,132,.12)}
.group-mute-icon svg{width:18px;height:18px}
.group-control-state{display:inline-flex;align-items:center;min-height:20px;padding:0 8px;border-radius:999px;background:color-mix(in srgb,var(--primary),transparent 88%);color:var(--primary);font-size:11px;font-style:normal;font-weight:760}
.group-mute-actions{display:flex;flex-wrap:wrap;gap:8px}
.group-mute-actions button,.danger-soft-button{min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink-2)}
.group-mute-actions button:hover{border-color:rgba(91,157,255,.34);color:var(--ink)}
.group-mute-actions button.is-permission-blocked,.group-mute-inline button.is-permission-blocked,.governance-action.is-permission-blocked,button.is-permission-blocked,[role="button"].is-permission-blocked{cursor:not-allowed;opacity:.62}
.group-mute-actions button.is-permission-blocked:hover,.group-mute-inline button.is-permission-blocked:hover,.governance-action.is-permission-blocked:hover,button.is-permission-blocked:hover,[role="button"].is-permission-blocked:hover{transform:none;box-shadow:none}

.group-mute-list-body{min-width:0;min-height:0;display:flex;flex-direction:column;gap:12px;padding:14px 20px 18px;overflow:hidden}
.group-mute-list-body>.group-mute-list-error{flex:0 0 auto;max-height:56px;overflow:auto}
.group-mute-list-error,.group-mute-list-empty{margin:0;padding:10px 12px;border-radius:12px;background:color-mix(in srgb,var(--warn),transparent 88%);color:var(--ink-2);font-size:12px;line-height:1.55}
.group-mute-list-add,.group-mute-list-section,.group-mute-list-candidates,.group-mute-list-rows{display:grid;min-width:0}
.group-mute-list-add,.group-mute-list-section{min-height:0;gap:8px;grid-template-rows:auto minmax(0,1fr)}
.group-mute-list-add{flex:1.6 1 0}
.group-mute-list-section{flex:1 1 0}
.group-mute-list-candidates,.group-mute-list-rows{min-height:0;gap:8px;align-content:start;grid-auto-rows:max-content;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:2px}
.group-mute-list-candidates{grid-template-columns:repeat(2,minmax(0,1fr))}
.group-mute-list-candidates>.muted-note{grid-column:1/-1}
.group-mute-list-add label,.group-mute-list-footer label{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:7px;color:var(--ink-2);font-size:12px;font-weight:720}
.group-mute-list-add input,.group-mute-list-footer input{width:100%;min-height:38px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px}
.group-mute-list-candidate,.group-mute-list-row{width:100%;min-width:0;display:grid;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--raise),var(--surface) 26%)}
.group-mute-list-candidate{min-height:56px;grid-template-columns:34px minmax(0,1fr) auto;text-align:left;color:var(--ink);cursor:pointer;transition:border-color .16s var(--ease-out),background .16s var(--ease-out),transform .16s var(--ease-out)}
.group-mute-list-candidate:hover{border-color:rgba(91,157,255,.34);transform:translateY(-1px)}
.group-mute-list-candidate.is-selected{border-color:rgba(91,157,255,.45);background:color-mix(in srgb,var(--primary),transparent 88%)}
.group-mute-list-selection{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;max-height:48px;overflow:auto;padding:6px 10px;border:1px solid rgba(91,157,255,.28);border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 90%)}
.group-mute-list-selection span,.group-mute-list-selection small{color:var(--ink-3);font-size:11px;line-height:1.35}
.group-mute-list-selection strong{min-width:0;color:var(--ink);font-size:13px;font-weight:760}
.group-mute-list-row{grid-template-columns:40px minmax(0,1fr) auto}
.group-mute-list-row.is-confirming{border-color:rgba(255,99,132,.32);background:color-mix(in srgb,var(--bad),transparent 91%)}
.group-mute-list-candidate>span:not(.avatar),.group-mute-list-row>div:not(.group-mute-list-row-actions){min-width:0;display:grid;gap:3px}
.group-mute-list-candidate b,.group-mute-list-row strong,.group-mute-list-toolbar strong{overflow:hidden;color:var(--ink);font-size:13px;font-weight:760;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-candidate small,.group-mute-list-row small{overflow:hidden;color:var(--ink-3);font-size:11px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-candidate i{display:inline-flex;align-items:center;justify-content:center;min-width:42px;min-height:28px;padding:0 9px;border:1px solid var(--line);border-radius:999px;color:var(--primary);font-size:11px;font-style:normal;font-weight:760;background:var(--surface)}
.group-mute-list-candidate.is-selected i{border-color:transparent;color:#fff;background:var(--grad)}
.group-mute-list-row em{color:var(--bad);font-size:11px;font-style:normal;line-height:1.45}
.group-mute-list-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.group-mute-list-row-actions button{min-height:32px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink-2);font-weight:720}
.group-mute-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px}
.group-mute-list-toolbar button,.group-mute-list-footer-actions button{min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--primary);font-weight:720}
.group-mute-list-footer .primary-button{min-height:40px;border:0;color:#fff;background:var(--grad)}

.danger-soft-button {
  border-color: rgba(255, 99, 132, .26);
  color: var(--bad);
}

.group-lifecycle-entry{min-height:58px;border-color:var(--line);border-radius:16px;background:var(--raise)}
.group-lifecycle-entry small{display:block;margin-top:3px;color:var(--ink-3);font-size:11px;line-height:1.45}
.group-lifecycle-entry button{min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--primary);font-weight:720}
.group-lifecycle-entry.is-owner-danger button{color:var(--ink-2)}
.group-lifecycle-entry.is-owner-danger:hover{border-color:rgba(255,99,132,.22)}
.group-lifecycle-actions{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid rgba(255,99,132,.28);border-radius:14px;background:color-mix(in srgb,var(--bad),transparent 92%)}
.group-lifecycle-actions small{display:block;margin-top:4px;color:var(--ink-3);font-size:12px}
.group-lifecycle-preview{display:grid;gap:8px;margin-top:12px}
.group-lifecycle-preview span{display:flex;gap:8px;padding:8px;border:1px solid var(--line);font-size:13px}

.group-owner-transfer-entry{cursor:pointer}
.group-owner-transfer-candidates{display:grid;gap:8px}
.group-owner-transfer-candidate{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer}
.group-owner-transfer-candidate:hover{border-color:color-mix(in srgb,var(--primary),var(--line) 60%)}
.group-owner-transfer-candidate:has(input:checked){border-color:var(--primary);background:color-mix(in srgb,var(--primary),transparent 90%)}
.group-owner-transfer-candidate input[type="radio"]{width:18px;height:18px;min-height:0;margin:0;padding:0;accent-color:var(--primary)}
.group-owner-transfer-candidate span{min-width:0;display:grid;gap:2px}
.group-owner-transfer-candidate strong{overflow:hidden;color:var(--ink);font-size:14px;text-overflow:ellipsis;white-space:nowrap}
.group-owner-transfer-candidate small{overflow:hidden;color:var(--ink-3);font-size:12px;text-overflow:ellipsis;white-space:nowrap}

.group-mute-inline{min-width:0;display:inline-flex;align-items:center;justify-content:flex-end;gap:10px}
.group-mute-inline>span{min-width:0;text-align:right}
.group-mute-inline button{flex:0 0 auto;min-height:30px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--primary)}
.group-mute-inline.is-readonly{opacity:.82}

@media (max-width: 720px) {
  .group-governance-action-grid,
  .group-manage-setting-grid {
    grid-template-columns: 1fr;
  }
  .group-settings-section-head,.group-lifecycle-actions {
    display:grid;
    grid-template-columns:1fr;
    align-items:start;
  }
  .group-settings-section-head small {
    max-width:none;
    text-align:left;
  }
}

.group-nickname-entry small{display:block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-nickname-modal{width:min(460px,calc(100vw - 28px))}
.group-nickname-editor{display:grid;gap:10px;padding:20px}
.group-nickname-editor label{display:grid;gap:8px;color:var(--ink-2);font-size:12px;font-weight:700}
.group-nickname-editor input{width:100%;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);padding:11px 12px;font:inherit;outline:none}
.group-nickname-editor input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent)}
.group-nickname-editor-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;color:var(--ink-3);font-size:11px}
.group-nickname-editor-meta span{flex:0 0 auto;font-variant-numeric:tabular-nums}

.group-mute-modal{width:min(430px,calc(100vw - 32px));border-radius:24px;box-shadow:0 28px 78px rgba(0,0,0,.32)}
.group-mute-list-layer{padding:16px}
.modal-card.group-mute-list-modal{width:min(720px,100%);min-width:0;grid-template-columns:minmax(0,1fr);height:min(800px,calc(100vh - 32px));height:min(800px,calc(100dvh - 32px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
.group-mute-list-modal>header>div{min-width:0;overflow:hidden}
.group-mute-list-modal>header p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-modal>header>.icon-action{flex-shrink:0}
.group-mute-list-footer{flex:none;min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding-top:10px;border-top:1px solid var(--line)}
.group-mute-list-footer-actions{display:flex;justify-content:flex-end;gap:8px}
.group-mute-list-footer-actions button{min-width:64px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-footer-actions .primary-button{min-width:0;flex:1}
.group-mute-list-candidate>.avatar{width:34px;height:34px;min-width:34px}
.group-mute-list-row>.avatar{width:40px;height:40px;min-width:40px}
.group-mute-list-modal .identity-display-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:540px){
  .group-mute-list-candidates{grid-template-columns:minmax(0,1fr)}
  .group-mute-list-body{padding:10px 12px 12px;gap:8px}
}
@media (max-height:600px){
  .group-mute-list-layer{padding:8px}
  .modal-card.group-mute-list-modal{height:calc(100vh - 16px);height:calc(100dvh - 16px);max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
  .group-mute-list-modal>header{padding:10px 14px}
  .group-mute-list-body{padding:8px 12px;gap:6px}
  .group-mute-list-add,.group-mute-list-section,.group-mute-list-footer{gap:5px}
  .group-mute-list-footer{padding-top:6px}
  .group-mute-list-selection{padding:3px 8px}
  .group-mute-list-add input,.group-mute-list-footer input{min-height:32px}
  .group-mute-list-footer .primary-button{min-height:34px}
}

@media (max-height:480px){
  .group-mute-list-modal>header{padding:6px 12px}
  .group-mute-list-add label,.group-mute-list-footer label{grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px}
}
@media (max-height:480px) and (min-width:541px){
  .group-mute-list-footer{grid-template-columns:minmax(0,1fr) minmax(180px,.8fr);align-items:center}
  .group-mute-list-selection{grid-column:1/-1}
}
@media (max-width:480px){
  .group-mute-list-row{grid-template-columns:40px minmax(0,1fr)}
  .group-mute-list-row>.group-mute-list-row-actions,.group-mute-list-row>.danger-soft-button{grid-column:2/-1;justify-self:end}
}
.group-mute-modal .group-mute-head{align-items:flex-start;padding:20px 22px 14px;border-bottom:0}
.group-mute-title{min-width:0;display:flex;align-items:center;gap:12px}
.group-mute-title-icon{width:42px;height:42px;flex:none;display:grid;place-items:center;border-radius:15px;color:#fff;background:var(--grad);box-shadow:0 14px 28px color-mix(in srgb,var(--primary),transparent 72%)}
.group-mute-title-icon svg{width:20px;height:20px}
.group-mute-title h2{color:var(--ink);font-size:18px;font-weight:760;letter-spacing:0}
.group-mute-title p{color:var(--ink-2);font-size:12px;line-height:1.45}
.group-mute-form{display:grid;gap:12px;padding:0 22px 14px}
.group-mute-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.group-mute-mode-card{min-width:0;min-height:112px;display:grid;grid-template-columns:32px minmax(0,1fr);align-content:start;gap:10px;padding:14px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface-soft),var(--surface) 55%);color:var(--ink);text-align:left;transition:border-color .16s var(--ease-out),background .16s var(--ease-out),transform .16s var(--ease-out)}
.group-mute-mode-card:hover{border-color:color-mix(in srgb,var(--primary),transparent 54%);transform:translateY(-1px)}
.group-mute-mode-card:focus-visible{outline:2px solid color-mix(in srgb,var(--primary),transparent 42%);outline-offset:2px}
.group-mute-mode-card.is-selected{border-color:color-mix(in srgb,var(--primary),transparent 30%);background:color-mix(in srgb,var(--primary),transparent 90%);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary),transparent 72%)}
.group-mute-mode-card:disabled{cursor:wait;opacity:.7;transform:none}
.group-mute-mode-card>span:last-child{min-width:0}
.group-mute-mode-card b{display:block;color:var(--ink);font-size:13px;font-weight:780}
.group-mute-mode-card small{display:block;margin-top:5px;color:var(--ink-3);font-size:11px;line-height:1.5}
.group-mute-mode-mark{width:32px;height:32px;display:grid;place-items:center;border-radius:11px;background:color-mix(in srgb,var(--primary),transparent 88%);color:var(--primary)}
.group-mute-mode-mark svg{width:16px;height:16px}
.group-mute-card{overflow:hidden;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface-soft),var(--surface) 55%)}
.group-mute-toggle-row,.group-mute-time-row{min-height:56px;display:grid;align-items:center;gap:12px;padding:0 14px;border-bottom:1px solid var(--line)}
.group-mute-toggle-row{grid-template-columns:minmax(0,1fr) auto}
.group-mute-time-row{grid-template-columns:minmax(0,1fr) auto auto;color:var(--ink);font-size:13px;font-weight:720}
.group-mute-time-row:last-child{border-bottom:0}
.group-mute-toggle-row b{display:block;color:var(--ink);font-size:13px;font-weight:760}
.group-mute-toggle-row small{display:block;margin-top:3px;color:var(--ink-3);font-size:11px;line-height:1.45}
.group-mute-time-row input{width:82px;min-height:34px;padding:0 10px;border:0;border-radius:999px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;font-weight:720;text-align:center;color-scheme:dark}
.group-mute-time-row input:focus{outline:2px solid color-mix(in srgb,var(--primary),transparent 58%);outline-offset:2px}
.group-mute-timezone{margin:0;display:grid;gap:2px;color:var(--ink-3);font-size:11px;line-height:1.55}
.group-mute-timezone b{color:var(--ink-2);font-size:12px;font-variant-numeric:tabular-nums}
.next-day-pill{min-width:34px;display:inline-flex;align-items:center;justify-content:center;padding:4px 7px;border-radius:999px;background:color-mix(in srgb,var(--warn),transparent 86%);color:var(--warn);font-size:11px;font-weight:760}
.next-day-pill.is-hidden{display:none}
.group-mute-note{display:grid;gap:7px;padding:10px 12px;border-radius:14px;background:color-mix(in srgb,var(--surface-soft),var(--surface) 58%)}
.group-mute-note p{margin:0;display:grid;grid-template-columns:16px minmax(0,1fr);align-items:start;gap:7px;color:var(--ink-3);font-size:11px;line-height:1.55}
.group-mute-note svg{width:14px;height:14px;margin-top:1px;color:var(--ink-3)}
.group-mute-warning,.group-mute-error{margin:0;padding:10px 12px;border-radius:12px;font-size:12px;line-height:1.55}
.group-mute-warning{display:grid;grid-template-columns:16px minmax(0,1fr);gap:7px;background:color-mix(in srgb,var(--warn),transparent 88%);color:var(--warn)}
.group-mute-warning svg{width:14px;height:14px;margin-top:2px}
.group-mute-error{background:color-mix(in srgb,var(--bad),transparent 90%);color:var(--bad)}
.group-mute-confirm-copy{display:grid;gap:6px;padding:14px;border:1px solid color-mix(in srgb,var(--bad),transparent 72%);border-radius:15px;background:color-mix(in srgb,var(--bad),transparent 92%)}
.group-mute-confirm-copy strong{color:var(--ink);font-size:14px}
.group-mute-confirm-copy p{margin:0;color:var(--ink-2);font-size:12px;line-height:1.6}
.group-mute-title-icon.is-danger{background:linear-gradient(135deg,var(--bad),color-mix(in srgb,var(--bad),#7828ff 34%))}
.group-mute-modal footer{display:block;padding:0 22px 22px;border-top:0}
.group-mute-modal footer .primary-button{width:100%;min-height:44px;border-radius:14px;font-size:14px;font-weight:760}
.group-mute-modal footer.group-mute-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.group-mute-confirm-actions button{min-height:44px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink-2);font-weight:760}
.group-mute-confirm-actions .danger-button{border-color:color-mix(in srgb,var(--bad),transparent 60%);background:color-mix(in srgb,var(--bad),transparent 88%);color:var(--bad)}
.composer-panel.is-muted-blocked{border-color:rgba(255,184,77,.32);background:linear-gradient(180deg,rgba(255,184,77,.055),rgba(255,255,255,.02)),var(--surface)}
.composer-panel.is-muted-allowed{border-color:rgba(62,210,166,.22)}
.mute-locked-banner{display:flex;align-items:flex-start;gap:10px;margin:10px 12px 0;padding:10px 12px;border:1px solid rgba(255,184,77,.24);border-radius:14px;color:var(--ink);background:rgba(255,184,77,.075);font-size:12px;font-weight:650}
.mute-locked-banner svg{width:16px;height:16px;flex:0 0 auto;margin-top:2px;color:var(--warn)}
.mute-locked-banner span{display:flex;flex-direction:column;flex:1;min-width:0;gap:2px}
.mute-locked-banner b{color:var(--ink);font-size:13px;line-height:1.35}
.mute-locked-banner small{color:var(--ink-3);font-size:12px;font-weight:600;line-height:1.45}
.mute-locked-banner button{min-height:30px;padding:0 11px;border:1px solid rgba(255,184,77,.24);border-radius:999px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700}
.composer-panel.is-muted-blocked .composer-input-row{background:rgba(255,184,77,.035)}
.composer-panel.is-muted-blocked .composer-input textarea:disabled{color:var(--ink-3);-webkit-text-fill-color:var(--ink-3)}
.composer-panel.is-muted-blocked .send-button:disabled{opacity:.62;filter:saturate(.78)}
.composer-panel.is-muted-allowed .composer-hint>span:first-child{color:var(--good)}
.composer-tool.is-disabled,.composer-tool:disabled,.send-button:disabled,.composer-input textarea:disabled{cursor:not-allowed;opacity:.54}
body[data-theme="aurora"] .mute-strip,body[data-theme="aurora"] .group-mute-control.is-active{border-color:rgba(193,112,0,.22);background:linear-gradient(135deg,rgba(255,219,159,.64),rgba(255,238,221,.72)),#fff}
body[data-theme="aurora"] .group-mute-form input{color-scheme:light}
body[data-theme="aurora"] .group-mute-modal{box-shadow:0 26px 68px rgba(95,111,146,.22)}
body[data-theme="aurora"] .group-mute-card{background:#fff;border-color:rgba(20,30,55,.08)}
body[data-theme="aurora"] .group-mute-time-row input{background:#f4f6fb;color:#172033}
body[data-theme="aurora"] .group-mute-note{background:#f5f7f2}
body[data-theme="aurora"] .group-mute-mode-card{background:#fff}
body[data-theme="aurora"] .group-mute-mode-card.is-selected{background:#f0f5ff}

@media (max-width:560px){
  .group-mute-modal{width:min(100vw - 20px,430px)}
  .group-mute-mode-grid{grid-template-columns:1fr}
  .group-mute-mode-card{min-height:88px}
  .group-mute-modal .group-mute-head{padding:18px 16px 12px}
  .group-mute-form{padding:0 16px 12px}
  .group-mute-modal footer{padding:0 16px 18px}
}
body[data-theme="aurora"] .next-day-pill{background:#fff1d9;color:#d58a0a}
body[data-theme="aurora"] .mute-locked-banner{border-color:rgba(193,112,0,.18);background:rgba(255,236,200,.78);color:#172033}
body[data-theme="aurora"] .composer-panel.is-muted-blocked{border-color:rgba(193,112,0,.22);background:linear-gradient(180deg,rgba(255,218,154,.28),rgba(255,255,255,.78)),var(--surface)}
body[data-theme="aurora"] .composer-panel.is-muted-blocked .composer-input-row{background:rgba(255,247,232,.92)}
body[data-theme="aurora"] .group-mute-icon{background:#fff8ea}
.muted-note{margin:0;color:var(--ink-3);font-size:12px;line-height:1.7}

.join-request-card{gap:12px}
.join-request-list{display:grid;gap:10px}
.join-request-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-soft)}
.join-request-row strong,.join-request-row small,.join-request-row em{display:block}
.join-request-row small,.join-request-row em{color:var(--ink-3);font-size:12px;font-style:normal;line-height:1.5}
.join-request-row>div{display:flex;gap:8px}
.frow .is-disabled-like{opacity:.66}
body[data-theme="aurora"] .join-request-row{background:#fff}

.contact-profile-workspace .page-scroll{padding:clamp(22px,3.2vw,42px);background:linear-gradient(180deg,color-mix(in srgb,var(--surface),transparent 80%),transparent 48%),transparent}
.contact-profile-stack{width:min(1080px,100%);margin:0 auto}
.contact-profile-card{position:relative;display:grid;grid-template-columns:minmax(260px,.72fr) minmax(420px,1fr);gap:0;padding:0;overflow:hidden;border-radius:18px;background:linear-gradient(180deg,color-mix(in srgb,var(--surface),transparent 4%),color-mix(in srgb,var(--surface),var(--bg) 10%));box-shadow:0 18px 54px color-mix(in srgb,#000,transparent 88%),inset 0 1px 0 color-mix(in srgb,#fff,transparent 92%)}

.contact-profile-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--ok));
}

.contact-profile-identity {
  min-width: 0;
  padding: clamp(24px, 3vw, 34px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(220px 150px at 18% 10%, color-mix(in srgb, var(--primary), transparent 84%), transparent 72%),
    color-mix(in srgb, var(--surface-soft), transparent 18%);
}

.contact-profile-large {
  grid-template-columns: 68px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  text-align: left;
  gap: 14px 16px;
  padding: 0;
}

.contact-profile-large .avatar-xl {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  font-size: 25px;
  box-shadow:
    0 14px 32px color-mix(in srgb, var(--primary), transparent 78%),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}

.contact-profile-large h2 {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.12;
  font-weight: 780;
}

.contact-profile-large p {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 13px;
}

.contact-profile-large .status-pill {
  grid-column: 2;
  justify-self: start;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  background: color-mix(in srgb, var(--ok), transparent 88%);
  box-shadow: none;
}

.contact-profile-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: clamp(24px, 3vw, 34px);
}

.contact-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 30%);
}

.contact-info-grid > span {
  min-height: 74px;
  padding: 14px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.contact-info-grid > span:nth-child(2n) {
  border-right: 0;
}

.contact-info-grid > span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.contact-info-grid small {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 760;
}

.contact-info-grid strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
}

.contact-profile-card .user-action-panel {
  margin-top: 0;
  gap: 10px;
}

.contact-profile-card .user-action-grid {
  gap: 10px;
}

.contact-profile-card .user-action-grid.is-profile-primary,
.contact-profile-card .user-action-grid.is-primary {
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(112px, .72fr));
}

.contact-profile-card .user-action-grid.is-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-profile-card .user-action {
  min-height: 42px;
  border-radius: 12px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 8%);
  box-shadow: none;
  color: var(--ink);
}

.contact-profile-card .user-action:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--primary), transparent 88%);
}

.contact-profile-card .user-action.is-main {
  border-color: color-mix(in srgb, var(--primary), transparent 35%);
  background: color-mix(in srgb, var(--primary), #213255 12%);
  color: #fff;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary), transparent 78%);
}

.contact-profile-card .user-action.is-danger {
  background: color-mix(in srgb, var(--danger), transparent 94%);
}

.contact-profile-workspace .workspace-topbar {
  box-shadow: inset 0 -1px 0 var(--line);
}

.side-panel .plain-row.is-active {
  border-color: color-mix(in srgb, var(--primary), transparent 62%);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 82%), transparent 72%),
    color-mix(in srgb, var(--surface), transparent 12%);
  box-shadow:
    inset 3px 0 0 var(--primary),
    0 10px 28px color-mix(in srgb, var(--primary), transparent 90%);
}

body[data-theme="aurora"] .contact-profile-workspace .page-scroll {
  background: linear-gradient(180deg, #f8faff 0%, #f3f6fb 100%);
}

body[data-theme="aurora"] .contact-profile-card {
  border-color: #dfe6f2;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow:
    0 24px 70px rgba(40, 52, 86, .12),
    inset 0 1px 0 rgba(255, 255, 255, .85);
}

body[data-theme="aurora"] .contact-profile-identity {
  background:
    radial-gradient(240px 150px at 20% 0%, rgba(79, 140, 255, .13), transparent 74%),
    #f8fbff;
}

body[data-theme="aurora"] .contact-info-grid {
  background: #fff;
}

body[data-theme="aurora"] .contact-profile-card .user-action {
  background: #f8faff;
}

body[data-theme="aurora"] .contact-profile-card .user-action.is-main {
  border-color: transparent;
  background: #315fd6;
  color: #fff;
}

body[data-theme="aurora"] .contact-profile-card .user-action.is-danger {
  background: #fff4f6;
}

body[data-theme="aurora"] .side-panel .plain-row.is-active {
  background:
    linear-gradient(90deg, rgba(79, 140, 255, .14), rgba(79, 140, 255, .02) 72%),
    #fff;
  border-color: rgba(79, 140, 255, .32);
  box-shadow:
    inset 3px 0 0 #4f8cff,
    0 12px 30px rgba(35, 48, 82, .08);
}

body[data-theme="midnight"] .contact-profile-card {
  border-color: rgba(148, 163, 184, .14);
  background: linear-gradient(180deg, rgba(17, 24, 39, .96), rgba(11, 16, 28, .98));
  box-shadow:
    0 26px 72px rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

body[data-theme="midnight"] .contact-profile-identity {
  background:
    radial-gradient(240px 150px at 20% 0%, rgba(91, 157, 255, .15), transparent 74%),
    rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .contact-info-grid {
  background: rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .contact-profile-card .user-action {
  background: rgba(255, 255, 255, .035);
}

@media (max-width: 1180px) {
  .contact-profile-card {
    grid-template-columns: 1fr;
  }

  .contact-profile-identity {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .contact-profile-workspace .page-scroll {
    padding: 14px;
  }

  .contact-profile-identity,
  .contact-profile-body {
    padding: 18px;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
  }

  .contact-info-grid > span,
  .contact-info-grid > span:nth-child(2n),
  .contact-info-grid > span:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .contact-info-grid > span:last-child {
    border-bottom: 0;
  }

  .contact-profile-card .user-action-grid.is-profile-primary,
  .contact-profile-card .user-action-grid.is-primary,
  .contact-profile-card .user-action-grid.is-secondary {
    grid-template-columns: 1fr;
  }

  .contact-profile-card .user-action,
  .contact-profile-card .user-action:hover,
  .contact-profile-card .user-action.is-main {
    box-shadow: none;
  }
}

.contact-profile-workspace .page-scroll {
  padding: clamp(24px, 3.4vw, 46px);
}

.contact-profile-stack {
  width: min(1120px, 100%);
}

.contact-profile-card {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
  align-items: stretch;
  padding: clamp(20px, 2.5vw, 28px);
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 10%);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(420px 280px at 8% 6%, color-mix(in srgb, var(--primary), transparent 88%), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface), transparent 2%), color-mix(in srgb, var(--surface), var(--bg) 8%));
  box-shadow:
    0 22px 60px color-mix(in srgb, #000, transparent 88%),
    inset 0 1px 0 color-mix(in srgb, #fff, transparent 92%);
}

.contact-profile-card::before {
  width: 3px;
  inset: 24px auto 24px 0;
  border-radius: 999px;
  opacity: .9;
}

.contact-profile-hero {
  min-width: 0;
  min-height: 300px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid color-mix(in srgb, var(--line), transparent 10%);
  border-radius: 24px;
  background:
    radial-gradient(220px 150px at 50% 8%, color-mix(in srgb, var(--primary), transparent 80%), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 8%), color-mix(in srgb, var(--surface-soft), transparent 36%));
  text-align: center;
}

.contact-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

.contact-avatar-wrap .avatar-xl {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  font-size: 34px;
  box-shadow:
    0 18px 38px color-mix(in srgb, var(--primary), transparent 76%),
    inset 0 1px 0 rgba(255, 255, 255, .30);
}

.contact-presence {
  position: absolute;
  z-index: 2;
  /* Inset from the square bounds so the dot straddles the circular avatar. */
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border: 3px solid color-mix(in srgb, var(--surface-soft), var(--bg) 18%);
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
}

.contact-presence[data-status="online"] {
  background: var(--ok);
}

.contact-profile-copy {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.contact-profile-kicker {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
}

.contact-profile-copy h2 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-profile-copy p {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-profile-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.contact-profile-chips .status-pill {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 64%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok), transparent 88%);
  color: var(--ok);
  font-size: 12px;
  font-weight: 760;
}

.contact-profile-chips .status-pill[data-status="offline"] {
  border-color: color-mix(in srgb, var(--muted), transparent 58%);
  background: color-mix(in srgb, var(--muted), transparent 88%);
  color: var(--muted);
}

.contact-profile-chips .status-pill.is-soft {
  border-color: color-mix(in srgb, var(--primary), transparent 72%);
  background: color-mix(in srgb, var(--primary), transparent 90%);
  color: var(--primary);
}

.contact-profile-chips .status-pill.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 90%);
  color: var(--danger);
}

.contact-profile-body {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 0;
}

.contact-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-section-title strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
}

.contact-section-title button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary), transparent 90%);
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.contact-info-grid > span,
.contact-info-grid > span:nth-child(2n),
.contact-info-grid > span:nth-last-child(-n + 2) {
  min-height: 82px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 4%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft), transparent 24%);
}

.contact-info-grid small {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 760;
}

.contact-info-grid strong{overflow:visible;color:var(--ink);font-size:15px;font-weight:760;line-height:1.45;overflow-wrap:anywhere;text-overflow:clip;white-space:normal}
.contact-profile-card .user-action-panel{gap:12px;padding:14px;border:1px solid color-mix(in srgb,var(--line),transparent 10%);border-radius:20px;background:color-mix(in srgb,var(--surface-soft),transparent 30%)}
.contact-profile-card .user-action-grid{gap:10px}
.contact-profile-card .user-action-grid.is-primary{grid-template-columns:minmax(0,1.25fr) repeat(2,minmax(118px,.72fr));border:0;background:transparent;box-shadow:none;color:inherit}
.contact-profile-card .user-action-grid.is-contact-actions{grid-template-columns:repeat(2,minmax(0,1fr));border:0;background:transparent;box-shadow:none;color:inherit}
.contact-profile-card .user-action-grid.is-secondary{grid-template-columns:repeat(3,minmax(0,1fr))}

.contact-profile-card .user-action {
  min-height: 46px;
  border-radius: 15px;
  border-color: color-mix(in srgb, var(--line), var(--primary) 8%);
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 45%);
  color: var(--ink);
  font-size: 13px;
  box-shadow: none;
}

.contact-profile-card .user-action.is-main {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary), transparent 86%);
}

.contact-profile-card .user-action-grid.is-contact-actions .user-action {
  width: 100%;
}

.contact-profile-card .user-action-grid.is-contact-actions .user-action.is-main,
.contact-profile-card .user-action-grid.is-contact-actions .user-action[data-action="delete-friend"] {
  grid-column: auto;
}

.contact-profile-card .user-action-grid.is-primary .user-action:not(.is-main) {
  position: relative;
  z-index: 1;
}

.contact-profile-card .user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 72%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
  color: var(--danger);
}

body[data-theme="aurora"] .contact-profile-card {
  border-color: #dce4f1;
  background:
    radial-gradient(420px 280px at 8% 6%, rgba(79, 140, 255, .12), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 24px 70px rgba(31, 45, 77, .10),
    inset 0 1px 0 rgba(255, 255, 255, .90);
}

body[data-theme="aurora"] .contact-profile-hero {
  border-color: #dfe7f4;
  background:
    radial-gradient(240px 160px at 50% 4%, rgba(79, 140, 255, .18), transparent 72%),
    linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%);
}

body[data-theme="aurora"] .contact-profile-kicker,
body[data-theme="aurora"] .contact-info-grid small {
  color: #8190ad;
}

body[data-theme="aurora"] .contact-info-grid > span,
body[data-theme="aurora"] .contact-info-grid > span:nth-child(2n),
body[data-theme="aurora"] .contact-info-grid > span:nth-last-child(-n + 2),
body[data-theme="aurora"] .contact-profile-card .user-action-panel {
  border-color: #e1e7f0;
  background: #fff;
}

body[data-theme="aurora"] .contact-profile-card .user-action {
  border-color: #e0e6f0;
  background: #f8faff;
}

body[data-theme="aurora"] .contact-profile-card .user-action.is-main {
  background: linear-gradient(135deg, #4f8cff, #7567ff);
}

body[data-theme="midnight"] .contact-profile-card {
  border-color: rgba(148, 163, 184, .16);
  background:
    radial-gradient(420px 280px at 8% 6%, rgba(91, 157, 255, .12), transparent 70%),
    linear-gradient(180deg, rgba(17, 24, 39, .97), rgba(10, 15, 27, .98));
  box-shadow:
    0 28px 72px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

body[data-theme="midnight"] .contact-profile-hero,
body[data-theme="midnight"] .contact-info-grid > span,
body[data-theme="midnight"] .contact-info-grid > span:nth-child(2n),
body[data-theme="midnight"] .contact-info-grid > span:nth-last-child(-n + 2),
body[data-theme="midnight"] .contact-profile-card .user-action-panel {
  border-color: rgba(148, 163, 184, .13);
  background: rgba(255, 255, 255, .035);
}

body[data-theme="midnight"] .contact-profile-card .user-action {
  border-color: rgba(148, 163, 184, .12);
  background: rgba(255, 255, 255, .045);
}

@media (max-width: 1180px) {
  .contact-profile-card {
    grid-template-columns: 1fr;
  }

  .contact-profile-hero{min-height:auto;grid-template-columns:auto minmax(0,1fr);justify-items:start;text-align:left}
  .contact-profile-copy{justify-items:start}
  .contact-profile-chips{justify-content:flex-start}
}

@media (max-width: 760px) {
  .contact-profile-card{padding:14px;border-radius:22px}
  .contact-profile-hero{grid-template-columns:1fr;justify-items:center;text-align:center}
  .contact-profile-copy{justify-items:center}
  .contact-profile-chips{justify-content:center}

  .contact-info-grid,
  .contact-profile-card .user-action-grid.is-contact-actions,
  .contact-profile-card .user-action-grid.is-primary,
  .contact-profile-card .user-action-grid.is-secondary {
    grid-template-columns: 1fr;
  }

  .contact-section-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

.composer-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.composer-tool.is-unavailable,
.composer-tool.is-disabled,
.composer-tool:disabled {
  color: var(--ink-3);
  opacity: .42;
  cursor: not-allowed;
}

.composer-tool.is-unavailable:hover,
.composer-tool.is-disabled:hover,
.composer-tool:disabled:hover {
  color: var(--ink-3);
  background: transparent;
  transform: none;
}

.composer-tool.is-pending::after,
.composer-tool.is-unavailable::after,
.tool-button.is-pending::after {
  display: none;
  content: none;
}

.attachment-thumb {
  width: 42px;
  min-width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.modal-preview.is-image-preview {
  padding: 14px;
  border-style: solid;
}

.modal-preview.is-original-preview img {
  max-width: min(78vw, 960px);
  max-height: 68vh;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(var(--media-zoom, 1));
  transform-origin: center;
}

.modal-preview.is-video-preview video {
  width: min(78vw, 860px);
  max-height: 62vh;
  display: block;
  border-radius: 12px;
  background: #000;
}

.modal-preview.is-document-preview {
  width: min(82vw, 920px);
  height: min(68vh, 720px);
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #101522;
}

.modal-preview.is-document-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.modal-preview.is-audio-preview {
  width: min(520px, 82vw);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px;
}

.modal-preview.is-audio-preview audio {
  width: 100%;
}

.media-viewer-layer {
  background: rgba(4, 7, 14, .82);
  backdrop-filter: blur(14px);
}

.media-viewer-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(11, 15, 26, .76);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .38);
  color: #fff;
}

.media-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-viewer-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.media-viewer-head strong {
  font-size: 13px;
}

.media-viewer-head span {
  max-width: min(560px, 58vw);
  overflow: hidden;
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-close,
.media-viewer-tools button,
.media-viewer-nav {
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.media-viewer-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.media-viewer-stage {
  position: relative;
  min-height: min(62vh, 560px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    #050812;
  background-size: 18px 18px;
}

.media-viewer-frame {
  max-width: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
}

.media-viewer-frame img {
  max-width: min(92vw, 980px);
  max-height: 70vh;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(var(--media-zoom, 1));
  transform-origin: center;
}

.user-avatar-preview-modal {
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  padding-top: max(14px, env(safe-area-inset-top));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  padding-left: max(14px, env(safe-area-inset-left));
}

.user-avatar-preview-stage {
  min-height: min(68vh, 680px);
}

.user-avatar-preview-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: min(68vh, 680px);
}

.user-avatar-preview-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.user-avatar-preview-frame img:not(.is-avatar-broken) + .user-avatar-preview-fallback {
  display: none;
}

.user-avatar-preview-fallback {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
}

.media-viewer-frame video {
  width: min(92vw, 960px);
  max-height: 70vh;
  display: block;
  border-radius: 12px;
  background: #000;
}

.media-viewer-placeholder {
  min-width: min(420px, 72vw);
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 14px;
  color: rgba(255, 255, 255, .72);
}

.media-viewer-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
}

.media-viewer-nav svg {
  width: 24px;
  height: 24px;
}

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

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

.media-viewer-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.media-viewer-tools button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .media-viewer-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 10px;
    border-radius: 14px;
  }

  .media-viewer-stage {
    min-height: 54vh;
  }

  .media-viewer-nav {
    width: 38px;
    height: 38px;
  }

  .user-avatar-preview-stage,
  .user-avatar-preview-frame {
    min-height: 58vh;
  }
}

.file-transfer-progress.is-modal {
  width: min(420px, 72vw);
}

.composer-transfer-list {
  display: grid;
  gap: 8px;
  padding: 8px 12px 0;
}

.composer-transfer-item {
  display: grid;
  grid-template-columns: minmax(96px, 160px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.composer-transfer-item strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-transfer-item.is-failed .file-transfer-progress i {
  width: 100% !important;
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

.composer-transfer-item.is-failed {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 44%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger), var(--surface) 90%);
}

.composer-transfer-item.is-failed strong {
  line-height: 26px;
}

.composer-transfer-item.is-failed .file-transfer-progress {
  grid-column: 1 / -1;
  height: auto;
  min-height: 30px;
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--danger), transparent 72%);
  background: color-mix(in srgb, var(--surface), var(--danger) 9%);
}

.composer-transfer-item.is-failed .file-transfer-progress em {
  padding: 6px 10px;
  color: color-mix(in srgb, var(--danger), var(--ink) 28%);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.45;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.file-transfer-actions {
  display: inline-flex;
  gap: 6px;
}

.file-transfer-actions button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
}

.attachment-confirm-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 8px 16px 4px;
}

.attachment-confirm-body.is-multiple {
  gap: 12px;
}

.attachment-confirm-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-confirm-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.attachment-confirm-list {
  max-height: min(48vh, 420px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.attachment-confirm-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 22%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 45%);
}

.attachment-confirm-row-preview {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.attachment-confirm-row-preview img,
.attachment-confirm-row-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.attachment-confirm-row .attachment-confirm-placeholder {
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  font-size: 12px;
}

.attachment-confirm-row .attachment-confirm-meta {
  padding: 0;
}

.attachment-confirm-preview {
  position: relative;
  min-height: 280px;
  max-height: min(52vh, 480px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 12%);
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft), transparent 8%), color-mix(in srgb, var(--surface), transparent 2%)),
    var(--surface-soft);
}

.attachment-confirm-preview img,
.attachment-confirm-preview video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 480px);
  display: block;
  object-fit: contain;
}

.attachment-confirm-preview.is-image img {
  width: 100%;
  height: 100%;
}

.attachment-confirm-preview.is-video video {
  object-fit: contain;
  background: #050914;
}

.attachment-confirm-placeholder {
  min-width: 72px;
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: var(--brand);
  background: color-mix(in srgb, var(--primary), transparent 82%);
  font-weight: 800;
}

.attachment-confirm-placeholder svg {
  width: 32px;
  height: 32px;
}

.attachment-confirm-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.attachment-confirm-meta span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.attachment-confirm-meta strong {
  min-width: min(220px, 100%);
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-confirm-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: color-mix(in srgb, var(--muted), transparent 35%);
}

.attachment-confirm-modal footer {
  padding: 16px 18px 16px;
}

.chat-workspace.is-dragging-attachment .message-scroll {
  outline: 2px dashed color-mix(in srgb, var(--primary), transparent 28%);
  outline-offset: -14px;
  background: color-mix(in srgb, var(--primary), transparent 94%);
}

@media (max-width: 720px) {
  .attachment-confirm-body {
    padding: 8px 10px 4px;
  }

  .attachment-confirm-preview {
    min-height: 210px;
    max-height: 42vh;
  }

  .composer-transfer-item {
    grid-template-columns: 1fr;
  }
}

.modal-preview.is-image-preview img {
  width: min(100%, 620px);
  max-height: 420px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--surface-soft);
}

.bubble.is-contact-card-bubble,
.message-row.is-me .bubble.is-contact-card-bubble {
  width: min(336px, 100%);
  max-width: min(336px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.contact-card-attachment {
  width: 100%;
  min-width: min(286px, 100%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 18%);
  border-radius: 18px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface-soft), var(--primary) 8%),
      color-mix(in srgb, var(--surface), var(--primary) 4%));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.contact-card-attachment:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface-soft), var(--primary) 14%),
      color-mix(in srgb, var(--surface), var(--primary) 8%));
}

.contact-card-attachment .avatar,
.contact-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

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

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

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

.contact-card-attachment strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
}

.contact-card-attachment em {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft), transparent 12%);
  color: var(--brand);
  font-size: 11px;
  line-height: 1.4;
  font-style: normal;
  font-weight: 760;
}

.contact-card-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft), transparent 20%);
  font-size: 20px;
  line-height: 1;
}

.contact-card-modal {
  width: min(480px, calc(100vw - 28px));
}

.contact-card-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 14px 16px 10px;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink-3);
}

.contact-card-search svg {
  width: 18px;
  height: 18px;
}

.contact-card-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.contact-card-picker {
  max-height: min(420px, 56vh);
  overflow: auto;
  padding: 0 10px 14px;
}

.contact-card-option {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  border-radius: 14px;
}

.contact-card-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.forward-modal {
  width: min(500px, calc(100vw - 28px));
}

.forward-source {
  margin: 14px 16px 0;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), var(--accent) 6%);
}

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

.forward-source strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forward-target-search {
  margin-top: 10px;
}

.forward-target-list {
  max-height: min(420px, 48vh);
}

.forward-modal-error {
  margin: 0 16px 8px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.message-report-modal {
  width: min(520px, calc(100vw - 28px));
}

.message-report-sender {
  margin: 14px 16px 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.message-report-sender span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

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

.message-report-sender small {
  color: var(--muted);
  font-size: 12px;
}

.message-report-source strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.message-report-form {
  padding: 12px 16px 0;
  display: grid;
  gap: 12px;
}

.message-report-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.message-report-reasons button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  background: var(--surface-soft);
}

.message-report-reasons button.is-active {
  border-color: color-mix(in srgb, var(--danger), transparent 35%);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 90%);
}

.message-report-description {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.message-report-description textarea {
  min-height: 104px;
  resize: vertical;
  border-radius: 12px;
}

.tool-card.is-disabled {
  opacity: .58;
}

.tool-card button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

body[data-theme="aurora"] .composer-tool.is-unavailable,
body[data-theme="aurora"] .composer-tool.is-disabled,
body[data-theme="aurora"] .composer-tool:disabled {
  color: #9aa7bd;
  opacity: .55;
}

body[data-theme="aurora"] .attachment-thumb,
body[data-theme="aurora"] .contact-card-search {
  border-color: rgba(20, 30, 55, .1);
  background: #f7f9fd;
}

body[data-theme="aurora"] .bubble.is-contact-card-bubble {
  background: transparent;
  box-shadow: none;
}

body[data-theme="aurora"] .contact-card-attachment {
  border-color: rgba(85, 126, 214, .24);
  background: linear-gradient(135deg, #ffffff, #f5f8ff);
}

body[data-theme="aurora"] .contact-card-attachment:hover {
  border-color: rgba(73, 117, 238, .44);
  background: linear-gradient(135deg, #f7faff, #eef4ff);
}

body[data-theme="aurora"] .contact-card-arrow {
  background: rgba(87, 124, 235, .08);
  color: #64708a;
}

.signed-out-workspace {
  min-width: 0;
}

.signed-out-main {
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(520px 320px at 50% 16%, color-mix(in srgb, var(--primary), transparent 84%), transparent 70%),
    var(--bg);
}

.signed-out-card {
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface), transparent 3%);
  box-shadow: var(--shadow);
  text-align: center;
}

.signed-out-card-icon,
.signed-out-mini-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
}

.signed-out-card-icon {
  width: 62px;
  height: 62px;
}

.signed-out-card-icon svg {
  width: 30px;
  height: 30px;
}

.signed-out-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.signed-out-card h2,
.signed-out-side-body h2 {
  margin: 0;
  color: var(--ink);
}

.signed-out-card p,
.signed-out-side-body p,
.signed-out-modal-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.signed-out-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.signed-out-actions button,
.signed-out-side-body button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 760;
}

.signed-out-facts {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.signed-out-facts span {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.signed-out-facts b,
.signed-out-facts em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.signed-out-facts b {
  color: var(--ink);
  font-size: 12px;
}

.signed-out-facts em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.signed-out-side-panel {
  padding: 14px;
  gap: 14px;
}

.signed-out-summary,
.signed-out-side-body {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.signed-out-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.signed-out-summary small,
.signed-out-summary p {
  display: block;
  margin: 0;
  color: var(--muted);
}

.signed-out-summary strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
}

.signed-out-avatar {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #58c4ff);
  color: #fff;
  font-weight: 900;
}

.signed-out-side-body {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 18px;
}

.signed-out-mini-icon {
  width: 44px;
  height: 44px;
}

.signed-out-mini-icon svg {
  width: 22px;
  height: 22px;
}

.signed-out-side-body .primary-button {
  width: 100%;
}

.signed-out-side-body button:not(.primary-button) {
  width: 100%;
}

.account-profile-card.is-signed-out {
  border-color: color-mix(in srgb, var(--warning, #f59e0b), var(--line) 58%);
  background: color-mix(in srgb, var(--warning, #f59e0b), transparent 92%);
}

.signed-out-modal-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.signed-out-modal-note span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

.signed-out-modal-note svg {
  width: 20px;
  height: 20px;
}

body[data-theme="midnight"] .signed-out-card,
body[data-theme="midnight"] .signed-out-summary,
body[data-theme="midnight"] .signed-out-side-body,
body[data-theme="midnight"] .signed-out-modal-note {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(148, 163, 184, .14);
}

body[data-theme="midnight"] .signed-out-facts span {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(148, 163, 184, .12);
}

body[data-theme="aurora"] .signed-out-card,
body[data-theme="aurora"] .signed-out-summary,
body[data-theme="aurora"] .signed-out-side-body,
body[data-theme="aurora"] .signed-out-modal-note {
  border-color: rgba(20, 30, 55, .1);
  background: #ffffff;
}

body[data-theme="aurora"] .signed-out-facts span {
  border-color: rgba(20, 30, 55, .08);
  background: #f7f9fd;
}

.login-screen {
  position: relative;
  isolation: isolate;
  overflow: auto;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background: linear-gradient(35deg, #e3f2fd 0%, #90caf9 48%, #64b5f6 100%);
  color: var(--ink);
  perspective: 1200px;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(760px 480px at 22% 8%, rgba(255, 255, 255, .54), transparent 68%),
    radial-gradient(860px 560px at 92% 18%, rgba(2, 119, 189, .2), transparent 70%),
    radial-gradient(640px 420px at 70% 94%, rgba(3, 155, 229, .18), transparent 70%);
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 520px at 76% 0%, transparent 0%, rgba(227, 242, 253, .62) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(227, 242, 253, .7));
}

.login-particles {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .88;
}

.login-card { position: relative; z-index: 1; width: min(440px, 100%); display: grid; gap: 20px; padding: 26px; border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--surface), transparent 3%); transform: translateZ(0); transition: border-color 180ms cubic-bezier(.16, 1, .3, 1), background-color 180ms cubic-bezier(.16, 1, .3, 1); }

.login-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: .64;
  background:
    radial-gradient(360px 180px at 14% 0%, rgba(255, 255, 255, .34), transparent 66%),
    linear-gradient(135deg, rgba(255, 255, 255, .15), transparent 44%);
  transform: translateZ(1px);
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-card-title {
  display: grid;
  gap: 7px;
}

.login-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-card-title small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.login-card-title h1 {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-title-row .theme-quick-toggle {
  flex: 0 0 auto;
}

.login-card-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-page-form {
  gap: 14px;
}

.login-auth-tabs { display: flex; gap: 8px; }
.login-auth-tabs button { flex: 1; }
.login-auth-tabs button.is-active { color: var(--primary); }

.login-policy-note {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 66%);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--primary), transparent 92%);
  font-size: 13px;
  line-height: 1.45;
}

.login-policy-note.is-error {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.login-submit { width: 100%; min-height: 48px; height: 48px; border-radius: 16px; font-size: 15px; font-weight: 760; display: inline-flex; align-items: center; justify-content: center; line-height: 1; margin-top: 12px; transform: none; transition: background .16s var(--ease-out), border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), filter .16s var(--ease-out), opacity .16s var(--ease-out); }

.login-submit:hover,
.login-submit:focus-visible { background: var(--grad); color: #fff; transform: none; filter: brightness(1.03); box-shadow: 0 12px 26px rgba(79, 140, 255, .3); }

.login-submit:active { opacity: .92; transform: none; filter: brightness(.98); }

.login-source-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

body[data-theme="midnight"] .login-card {
  background: rgba(4, 13, 31, .78);
  border-color: rgba(0, 217, 255, .16);
}

body[data-theme="midnight"] .login-card::before {
  opacity: .5;
  background:
    radial-gradient(360px 180px at 16% 0%, rgba(0, 245, 255, .16), transparent 66%),
    linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 42%);
}

body[data-theme="midnight"] .login-screen {
  background: linear-gradient(35deg, #000814 0%, #003566 52%, #0077b6 100%);
}

body[data-theme="midnight"] .login-screen::before {
  background:
    radial-gradient(720px 440px at 18% 14%, rgba(0, 245, 255, .18), transparent 68%),
    radial-gradient(860px 560px at 88% 20%, rgba(0, 150, 199, .3), transparent 70%),
    radial-gradient(640px 420px at 68% 96%, rgba(96, 165, 250, .2), transparent 72%);
}

body[data-theme="midnight"] .login-screen::after {
  background:
    radial-gradient(760px 520px at 78% 0%, transparent 0%, rgba(0, 8, 20, .52) 72%),
    linear-gradient(180deg, rgba(0, 8, 20, .1), rgba(0, 8, 20, .72));
}

body[data-theme="midnight"] .login-particles {
  opacity: .96;
}

body[data-theme="aurora"] .login-card {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(20, 30, 55, .1);
}

body[data-theme="aurora"] .login-card::before {
  opacity: .58;
  background:
    radial-gradient(360px 180px at 14% 0%, rgba(255, 255, 255, .46), transparent 68%),
    linear-gradient(135deg, rgba(255, 255, 255, .2), transparent 44%);
}

body[data-theme="aurora"] .login-screen {
  background: linear-gradient(35deg, #e3f2fd 0%, #90caf9 48%, #64b5f6 100%);
}

body[data-theme="aurora"] .login-screen::after {
  background:
    radial-gradient(760px 520px at 78% 0%, transparent 0%, rgba(227, 242, 253, .66) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(227, 242, 253, .72));
}

body[data-theme="aurora"] .login-particles {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .login-particles {
    opacity: .62;
  }

  .login-card {
    transform: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .login-screen {
    align-items: start;
    padding: 16px;
  }

  .login-card {
    padding: 20px;
    border-radius: 22px;
  }

  .signed-out-main {
    align-items: start;
    padding: 16px;
  }

  .signed-out-card {
    border-radius: 20px;
  }

  .signed-out-facts {
    grid-template-columns: 1fr;
  }

  .signed-out-actions {
    width: 100%;
  }

  .signed-out-actions button {
    flex: 1 1 100%;
  }
}

.composer-tool.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 58%);
}

.message-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  left: 16px;
  z-index: 130;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.message-search-bar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.message-search-input-control {
  min-width: 0;
  flex: 1 1 260px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink-2);
}

.message-search-input-control:focus-within {
  border-color: color-mix(in srgb, var(--primary), var(--line) 24%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 78%);
}

.message-search-bar svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.message-search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.message-search-bar input::placeholder {
  color: var(--ink-3);
}

.message-search-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-search-date-row {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 4px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 18%);
}

.message-search-date-shell {
  position: relative;
  min-width: 0;
}

.message-search-date-control {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  appearance: none;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), #fff 4%), var(--surface-soft));
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.message-search-date-control:hover,
.message-search-date-control:focus-within {
  border-color: color-mix(in srgb, var(--primary), var(--line) 26%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 76%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 82%);
}

.message-search-date-control.is-filled {
  border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 56%), var(--surface-soft));
}

.message-search-date-icon,
.message-search-date-caret {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-soft), transparent 18%);
  color: var(--primary);
}

.message-search-date-caret {
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--ink-3);
}

.message-search-date-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.message-search-date-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-search-date-copy span {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-search-date-native {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.message-search-date-native::-webkit-calendar-picker-indicator {
  opacity: 0;
}

.message-search-date-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.message-search-date-actions::-webkit-scrollbar {
  display: none;
}

.message-search-date-chip,
.message-search-date-jump,
.message-search-date-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.message-search-date-chip {
  cursor: pointer;
}

.message-search-date-chip:hover,
.message-search-date-chip:focus-visible,
.message-search-date-chip.is-active {
  border-color: color-mix(in srgb, var(--primary), var(--line) 32%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%);
  color: var(--primary);
}

.message-search-date-chip.is-clear {
  color: var(--ink-3);
}

.message-search-date-chip.is-clear svg {
  width: 13px;
  height: 13px;
}

.message-search-date-jump {
  border-color: color-mix(in srgb, var(--primary), var(--line) 26%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 90%), color-mix(in srgb, var(--primary-soft), var(--surface) 56%));
  color: var(--primary);
  cursor: pointer;
}

.message-search-date-jump:hover,
.message-search-date-jump:focus-visible {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary), transparent 86%);
}

.message-search-date-status {
  border-style: dashed;
  color: var(--ink-3);
}

.message-search-list {
  max-height: min(268px, 34vh);
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.message-search-result {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.message-search-result:hover,
.message-search-result:focus-visible {
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 68%);
}

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

.message-search-copy em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
}

.message-search-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-search-copy mark {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, #ff5d6c, transparent 84%);
  color: #ff4d61;
}

.message-search-result time {
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.message-search-empty,
.message-search-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink-3);
  font-size: 12px;
}

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

.message-search-note {
  border-color: color-mix(in srgb, var(--warn), var(--line) 58%);
  color: var(--warn);
}

.global-search-results {
  display: grid;
  gap: 12px;
  padding: 10px;
}

.global-search-head,
.global-search-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.global-search-head span,
.global-search-section-head span,
.global-search-category-empty,
.global-search-note {
  color: var(--ink-3);
  font-size: 12px;
}

.global-search-note,
.global-search-empty,
.global-search-category-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.global-search-note.is-error {
  border-color: color-mix(in srgb, var(--danger), var(--line) 58%);
  color: var(--danger);
}

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

.global-search-list {
  display: grid;
  gap: 6px;
}

.global-search-result {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus-visible {
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 68%);
}

.global-search-kind {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary), transparent 82%);
  color: var(--primary);
  font-size: 12px;
  font-weight: 760;
}

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

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

.global-search-copy small mark {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, #ff5d6c, transparent 84%);
  color: #ff4d61;
}

body:not([data-theme="aurora"]) .message-search-panel {
  border-color: rgba(203, 213, 225, .16);
  background: #101624;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .42);
}

body:not([data-theme="aurora"]) .message-search-date-row {
  background: #141c2b;
}

body:not([data-theme="aurora"]) .message-search-input-control,
body:not([data-theme="aurora"]) .message-search-date-control,
body:not([data-theme="aurora"]) .message-search-date-chip,
body:not([data-theme="aurora"]) .message-search-date-status,
body:not([data-theme="aurora"]) .message-search-date-jump,
body:not([data-theme="aurora"]) .message-search-result,
body:not([data-theme="aurora"]) .message-search-empty,
body:not([data-theme="aurora"]) .message-search-note {
  border-color: rgba(203, 213, 225, .14);
  background: #182132;
}

body:not([data-theme="aurora"]) .message-search-date-control:hover,
body:not([data-theme="aurora"]) .message-search-date-control:focus-within {
  background: #1c2940;
}

body[data-theme="aurora"] .message-search-panel {
  background: #fff;
}

body[data-theme="aurora"] .composer-tool.is-active {
  color: #2f63ff;
  background: #eaf1ff;
  box-shadow: inset 0 0 0 1px #b9c9ff;
}

body[data-theme="aurora"] .message-search-input-control,
body[data-theme="aurora"] .message-search-date-control,
body[data-theme="aurora"] .message-search-date-chip,
body[data-theme="aurora"] .message-search-date-status,
body[data-theme="aurora"] .message-search-result,
body[data-theme="aurora"] .message-search-empty,
body[data-theme="aurora"] .message-search-note,
body[data-theme="aurora"] .global-search-result,
body[data-theme="aurora"] .global-search-note,
body[data-theme="aurora"] .global-search-empty,
body[data-theme="aurora"] .global-search-category-empty {
  border-color: #dbe3ef;
  background: #f7f9fc;
}

body[data-theme="aurora"] .message-search-copy mark,
body[data-theme="aurora"] .global-search-copy mark {
  background: #ffe8ec;
  color: #e53e52;
}

@media (max-width: 720px) {
  .message-search-panel {
    padding: 10px;
  }

  .message-search-bar {
    gap: 8px;
  }

  .message-search-input-control {
    flex-basis: calc(100% - 128px);
    height: 38px;
  }

  .message-search-nav {
    gap: 6px;
  }

  .message-search-date-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .message-search-date-control {
    height: 42px;
  }

  .message-search-date-actions {
    padding-bottom: 1px;
  }

  .message-search-list {
    max-height: 220px;
  }

  .message-search-result {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .message-search-result time {
    justify-self: end;
  }
}

.composer-shell > input.composer-file-input,
input.composer-file-input[type="file"] {
  display: none !important;
  position: absolute !important;
  inset: auto auto 0 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

.context-panel .detail-actions.two,
.context-panel .user-action-grid.is-profile-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-profile-primary,
.context-panel .user-action-grid.is-profile-danger {
  grid-template-columns: minmax(0, 1fr) !important;
}

.context-panel .user-action-panel {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.context-panel .user-action-grid {
  gap: 10px;
  min-width: 0;
}

.context-panel .user-action-grid.is-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-primary .user-action.is-main {
  grid-column: 1 / -1;
}

.context-panel .user-action-grid.is-contact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-contact-actions .user-action.is-main,
.context-panel .user-action-grid.is-contact-actions .user-action[data-action="delete-friend"] {
  grid-column: 1 / -1;
}

.context-panel .user-action-grid.is-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-secondary .user-action.is-danger,
.context-panel .user-action-grid.is-secondary .user-action.is-warning {
  grid-column: 1 / -1;
}

.context-panel .detail-actions.two button,
.context-panel .user-action-grid.is-profile-primary .user-action,
.context-panel .user-action-grid.is-profile-secondary .user-action,
.context-panel .user-action-grid.is-profile-danger .user-action,
.context-panel .user-action-grid.is-primary .user-action,
.context-panel .user-action-grid.is-contact-actions .user-action,
.context-panel .user-action-grid.is-secondary .user-action {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
  color: var(--ink);
  box-shadow: none;
  overflow: hidden;
}

.context-panel .user-action-grid.is-primary .user-action:not(.is-main),
.context-panel .user-action-grid.is-contact-actions .user-action:not(.is-main),
.context-panel .user-action-grid.is-profile-secondary .user-action,
.context-panel .user-action-grid.is-profile-danger .user-action,
.context-panel .user-action-grid.is-secondary .user-action {
  font-weight: 700;
}

.context-panel .user-action-grid.is-primary .user-action:not(.is-main):hover,
.context-panel .user-action-grid.is-contact-actions .user-action:not(.is-main):hover,
.context-panel .user-action-grid.is-profile-secondary .user-action:hover,
.context-panel .user-action-grid.is-profile-danger .user-action:hover,
.context-panel .user-action-grid.is-secondary .user-action:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 50%);
  color: var(--primary);
}

.context-panel .user-action-grid.is-secondary .user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 93%);
  color: var(--danger);
}

.context-panel .user-action-grid.is-contact-actions .user-action.is-danger,
.context-panel .user-action-grid.is-profile-secondary .user-action.is-danger,
.context-panel .user-action-grid.is-profile-danger .user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 93%);
  color: var(--danger);
}

.context-panel .user-action-grid.is-secondary .user-action.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), transparent 40%);
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
}

.context-panel .user-action-grid.is-contact-actions .user-action.is-danger:hover,
.context-panel .user-action-grid.is-profile-secondary .user-action.is-danger:hover,
.context-panel .user-action-grid.is-profile-danger .user-action.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), transparent 40%);
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
}

.context-panel .user-action-grid .user-action span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-panel .detail-actions .detail-file-button {
  border: 1.5px solid color-mix(in srgb, var(--primary), var(--line) 22%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft), var(--surface) 54%), color-mix(in srgb, var(--surface), var(--primary-soft) 18%)) !important;
  color: var(--primary) !important;
  font-weight: 720;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff, transparent 88%),
    0 10px 22px color-mix(in srgb, var(--primary), transparent 90%);
}

.context-panel .detail-actions .detail-file-button svg {
  width: 16px;
  height: 16px;
  color: currentColor !important;
  stroke-width: 2.2;
}

.context-panel .detail-actions .detail-file-button:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 18%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft), var(--surface) 18%), color-mix(in srgb, var(--surface), var(--primary-soft) 40%)) !important;
  transform: translateY(-1px);
}

body[data-theme="aurora"] .context-panel .detail-actions .detail-file-button {
  border: 1.5px solid #83a6ff !important;
  background: linear-gradient(180deg, #ffffff, #edf3ff) !important;
  color: #1f55d6 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .78),
    0 10px 22px rgba(77, 119, 255, .16);
}

body[data-theme="aurora"] .context-kind-group .context-overview .detail-actions .detail-file-button,
body[data-theme="teal"] .context-kind-group .context-overview .detail-actions .detail-file-button,
body[data-theme="graphite"] .context-kind-group .context-overview .detail-actions .detail-file-button {
  border: 1.5px solid #83a6ff !important;
  color: #1f55d6 !important;
}

body[data-theme="midnight"] .context-panel .detail-actions .detail-file-button {
  border: 1px solid rgba(126, 157, 216, .42) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .028)) !important;
  color: #dbe7ff !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .035),
    0 10px 22px rgba(0, 0, 0, .16);
}

body[data-theme="midnight"] .context-panel .detail-actions .detail-file-button svg {
  color: #7bc5ff !important;
}

body[data-theme="midnight"] .context-panel .detail-actions .detail-file-button:hover {
  border-color: rgba(123, 197, 255, .62) !important;
  background:
    linear-gradient(180deg, rgba(91, 157, 255, .16), rgba(255, 255, 255, .04)) !important;
}

/* Canonical visual contract for ordinary profile actions. Renderers opt in via
   one semantic attribute; primary, danger and warning actions are ineligible. */
[data-profile-secondary-action] {
  --profile-secondary-background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary), transparent 92%), color-mix(in srgb, var(--primary), transparent 96%)),
    color-mix(in srgb, var(--surface), var(--primary-soft) 16%);
  --profile-secondary-border: color-mix(in srgb, var(--primary), var(--line) 18%);
  --profile-secondary-color: var(--primary);
  --profile-secondary-hover-background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary), transparent 88%), color-mix(in srgb, var(--primary), transparent 94%)),
    color-mix(in srgb, var(--surface), var(--primary-soft) 22%);
  --profile-secondary-hover-border: color-mix(in srgb, var(--primary), transparent 26%);
  --profile-secondary-hover-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff, transparent 72%),
    0 10px 24px color-mix(in srgb, var(--primary), transparent 88%);
}

:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) {
  min-height: 44px;
  border: 1.5px solid var(--profile-secondary-border);
  border-radius: 13px;
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  font-weight: 760;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff, transparent 76%);
}

:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--profile-secondary-hover-border);
  background: var(--profile-secondary-hover-background);
  color: var(--profile-secondary-color);
  transform: translateY(-1px);
  box-shadow: var(--profile-secondary-hover-shadow);
}

:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):active:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--profile-secondary-hover-border);
  background: var(--profile-secondary-hover-background);
  color: var(--profile-secondary-color);
  opacity: .92;
  transform: translateY(1px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff, transparent 78%);
}

:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):focus-visible {
  border-color: var(--profile-secondary-hover-border);
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 68%);
  outline-offset: 2px;
}

:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):disabled,
:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning)[aria-disabled="true"] {
  border-color: var(--profile-secondary-border);
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  opacity: .48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

:is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) svg {
  width: 16px;
  height: 16px;
  color: currentColor;
  stroke-width: 2.1;
}

.edit-profile-actions .primary-button {
  border: 0 !important;
  background: var(--grad) !important;
  color: #fff !important;
  font-weight: 760;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary), transparent 80%);
}

.edit-profile-actions .primary-button:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary), transparent 74%);
}

.drawer-card.drawer-profile {
  width: min(430px, calc(100vw - 28px));
}

.drawer-card.drawer-profile .drawer-body {
  padding: 16px 18px 22px;
}

.drawer-user-profile {
  display: grid;
  gap: 16px;
}

.drawer-profile-hero,
.drawer-profile-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.drawer-profile-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 14px 16px;
  overflow: hidden;
  text-align: center;
}

.drawer-profile-cover {
  width: calc(100% + 28px);
  height: 108px;
  display: block;
  margin: 0 -14px -38px;
  background:
    radial-gradient(180px 96px at 12% 18%, rgba(255, 255, 255, .24), transparent 66%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #8bd8ff 12%), color-mix(in srgb, var(--primary), #8b62ff 18%));
}

.drawer-profile-hero .avatar-xl {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border: 4px solid var(--surface);
  border-radius: 22px;
  font-size: 27px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary), transparent 74%);
}

.drawer-profile-hero h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.2;
}

.drawer-profile-hero p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
}

.drawer-profile-hero .user-action-panel {
  margin-top: 8px;
}

.drawer-user-profile .user-action-grid.is-profile-primary,
.drawer-user-profile .user-action-grid.is-profile-danger {
  grid-template-columns: minmax(0, 1fr);
}

.drawer-user-profile .user-action-grid.is-profile-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-user-profile .user-action-grid.is-profile-primary .user-action,
.drawer-user-profile .user-action-grid.is-profile-secondary .user-action,
.drawer-user-profile .user-action-grid.is-profile-danger .user-action {
  width: 100%;
  min-height: 44px;
  height: 44px;
  border-radius: 13px;
}

.drawer-profile-card {
  display: grid;
  gap: 0;
  padding: 0 14px;
}

.drawer-profile-card .detail-card-head {
  padding: 14px 0 11px;
}

.drawer-profile-card .detail-kv {
  padding: 12px 0;
}

.drawer-profile-card .context-file-list {
  padding: 0 0 14px;
}

.drawer-profile-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 0 14px;
}

.drawer-profile-secondary-actions .user-action {
  width: 100%;
  min-height: 42px;
}

body[data-theme="aurora"] [data-profile-secondary-action] {
  --profile-secondary-background: linear-gradient(180deg, #f6f9ff, #edf3ff);
  --profile-secondary-border: #95b6ff;
  --profile-secondary-color: #1859d9;
  --profile-secondary-hover-background: linear-gradient(180deg, #eef4ff, #e4ecff);
  --profile-secondary-hover-border: #6b99ff;
  --profile-secondary-hover-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .82),
    0 10px 22px rgba(66, 118, 255, .14);
}

body[data-theme="aurora"] .drawer-profile-hero,
body[data-theme="aurora"] .drawer-profile-card {
  border-color: #dfe7f1;
  background: #fff;
}

body[data-theme="midnight"] .drawer-profile-hero,
body[data-theme="midnight"] .drawer-profile-card {
  border-color: rgba(148, 163, 184, .15);
  background: rgba(255, 255, 255, .035);
}

body[data-theme="midnight"] [data-profile-secondary-action] {
  --profile-secondary-background:
    linear-gradient(180deg, rgba(83, 125, 255, .16), rgba(83, 125, 255, .07)),
    rgba(17, 26, 45, .76);
  --profile-secondary-border: rgba(106, 154, 255, .56);
  --profile-secondary-color: #8bb6ff;
  --profile-secondary-hover-background:
    linear-gradient(180deg, rgba(99, 149, 255, .22), rgba(99, 149, 255, .1)),
    rgba(20, 31, 54, .9);
  --profile-secondary-hover-border: rgba(132, 180, 255, .78);
  --profile-secondary-hover-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .06),
    0 10px 24px rgba(64, 116, 255, .12);
}

@media (forced-colors: active) {
  :is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  :is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):hover:not(:disabled):not([aria-disabled="true"]),
  :is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):active:not(:disabled):not([aria-disabled="true"]) {
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
    box-shadow: none;
  }

  :is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):focus-visible {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  :is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):disabled,
  :is(button[data-profile-secondary-action]):not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning)[aria-disabled="true"] {
    border-color: GrayText;
    background: ButtonFace;
    color: GrayText;
  }
}

.behavior-authority-timeline {
  min-height: 320px;
}

.behavior-authority-event-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.behavior-authority-event {
  display: grid;
  grid-template-columns: 58px 12px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px 0;
}

.behavior-authority-event:not(:last-child) .behavior-authority-event-dot::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -22px;
  left: 4px;
  width: 2px;
  background: color-mix(in srgb, var(--primary), transparent 78%);
}

.behavior-authority-event time {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 18px;
}

.behavior-authority-event-dot {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary), transparent 48%);
}

.behavior-authority-event > div {
  min-width: 0;
}

.behavior-authority-event strong,
.behavior-authority-event p,
.behavior-authority-event small {
  overflow-wrap: anywhere;
}

.behavior-authority-event strong {
  color: var(--ink);
  font-size: 13px;
}

.behavior-authority-event p {
  margin: 3px 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.behavior-authority-event small {
  color: var(--ink-3);
}

@media (max-width: 680px) {
  .behavior-authority-event {
    grid-template-columns: 58px 10px minmax(0, 1fr);
    gap: 8px;
  }
}

.context-panel .user-action.is-main,
.drawer-user-profile .user-action.is-main,
.contact-profile-card .user-action.is-main,
.contact-profile-workspace .user-action.is-main {
  border: 1px solid color-mix(in srgb, var(--primary), #ffffff 16%) !important;
  background:
    radial-gradient(120px 80px at 18% 8%, rgba(255, 255, 255, .24), transparent 62%),
    linear-gradient(135deg, #5c8cff 0%, #7567ff 100%) !important;
  color: #fff !important;
  box-shadow:
    0 15px 34px rgba(86, 116, 255, .30),
    inset 0 1px 0 rgba(255, 255, 255, .24) !important;
}

.context-panel .user-action.is-main:hover,
.drawer-user-profile .user-action.is-main:hover,
.contact-profile-card .user-action.is-main:hover,
.contact-profile-workspace .user-action.is-main:hover {
  border-color: rgba(184, 206, 255, .72) !important;
  background:
    radial-gradient(130px 86px at 18% 8%, rgba(255, 255, 255, .30), transparent 64%),
    linear-gradient(135deg, #6a99ff 0%, #806fff 100%) !important;
  transform: translateY(-1px);
  box-shadow:
    0 18px 40px rgba(86, 116, 255, .38),
    inset 0 1px 0 rgba(255, 255, 255, .28) !important;
}

body[data-theme="aurora"] .context-panel .user-action.is-main,
body[data-theme="aurora"] .drawer-user-profile .user-action.is-main,
body[data-theme="aurora"] .contact-profile-card .user-action.is-main,
body[data-theme="aurora"] .contact-profile-workspace .user-action.is-main {
  border-color: #6d94ff !important;
  background:
    radial-gradient(120px 80px at 18% 8%, rgba(255, 255, 255, .28), transparent 62%),
    linear-gradient(135deg, #5a8bff 0%, #7366f5 100%) !important;
  color: #fff !important;
  box-shadow:
    0 14px 30px rgba(80, 112, 235, .22),
    inset 0 1px 0 rgba(255, 255, 255, .30) !important;
}

body[data-theme="aurora"] .context-panel .user-action.is-main:hover,
body[data-theme="aurora"] .drawer-user-profile .user-action.is-main:hover,
body[data-theme="aurora"] .contact-profile-card .user-action.is-main:hover,
body[data-theme="aurora"] .contact-profile-workspace .user-action.is-main:hover {
  border-color: #4e7fff !important;
  background:
    radial-gradient(130px 86px at 18% 8%, rgba(255, 255, 255, .34), transparent 64%),
    linear-gradient(135deg, #4f84ff 0%, #6d5ff0 100%) !important;
  box-shadow:
    0 16px 34px rgba(80, 112, 235, .28),
    inset 0 1px 0 rgba(255, 255, 255, .34) !important;
}

body[data-theme="midnight"] .context-panel .user-action.is-main,
body[data-theme="midnight"] .drawer-user-profile .user-action.is-main,
body[data-theme="midnight"] .contact-profile-card .user-action.is-main,
body[data-theme="midnight"] .contact-profile-workspace .user-action.is-main {
  border-color: rgba(126, 166, 255, .72) !important;
  background:
    radial-gradient(120px 80px at 18% 8%, rgba(255, 255, 255, .18), transparent 62%),
    linear-gradient(135deg, #5e8cff 0%, #7568ff 100%) !important;
  color: #fff !important;
  box-shadow:
    0 18px 38px rgba(70, 104, 255, .28),
    inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}

body[data-theme="midnight"] .context-panel .user-action.is-main:hover,
body[data-theme="midnight"] .drawer-user-profile .user-action.is-main:hover,
body[data-theme="midnight"] .contact-profile-card .user-action.is-main:hover,
body[data-theme="midnight"] .contact-profile-workspace .user-action.is-main:hover {
  border-color: rgba(170, 198, 255, .86) !important;
  background:
    radial-gradient(130px 86px at 18% 8%, rgba(255, 255, 255, .24), transparent 64%),
    linear-gradient(135deg, #6d9aff 0%, #8373ff 100%) !important;
  box-shadow:
    0 20px 44px rgba(70, 104, 255, .34),
    inset 0 1px 0 rgba(255, 255, 255, .22) !important;
}

@media (max-width: 560px) {
  .drawer-profile-secondary-actions {
    grid-template-columns: 1fr;
  }
}

.message-mention-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 0 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #ff5d6c, transparent 86%);
  color: #ff5d6c;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
}

.message-row.is-me .message-mention-badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

body[data-theme="aurora"] .message-mention-badge {
  background: #ffe9ee;
  color: #e23e54;
}

.message-search-scope {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-3);
  font-size: 12px;
}

.message-search-scope strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
}

.message-search-scope span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-icon-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-2);
}

.ghost-icon-action:hover {
  border-color: var(--line);
  color: var(--ink);
}

.ghost-icon-action svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 720px) {
  .set-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .set-row > :not(.sr-body) {
    justify-self: start;
    max-width: 100%;
  }

  .message-search-scope {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

.avatar,
.avatar-xl,
.avatar-soft,
.avatar-user,
.avatar.is-system,
.directory-avatar,
.signed-out-avatar,
.message-avatar,
.detail-avatar,
.incoming-avatar,
.incoming-avatar span,
.context-profile-card .avatar,
.context-section .profile-large .avatar,
.profile-large .avatar-xl,
.drawer-profile-hero .avatar-xl,
.drawer-profile-card .avatar,
.contact-profile-large .avatar-xl,
.contact-avatar-wrap .avatar-xl,
.detail-member .avatar,
.governance-row .avatar,
.seen-modal .avatar,
.mention-item .avatar,
.member-popover-head .avatar,
.context-file-mini .avatar,
.context-member-pill .avatar,
.message-row > .avatar,
.conversation-card .avatar,
.plain-row .avatar,
.conversation-avatar-wrap .avatar,
.call-history-row .avatar,
.rtc-record-card .avatar,
.rtc-live-tile .avatar {
  border-radius: 50% !important;
  overflow: hidden;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-overflow: clip;
}

.rail-footer {
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.rail-user {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  overflow: visible;
  line-height: 1;
  border-radius: 50% !important;
}

.rail-user > span {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.rail-user > span > .avatar-fallback,
.rail-user > span > img[data-avatar-image] {
  grid-area: 1 / 1;
}

.rail-user > span > img,
.rail-user img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rail-user img[data-avatar-image] {
  visibility: hidden;
}

.rail-user img[data-avatar-image].is-avatar-loaded {
  visibility: visible;
}

.rail-user > .presence-dot {
  right: 0;
  bottom: 0;
  z-index: 2;
}

.avatar img,
.directory-avatar img,
.signed-out-avatar img,
.message-avatar img,
.detail-avatar img,
.incoming-avatar > img,
.incoming-avatar span img,
.rail-user img {
  border-radius: 50% !important;
}

.conversation-card .avatar.is-system,
.conversation-avatar-wrap .avatar.is-system,
.avatar.is-system {
  width: 46px;
  height: 46px;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}

.conversation-card .avatar.is-system img,
.conversation-avatar-wrap .avatar.is-system img,
.avatar.is-system img {
  width: 100%;
  height: 100%;
  transform: scale(1.22);
  transform-origin: center;
}

.conversation-card .avatar.is-group-default-avatar,
.conversation-avatar-wrap .avatar.is-group-default-avatar,
.avatar.is-group-default-avatar {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 50%;
}

.avatar.is-group-default-avatar .avatar-fallback {
  visibility: hidden;
}

.conversation-card .avatar.is-group-default-avatar img[data-avatar-image].is-group-default-avatar-image,
.conversation-avatar-wrap .avatar.is-group-default-avatar img[data-avatar-image].is-group-default-avatar-image,
.avatar.is-group-default-avatar img[data-avatar-image].is-group-default-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  transform-origin: center;
}

.group-profile-modal {
  width: min(640px, calc(100vw - 28px));
  overflow: hidden;
}

.my-avatar-modal {
  width: min(560px, calc(100vw - 28px));
  overflow: hidden;
}

.my-name-modal {
  width: min(500px, calc(100vw - 28px));
  overflow: hidden;
}

.my-name-editor {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.account-profile-card.is-name-editor {
  padding: 14px;
}

.my-name-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.my-name-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 680;
  outline: none;
}

.my-name-field input:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%);
}

.my-account-readonly {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
}

.my-account-readonly span {
  color: var(--muted);
}

.my-account-readonly strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.my-account-readonly small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.group-profile-editor {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: stretch;
}

.group-profile-preview {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 14%, color-mix(in srgb, var(--primary), transparent 86%), transparent 48%),
    color-mix(in srgb, var(--surface-soft), var(--surface) 36%);
}

.my-avatar-editor {
  grid-template-columns: 190px minmax(0, 1fr);
}

.my-avatar-preview-card {
  min-height: 224px;
}

.group-avatar-crop {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--primary), transparent 58%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary), transparent 90%);
  pointer-events: none;
}

.avatar-crop-trigger {
  position: relative;
  padding: 0;
  appearance: none;
  cursor: pointer;
  touch-action: none;
  color: inherit;
  pointer-events: auto;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.avatar-crop-trigger.is-cropping {
  cursor: grab;
  border-radius: 24px;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 25%, transparent 25% 75%, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 25%, transparent 25% 75%, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 75%),
    color-mix(in srgb, var(--surface), var(--primary-soft) 12%);
  background-position: 0 0, 8px 8px, 0 0;
  background-size: 16px 16px, 16px 16px, auto;
}

.avatar-crop-trigger.is-cropping.is-dragging {
  cursor: grabbing;
}

.avatar-crop-trigger.is-cropping::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 22px;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 0 69%, color-mix(in srgb, var(--ink), transparent 70%) 70% 100%);
}

.avatar-crop-trigger.is-cropping::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 2px solid color-mix(in srgb, var(--primary), white 34%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, white, transparent 10%) inset;
}

.avatar-crop-trigger:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary), transparent 82%);
  transform: translateY(-1px);
}

.avatar-crop-trigger:active {
  transform: translateY(0);
}

.avatar-crop-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 76%);
  outline-offset: 3px;
}

.avatar-crop-trigger.is-disabled,
.group-avatar-change-button.is-disabled {
  opacity: .62;
  cursor: progress;
  pointer-events: none;
}

.my-avatar-crop {
  border-radius: 50%;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface), transparent 2%), color-mix(in srgb, var(--surface-soft), transparent 0%)),
    color-mix(in srgb, var(--surface-soft), var(--surface) 40%);
}

.my-avatar-crop-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  contain: paint;
}

.avatar-crop-trigger.is-cropping .my-avatar-crop-preview,
.avatar-crop-trigger.is-cropping .group-profile-avatar-preview {
  border-radius: 22px !important;
}

.my-avatar-crop-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate3d(var(--avatar-pan-x, 0px), var(--avatar-pan-y, 0px), 0) scale(var(--avatar-zoom, 1));
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.avatar-crop-trigger.is-cropping .my-avatar-crop-preview img,
.avatar-crop-trigger.is-cropping .group-profile-avatar-preview img {
  object-fit: contain;
  border-radius: 0 !important;
}

.my-avatar-preview-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 40px;
  font-weight: 860;
  line-height: 1;
  text-align: center;
}

.group-profile-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
}

.group-profile-avatar-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate3d(var(--avatar-pan-x, 0px), var(--avatar-pan-y, 0px), 0) scale(var(--avatar-zoom, 1));
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.group-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  opacity: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.group-profile-preview:focus-within {
  border-color: color-mix(in srgb, var(--primary), transparent 28%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 82%);
}

.group-avatar-change-button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 42%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface), var(--primary-soft) 22%);
  color: color-mix(in srgb, var(--primary), var(--ink) 12%);
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.group-profile-preview:hover .avatar-crop-trigger {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary), transparent 82%);
  transform: translateY(-1px);
}

.group-profile-preview:hover .group-avatar-change-button {
  border-color: color-mix(in srgb, var(--primary), transparent 18%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 8%);
  color: var(--primary);
  transform: translateY(-1px);
}

.group-avatar-change-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.15;
}

.group-avatar-change-button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 18%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 8%);
  color: var(--primary);
  transform: translateY(-1px);
}

.group-avatar-change-button:active {
  transform: translateY(0);
}

.group-avatar-change-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 78%);
  outline-offset: 2px;
}

.group-profile-form {
  padding: 0;
  align-content: start;
  gap: 14px;
}

.group-profile-form input[data-group-profile-name] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.group-profile-form input[data-group-profile-name]:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 24%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 86%);
}

.group-zoom-field input[type="range"] {
  width: 100%;
  height: 28px;
  accent-color: var(--primary);
  cursor: pointer;
}

.group-zoom-field input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.avatar-editor-state {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 74%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 55%);
  color: var(--ink);
}

.avatar-editor-state strong {
  font-size: 13px;
  font-weight: 780;
}

.avatar-editor-state span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.avatar-editor-state.is-error {
  border-color: color-mix(in srgb, #ff5b6b, transparent 54%);
  background: color-mix(in srgb, #ff5b6b, var(--surface) 88%);
}

.avatar-editor-state.is-error strong,
.avatar-editor-state.is-error span {
  color: color-mix(in srgb, #d9273e, var(--ink) 18%);
}

.detail-avatar-edit-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.detail-title-row {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  max-width: 100%;
}

.detail-title-row h2,
.detail-title-row h3 {
  position: relative;
  display: inline-block;
  margin: 0;
  min-width: 0;
  max-width: calc(100% - 36px);
  overflow: visible;
  vertical-align: top;
}

.detail-title-row h2 > span,
.detail-title-row h3 > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-edit-icon-button {
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: color-mix(in srgb, var(--ink), transparent 58%);
  box-shadow: none;
  opacity: .72;
  transition:
    background .16s ease,
    border-color .16s ease,
    color .16s ease,
    opacity .16s ease,
    transform .16s ease;
}

.group-edit-icon-button svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke-width: 1.9;
}

.group-edit-icon-button:hover {
  opacity: 1;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 78%);
  background: color-mix(in srgb, var(--primary), transparent 92%);
  transform: translateY(-1px);
  box-shadow: none;
}

.group-edit-icon-button.is-permission-blocked,
.group-avatar-hover-edit.is-permission-blocked {
  opacity: .58;
  cursor: not-allowed;
}

.group-edit-icon-button.is-permission-blocked:hover,
.group-avatar-hover-edit.is-permission-blocked:hover {
  color: color-mix(in srgb, var(--ink), transparent 58%);
  border-color: transparent;
  background: transparent;
  transform: none;
}

.group-avatar-hover-edit {
  cursor: pointer;
  border-radius: 50%;
  isolation: isolate;
  outline: none;
}

.group-avatar-hover-edit .avatar {
  transition:
    filter .16s ease,
    transform .16s ease;
}

.group-avatar-hover-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(15, 23, 42, .44), rgba(15, 23, 42, .28));
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .16s ease,
    background .16s ease;
}

.group-avatar-hover-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .34);
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .22);
  transform: scale(.92);
  transition:
    transform .16s ease,
    background .16s ease,
    border-color .16s ease;
}

.group-avatar-hover-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke-width: 0;
}

.group-avatar-hover-edit:hover .avatar,
.group-avatar-hover-edit:focus-visible .avatar {
  filter: brightness(.72) saturate(.92);
  transform: scale(1.015);
}

.group-avatar-hover-edit:hover .group-avatar-hover-mask,
.group-avatar-hover-edit:focus-visible .group-avatar-hover-mask {
  opacity: 1;
}

.group-avatar-hover-edit:hover .group-avatar-hover-icon,
.group-avatar-hover-edit:focus-visible .group-avatar-hover-icon {
  transform: scale(1);
  background: color-mix(in srgb, var(--primary), rgba(15, 23, 42, .38) 30%);
  border-color: color-mix(in srgb, var(--primary), #ffffff 64%);
}

.title-edit-button {
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  margin-left: 0;
  transform: translateY(-50%);
}

.title-edit-button:hover {
  transform: translateY(-50%);
}

.notice-edit-button {
  width: 28px;
  height: 28px;
}

body[data-theme="midnight"] .group-edit-icon-button {
  color: rgba(203, 213, 225, .52);
}

body[data-theme="midnight"] .group-edit-icon-button:hover {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, .24);
  background: rgba(96, 165, 250, .12);
}

body[data-theme="midnight"] .group-avatar-hover-mask {
  background:
    radial-gradient(circle at 50% 42%, rgba(2, 6, 23, .58), rgba(2, 6, 23, .36));
}

body[data-theme="midnight"] .group-avatar-hover-icon {
  background: rgba(15, 23, 42, .5);
  border-color: rgba(226, 232, 240, .34);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
}

body[data-theme="midnight"] .group-avatar-hover-edit:hover .group-avatar-hover-icon,
body[data-theme="midnight"] .group-avatar-hover-edit:focus-visible .group-avatar-hover-icon {
  background: rgba(96, 165, 250, .78);
  border-color: rgba(226, 232, 240, .62);
}

body[data-theme="midnight"] .group-profile-preview {
  background:
    radial-gradient(circle at 50% 14%, rgba(123, 197, 255, .14), transparent 48%),
    rgba(255, 255, 255, .035);
}

body[data-theme="midnight"] .group-avatar-change-button {
  border-color: rgba(123, 197, 255, .5);
  background: rgba(123, 197, 255, .12);
  color: #d7f0ff;
}

body[data-theme="midnight"] .group-avatar-change-button:hover {
  border-color: rgba(123, 197, 255, .72);
  background: rgba(123, 197, 255, .18);
  color: #ffffff;
}

.startup-error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--app-bg);
  color: var(--ink);
}

.startup-error-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  text-align: center;
}

.startup-error-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}

.startup-error-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.startup-error-card button {
  height: 42px;
  padding: 0 22px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 34%);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.read-status-summary {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 35%);
}

.read-status-summary strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 22px;
}

.read-status-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

body[data-theme="midnight"] .read-status-summary {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .11);
}

.switch {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 24px;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--line), var(--ink) 8%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong), #fff 4%), color-mix(in srgb, var(--surface), #000 3%));
  box-shadow: inset 0 1px 2px color-mix(in srgb, #000, transparent 88%);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.switch::before {
  width: 18px;
  height: 18px;
  margin: 2px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--surface-soft), #fff 32%));
  box-shadow: 0 1px 3px color-mix(in srgb, #000, transparent 82%);
  transition: margin .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.switch.is-on {
  border-color: color-mix(in srgb, var(--primary), #fff 12%);
  background: linear-gradient(135deg, #5d8cff, #7668ff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    0 7px 18px color-mix(in srgb, var(--primary), transparent 78%);
}

.switch.is-on::before {
  margin-left: 18px;
  border-color: rgba(255, 255, 255, .58);
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 2px 6px color-mix(in srgb, #1d3c8f, transparent 70%);
}

body[data-theme="midnight"] .switch {
  border-color: rgba(148, 163, 184, .24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .055));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .025),
    inset 0 1px 2px rgba(0, 0, 0, .36);
}

body[data-theme="midnight"] .switch::before {
  border-color: rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, #aeb7c8, #747d91);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .36);
}

body[data-theme="midnight"] .switch.is-on {
  border-color: rgba(133, 160, 255, .56);
  background: linear-gradient(135deg, #5a7dff, #7b67ff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    0 8px 22px rgba(102, 126, 255, .22);
}

body[data-theme="midnight"] .switch.is-on::before {
  border-color: rgba(255, 255, 255, .68);
  background: linear-gradient(180deg, #ffffff, #dfe8ff);
  box-shadow: 0 3px 8px rgba(23, 43, 111, .52);
}

body[data-theme="aurora"] .switch {
  border-color: rgba(119, 134, 164, .22);
  background: linear-gradient(180deg, #eef3fb, #e3eaf4);
  box-shadow: inset 0 1px 2px rgba(13, 29, 56, .06);
}

body[data-theme="aurora"] .switch::before {
  border-color: rgba(119, 134, 164, .16);
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
  box-shadow: 0 2px 5px rgba(44, 69, 112, .16);
}

body[data-theme="aurora"] .switch.is-on {
  border-color: rgba(92, 124, 255, .38);
  background: linear-gradient(135deg, #5d8cff, #7668ff);
  box-shadow: 0 8px 18px rgba(91, 125, 255, .18);
}

@media (max-width: 720px) {
  .detail-actions.three {
    grid-template-columns: 1fr;
  }

  .group-profile-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .contact-search-inline,
  .contact-search-result {
    grid-template-columns: 1fr;
  }

  .contact-search-field button,
  .contact-apply-submit {
    width: 100%;
  }

  .contact-search-result .directory-status {
    justify-self: start;
  }
}

.context-panel .user-action-grid.is-primary {
  background: transparent !important;
  box-shadow: none !important;
}
.context-panel .user-action-grid.is-primary .user-action.is-main {
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%) !important;
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.30) !important;
}

.contact-profile-workspace .contact-profile-card .user-action-grid.is-contact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.contact-profile-workspace .contact-profile-card .user-action-grid.is-contact-actions .user-action.is-main,
.contact-profile-workspace .contact-profile-card .user-action-grid.is-contact-actions .user-action[data-action="delete-friend"] {
  grid-column: auto !important;
}

.rtc-call-workspace.is-active-call .rtc-live-tile:hover,
.rtc-call-workspace.is-active-call .rtc-live-tile:focus,
.rtc-call-workspace.is-active-call .rtc-live-tile:focus-within,
.rtc-call-workspace.is-active-call .rtc-live-tile:active {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  box-shadow: none !important;
  transform: none !important;
}

.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:hover,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:focus,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:focus-within,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:active {
  background:
    radial-gradient(380px 240px at 50% 10%, color-mix(in srgb, var(--primary), transparent 68%), transparent 72%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft), var(--surface) 24%), var(--surface-soft)) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  transform: none !important;
}

.password-change-modal {
  width: min(520px, calc(100vw - 32px));
}

.password-change-body {
  display: grid;
  gap: 14px;
  padding: 20px 24px 8px;
}

.password-guard-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.password-guard-card svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.password-guard-card strong {
  display: block;
  color: var(--ink);
}

.password-guard-card p {
  margin: 2px 0 0;
  color: var(--muted);
}

.password-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.password-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: color-mix(in srgb, var(--surface), #fff 3%);
  color: var(--ink);
  font: inherit;
}

.password-field input:focus {
  border-color: color-mix(in srgb, var(--primary), #fff 10%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 84%);
}

.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.password-strength-bar {
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 20%);
}

.password-strength-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #7c6bff);
}

.password-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
}

.password-rule-list li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.password-rule-list li span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted), transparent 50%);
}

.password-rule-list li.is-ok {
  color: var(--success);
}

.password-rule-list li.is-ok span {
  background: var(--success);
}

.password-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 90%);
}

body[data-theme="midnight"] .password-guard-card,
body[data-theme="midnight"] .password-field input {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
}

body[data-theme="aurora"] .password-field input {
  background: #fff;
}

.copy-user-id-button,
.copy-user-id-button:hover,
.copy-user-id-button:active,
.copy-user-id-button:focus-visible { box-sizing: border-box; width: auto; max-width: 100%; height: auto; min-width: 0; min-height: 0; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0; transform: none; white-space: nowrap; line-height: 1.35; color: var(--primary); font-size: 14px; font-weight: 800; }

:is(.detail-kv, .info-list, .info-grid, .account-info-list, .contact-info-grid, .member-role-user-id) strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

:is(.detail-kv, .info-list, .info-grid, .account-info-list, .contact-info-grid, .member-role-user-id) .copy-user-id-button { width: fit-content !important; min-width: 0 !important; max-width: 100%; height: auto !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: flex-start !important; flex-wrap: nowrap; gap: 6px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; overflow: hidden; vertical-align: top; background: transparent !important; box-shadow: none !important; color: var(--primary) !important; font-size: 14px; font-weight: 800; line-height: 1.35; }

:is(.detail-kv, .info-list, .info-grid, .account-info-list, .contact-info-grid, .member-role-user-id) .copy-user-id-button span { display: block !important; min-width: 0 !important; flex: 1 1 auto; overflow: hidden; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: inherit !important; line-height: inherit; text-overflow: ellipsis; white-space: nowrap; }

:is(.detail-kv, .info-list, .info-grid, .account-info-list, .contact-info-grid, .member-role-user-id) .copy-user-id-button svg { width: 13px !important; height: 13px !important; min-width: 13px; flex: 0 0 13px; display: block; align-self: center; margin-left: 1px; color: currentColor !important; opacity: .72; }

.copy-user-id-button:hover,
.copy-user-id-button:active,
.copy-user-id-button:focus-visible { color: var(--primary); }

:is(.detail-kv, .info-list, .info-grid, .account-info-list, .contact-info-grid, .member-role-user-id) .copy-user-id-button:is(:hover, :active, :focus-visible) { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.copy-user-id-button:focus-visible { outline: 0; outline-offset: 0; }

button.message-avatar,
.message-avatar {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #b66bff, #7c6bff);
  box-shadow: 0 4px 12px rgba(124, 107, 255, .14);
  transition:
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    color .16s var(--ease-out),
    transform .16s var(--ease-out);
  outline: 0;
  --message-avatar-ring: transparent;
}

button.message-avatar::after,
.message-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 2px var(--message-avatar-ring);
  transition: opacity .16s var(--ease-out), box-shadow .16s var(--ease-out);
}

button.message-avatar.is-system,
.message-avatar.is-system {
  background: linear-gradient(135deg, #ef625b, #dc443f);
  box-shadow: 0 4px 12px rgba(239, 98, 91, .14);
}

button.message-avatar:hover,
button.message-avatar:focus-visible {
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  background: linear-gradient(135deg, #b66bff, #7c6bff);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 34%);
  transform: none;
}

button.message-avatar.is-system:hover,
button.message-avatar.is-system:focus-visible {
  border-color: color-mix(in srgb, #ef625b, transparent 32%);
  background: linear-gradient(135deg, #ef625b, #dc443f);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, #ef625b, transparent 34%);
}

body[data-theme="aurora"] button.message-avatar:hover,
body[data-theme="aurora"] button.message-avatar:focus-visible {
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 42%);
}

body[data-theme="midnight"] button.message-avatar:hover,
body[data-theme="midnight"] button.message-avatar:focus-visible {
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 28%);
}

button.message-avatar:hover,
button.message-avatar:focus-visible,
.message-avatar:hover,
.message-avatar:focus-visible {
  box-shadow: none !important;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 28%);
  transform: none !important;
}

button.message-avatar:hover::after,
button.message-avatar:focus-visible::after,
.message-avatar:hover::after,
.message-avatar:focus-visible::after {
  opacity: 1;
}

button.message-avatar.is-system:hover,
button.message-avatar.is-system:focus-visible,
.message-avatar.is-system:hover,
.message-avatar.is-system:focus-visible {
  box-shadow: none !important;
  --message-avatar-ring: color-mix(in srgb, #ef625b, transparent 28%);
  transform: none !important;
}

button.message-avatar:hover img,
button.message-avatar:focus-visible img,
.message-avatar:hover img,
.message-avatar:focus-visible img,
button.message-avatar:hover .avatar-fallback,
button.message-avatar:focus-visible .avatar-fallback,
.message-avatar:hover .avatar-fallback,
.message-avatar:focus-visible .avatar-fallback {
  transform: none !important;
}

@media (max-width: 560px) {
  .password-rule-list {
    grid-template-columns: 1fr;
  }
}

.detail-kv,
.info-list > span,
.info-grid > span,
.contact-info-grid > span,
.account-info-list > span,
.member-role-user-id {
  min-width: 0;
}

.detail-kv strong:has(.copy-user-id-button),
.info-list strong:has(.copy-user-id-button),
.info-grid strong:has(.copy-user-id-button),
.contact-info-grid strong:has(.copy-user-id-button),
.account-info-list strong:has(.copy-user-id-button),
.member-role-user-id strong:has(.copy-user-id-button) {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.35;
  text-align: left;
}

.detail-kv .copy-user-id-button,
.info-list .copy-user-id-button,
.info-grid .copy-user-id-button,
.contact-info-grid .copy-user-id-button,
.account-info-list .copy-user-id-button,
.member-role-user-id .copy-user-id-button {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: hidden;
  vertical-align: top;
}

.detail-kv .copy-user-id-button span,
.info-list .copy-user-id-button span,
.info-grid .copy-user-id-button span,
.contact-info-grid .copy-user-id-button span,
.account-info-list .copy-user-id-button span,
.member-role-user-id .copy-user-id-button span {
  min-width: 0;
  display: block !important;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-kv .copy-user-id-button svg,
.info-list .copy-user-id-button svg,
.info-grid .copy-user-id-button svg,
.contact-info-grid .copy-user-id-button svg,
.account-info-list .copy-user-id-button svg,
.member-role-user-id .copy-user-id-button svg {
  flex: 0 0 13px;
  display: block;
  align-self: center;
  margin-left: 1px;
}

/* 1v1 video calling: every panel and floating surface is deliberately opaque. */
.rtc-contact-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.rtc-contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rtc-contact-actions button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 740;
}

.rtc-contact-actions button:first-child {
  border-color: color-mix(in srgb, var(--primary), var(--line) 40%);
  background: var(--primary-soft);
  color: var(--primary-2);
}

.rtc-contact-actions button:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.rtc-contact-actions svg {
  width: 17px;
  height: 17px;
}

.rtc-ended-summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
}

.rtc-ended-summary > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-2);
}

.rtc-ended-summary svg {
  width: 20px;
  height: 20px;
}

.rtc-ended-summary strong,
.rtc-ended-summary small {
  display: block;
}

.rtc-ended-summary small {
  margin-top: 4px;
  color: var(--ink-3);
}

.rtc-ended-summary > button {
  min-width: 112px;
  min-height: 48px;
  display: inline-flex;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raise);
  color: var(--ink-2);
}

.rtc-video-workspace .page-scroll {
  min-height: 0;
  align-content: stretch;
  overflow: auto;
}

.rtc-call-workspace.is-active-call .rtc-call-actions.call-controls {
  grid-area: auto;
}

.rtc-video-workspace.is-active-call .page-scroll {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  gap: 0;
}

.rtc-video-preflight {
  width: min(920px, 100%);
  min-height: min(680px, calc(100vh - 150px));
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto auto;
  gap: 18px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 44%);
  border-radius: 24px;
  background: #0d1524;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

body[data-theme="aurora"] .rtc-video-preflight {
  background: #fff;
}

.rtc-video-preflight-copy {
  display: grid;
  gap: 6px;
}

.rtc-video-preflight-copy .eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 780;
}

.rtc-video-preflight-copy h2 {
  color: var(--ink);
  font-size: 24px;
}

.rtc-video-preflight-copy p:not(.eyebrow) {
  color: var(--ink-2);
}

.rtc-video-frame {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #050914;
  color: #fff;
}

.rtc-video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #050914;
}

.rtc-video-frame.is-local video {
  transform: scaleX(-1);
}

.rtc-video-frame.is-camera-off video {
  visibility: hidden;
}

.rtc-video-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: #091121;
  color: #dfe9ff;
  text-align: center;
}

.rtc-video-frame.is-camera-off .rtc-video-fallback,
.rtc-video-frame.is-waiting .rtc-video-fallback {
  display: grid;
}

.rtc-video-fallback .avatar {
  width: 82px;
  height: 82px;
  border-radius: 28px;
}

.rtc-video-frame-label {
  position: static;
  justify-self: start;
  margin-top: 6px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #33455f;
  border-radius: 999px;
  background: #111b2c;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.rtc-video-error {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 40%);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--danger);
}

.rtc-video-error svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.rtc-video-error span {
  min-width: 0;
}

.rtc-video-preflight-actions,
.rtc-call-actions.call-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rtc-call-actions.call-controls {
  align-items: center;
}

.rtc-video-workspace.is-active-call .rtc-call-actions.call-controls {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  padding: 14px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: #0a1220;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.rtc-reversible-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rtc-call-actions.call-controls .call-answer,
.rtc-call-actions.call-controls .call-end {
  min-height: 48px;
  padding: 0 16px;
}

.rtc-downgrade-action {
  border: 1px solid #56657a;
  background: #202b3b;
  color: #fff;
  box-shadow: none;
}

.rtc-isolated-hangup {
  margin-inline-start: 14px;
  outline: 1px solid color-mix(in srgb, #ff6475, transparent 52%);
  outline-offset: 5px;
}

.rtc-call-workspace.is-active-call:not(.rtc-video-workspace) .page-scroll {
  min-height: 0;
  grid-template-rows: minmax(min-content, 1fr) auto;
  align-content: stretch;
  gap: 18px;
  overflow: auto;
  background:
    radial-gradient(620px 560px at 50% 43%, color-mix(in srgb, var(--primary), transparent 86%), transparent 72%),
    color-mix(in srgb, var(--bg), var(--surface) 4%);
}

.rtc-voice-stage {
  width: min(760px, 100%);
  min-height: 510px;
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 18px 24px;
  color: var(--ink);
}

.rtc-voice-call-meta {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.rtc-voice-status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 17px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 34%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft), transparent 18%);
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.rtc-voice-call-meta small {
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}

.rtc-voice-call-meta strong {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 38px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .02em;
}

.rtc-voice-peer {
  min-width: 0;
  max-width: 100%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
}

.rtc-voice-avatar-stage {
  position: relative;
  width: 226px;
  height: 226px;
  display: grid;
  place-items: center;
}

.rtc-voice-avatar-stage > i {
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 78%);
  border-radius: 999px;
  pointer-events: none;
}

.rtc-voice-avatar-stage > i:nth-child(2) {
  inset: 31px;
  border-color: color-mix(in srgb, var(--primary), transparent 68%);
}

.rtc-voice-avatar-stage > i:nth-child(3) {
  inset: 52px;
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
}

.rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i {
  animation: rtc-voice-pulse 2.4s ease-in-out infinite;
}

.rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i:nth-child(2) {
  animation-delay: .25s;
}

.rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i:nth-child(3) {
  animation-delay: .5s;
}

.rtc-voice-avatar-stage .avatar {
  position: relative;
  z-index: 1;
  width: 126px;
  min-width: 126px;
  height: 126px;
  min-height: 126px;
  overflow: hidden;
  border: 5px solid color-mix(in srgb, var(--surface), #fff 72%);
  border-radius: 999px;
  box-shadow: 0 18px 52px color-mix(in srgb, var(--primary), transparent 64%);
}

.rtc-voice-peer > .identity-name-line {
  width: fit-content;
  max-width: min(100%, 420px);
  justify-content: center;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rtc-voice-peer .identity-display-name-text,
.rtc-voice-self-card .identity-display-name-text {
  flex: 0 1 auto;
}

.rtc-voice-peer .identity-name-line .certification-name-slot,
.rtc-voice-self-card .identity-name-line .certification-name-slot {
  flex: 0 1 auto;
  max-width: 45%;
  align-self: center;
}

.rtc-voice-peer .identity-name-line .verification-badge,
.rtc-voice-self-card .identity-name-line .verification-badge {
  flex: 0 1 auto;
  max-width: 100%;
  font-size: .72em;
}

.rtc-voice-peer .identity-name-line .verification-badge-icon,
.rtc-voice-self-card .identity-name-line .verification-badge-icon {
  width: 1.25em;
  height: 1.25em;
}

.rtc-voice-self-card {
  width: min(560px, 100%);
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), transparent 4%);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--bg), transparent 72%);
}

.rtc-voice-self-card .avatar {
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  border-radius: 999px;
}

.rtc-voice-self-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.rtc-voice-self-card strong {
  color: var(--ink);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.rtc-voice-self-card small {
  color: var(--ink-2);
}

.rtc-voice-controls {
  width: min(600px, 100%);
  min-width: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), transparent 2%);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--bg), transparent 62%);
}

.rtc-voice-control {
  min-width: 0;
  min-height: 122px;
  display: grid;
  grid-template-rows: 58px auto auto;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  touch-action: manipulation;
}

.rtc-voice-control > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong), transparent 10%);
}

.rtc-voice-control svg {
  width: 27px;
  height: 27px;
}

.rtc-voice-control strong {
  min-width: 0;
  color: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.rtc-voice-control small {
  min-width: 0;
  max-width: 100%;
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rtc-voice-control:hover:not(:disabled),
.rtc-voice-control.is-active {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  background: color-mix(in srgb, var(--primary-soft), transparent 22%);
}

.rtc-voice-control:focus-visible {
  border-color: var(--primary);
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 30%);
  outline-offset: 2px;
}

.rtc-voice-control:disabled {
  opacity: .68;
  cursor: not-allowed;
}

.rtc-voice-control.is-hangup > span {
  border-color: transparent;
  background: linear-gradient(135deg, #ff536c, #eb304e);
  color: #fff;
  box-shadow: 0 12px 28px rgba(235, 48, 78, .28);
}

.rtc-voice-control.is-hangup svg {
  transform: rotate(135deg);
}

@keyframes rtc-voice-pulse {
  0%, 100% { opacity: .58; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.02); }
}

@media (max-width: 760px) {
  .rtc-voice-stage {
    min-height: 430px;
    gap: 12px;
    padding: 10px 8px;
  }

  .rtc-voice-avatar-stage {
    width: 184px;
    height: 184px;
  }

  .rtc-voice-avatar-stage > i { inset: 6px; }
  .rtc-voice-avatar-stage > i:nth-child(2) { inset: 24px; }
  .rtc-voice-avatar-stage > i:nth-child(3) { inset: 42px; }

  .rtc-voice-avatar-stage .avatar {
    width: 100px;
    min-width: 100px;
    height: 100px;
    min-height: 100px;
  }

  .rtc-voice-self-card {
    min-height: 92px;
    padding: 12px 14px;
  }

  .rtc-voice-self-card .avatar {
    width: 58px;
    min-width: 58px;
    height: 58px;
    min-height: 58px;
  }

  .rtc-voice-control {
    min-height: 104px;
    grid-template-rows: 48px auto auto;
    padding-inline: 4px;
  }

  .rtc-voice-control > span {
    width: 46px;
    height: 46px;
  }

  .rtc-voice-control svg {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 420px) {
  .rtc-call-workspace.is-active-call:not(.rtc-video-workspace) .page-scroll {
    gap: 10px;
    padding: 10px;
  }

  .rtc-voice-stage {
    min-height: 400px;
  }

  .rtc-voice-peer > .identity-name-line {
    font-size: 22px;
  }

  .rtc-voice-self-card {
    gap: 11px;
  }

  .rtc-voice-control strong {
    font-size: 12px;
  }

  .rtc-voice-control small {
    font-size: 10px;
  }
}

@media (forced-colors: active) {
  .rtc-voice-status-pill,
  .rtc-voice-avatar-stage .avatar,
  .rtc-voice-self-card,
  .rtc-voice-controls,
  .rtc-voice-control,
  .rtc-voice-control > span {
    border: 1px solid CanvasText;
  }

  .rtc-voice-control:focus-visible {
    outline: 3px solid Highlight;
  }

  .rtc-voice-control.is-hangup > span {
    background: Highlight;
    color: HighlightText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i {
    animation: none;
  }
}

.rtc-video-workspace .workspace-topbar .icon-action,
.rtc-video-workspace .workspace-topbar .detail-action {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
}

.rtc-control {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--raise);
  color: var(--ink);
  font-weight: 760;
}

.rtc-control.is-primary {
  min-width: 176px;
  border-color: transparent;
  background: var(--grad);
  color: #fff;
}

.rtc-control.is-off,
.call-answer.is-off {
  color: var(--warn);
}

.rtc-control:disabled {
  opacity: .52;
  cursor: wait;
}

.rtc-control svg {
  width: 19px;
  height: 19px;
}

.rtc-incoming-panel.is-video .rtc-call-actions {
  grid-template-columns: repeat(3, minmax(112px, 1fr));
}

.call-answer.is-audio,
.call-answer.is-secondary {
  border: 1px solid var(--line);
  background: var(--raise);
  color: var(--ink);
  box-shadow: none;
}

.call-answer.is-video {
  background: var(--grad);
  box-shadow: 0 16px 34px rgba(79, 140, 255, .28);
}

.rtc-video-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 28%);
  grid-template-rows: min(50vh, 420px) auto;
  grid-template-areas: "remote remote" "status local";
  gap: 8px;
  padding: 8px;
  min-height: min(660px, calc(100vh - 220px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-radius: 24px;
  background: #050914;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.rtc-video-workspace.is-active-call .rtc-video-stage {
  width: 100%;
  height: max-content;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 24px 24px 0 0;
  box-shadow: none;
}

.rtc-video-stage > .rtc-video-frame.is-remote {
  position: relative;
  grid-area: remote;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.rtc-video-stage-status {
  position: static;
  grid-area: status;
  align-self: center;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #33455f;
  border-radius: 999px;
  background: #111b2c;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.rtc-video-stage-status span,
.rtc-video-stage-status strong,
.rtc-video-frame-label,
.rtc-video-stage .rtc-video-fallback strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rtc-video-stage-status span {
  max-width: min(42vw, 28rem);
}

.rtc-video-stage-status strong {
  flex: 0 0 auto;
}

.rtc-video-stage-status strong {
  color: #8ebaff;
  font-variant-numeric: tabular-nums;
}

.rtc-video-local-pip {
  position: static;
  grid-area: local;
  justify-self: end;
  z-index: 3;
  width: min(100%, 260px);
  height: clamp(110px, 15vw, 180px);
}

.rtc-video-local-pip .rtc-video-frame {
  width: 100%;
  height: 100%;
  border-color: #50627e;
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .42);
}

.rtc-video-local-pip .rtc-video-fallback {
  padding: 12px;
}

.rtc-video-local-pip .rtc-video-fallback .avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.rtc-video-local-pip .rtc-video-fallback strong {
  font-size: 11px;
}

.rtc-video-dock {
  position: fixed;
  z-index: 79;
  right: 20px;
  bottom: 20px;
  width: min(400px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #344764;
  border-radius: 20px;
  background: #0a1220;
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

.rtc-video-dock-main {
  width: 100%;
  min-height: 152px;
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: #050914;
  color: inherit;
  text-align: left;
}

.rtc-video-dock-main > .rtc-video-frame {
  position: relative;
  height: 180px;
  max-height: 40vh;
  border: 0;
  border-radius: 0;
}

.rtc-video-dock-copy {
  position: static;
  z-index: 3;
  display: grid;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid #33455f;
  border-radius: 12px;
  background: #111b2c;
}

.rtc-video-dock-copy small {
  color: #b7c3d9;
  font-size: 11px;
}

.rtc-video-dock-copy em {
  color: #d8e2f2;
  font-size: 11px;
  font-style: normal;
}

.rtc-video-dock-states {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.rtc-video-dock-states b {
  padding: 3px 6px;
  border: 1px solid #465a77;
  border-radius: 999px;
  color: #dbe7fb;
  font-size: 9px;
  font-weight: 760;
}

.rtc-video-dock-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #091121;
}

.rtc-video-dock-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-top: 1px solid #344764;
  background: #344764;
}

.rtc-video-dock-actions button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: #101a2b;
  color: #fff;
  font-size: 13px;
  font-weight: 760;
}

.rtc-video-dock-actions button.is-danger {
  color: #ff7d8c;
}

.rtc-video-dock-actions svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 920px) {
  .rtc-contact-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rtc-contact-actions {
    grid-column: 1 / -1;
  }

  .rtc-contact-actions button {
    flex: 1;
    justify-content: center;
  }

  .rtc-video-preflight {
    min-height: auto;
    padding: 16px;
    border-radius: 18px;
  }

  .rtc-video-preflight > .rtc-video-frame {
    min-height: 300px;
  }

  .rtc-video-stage {
    min-height: min(560px, calc(100vh - 230px));
    border-radius: 18px;
  }

  .rtc-video-local-pip {
    width: min(100%, 190px);
  }

  .rtc-incoming-panel.is-video .rtc-call-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .rtc-video-workspace .page-scroll,
  .rtc-call-workspace .page-scroll {
    padding: 12px;
  }

  .rtc-video-preflight > .rtc-video-frame {
    min-height: 240px;
  }

  .rtc-video-preflight-actions .rtc-control {
    width: 100%;
  }

  .rtc-ended-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rtc-ended-summary > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .rtc-reversible-controls,
  .rtc-downgrade-action,
  .rtc-isolated-hangup {
    width: 100%;
  }

  .rtc-reversible-controls .call-answer {
    flex: 1 1 calc(50% - 10px);
  }

  .rtc-isolated-hangup {
    margin: 10px 0 0;
  }

  .rtc-video-stage {
    min-height: calc(100vh - 280px);
  }

  .rtc-video-local-pip {
    width: 100%;
  }

  .rtc-video-dock {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

/* Internal-only key-user marker. The DOM is emitted only after sidecar authorization. */
.key-user-marker {
  display: inline-grid;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-inline-start: 4px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #b7791f 42%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #f6c453 24%, var(--surface, #fff));
  color: #9a5b00;
  font-size: 9px;
  line-height: 1;
  vertical-align: 1px;
}

.key-user-name-line {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: inherit;
}

.conversation-card.key-user-row-accent,
.group-member-row.key-user-row-accent,
.member-card.key-user-row-accent,
.context-member-pill.key-user-row-accent,
.detail-member.key-user-row-accent {
  box-shadow: inset 2px 0 0 color-mix(in srgb, #d79a22 56%, transparent);
}

.conversation-card.key-user-row-accent:not(.is-active),
.group-member-row.key-user-row-accent,
.member-card.key-user-row-accent,
.context-member-pill.key-user-row-accent,
.detail-member.key-user-row-accent {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, #f6c453 6%, transparent),
    transparent 32%
  );
}

.key-user-profile-switch {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, #d79a22 30%, var(--line, #dfe4ea));
  border-radius: 14px;
  background: color-mix(in srgb, #f6c453 8%, var(--surface, #fff));
}

.key-user-profile-switch__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.key-user-profile-switch__label {
  font-weight: 750;
}

.key-user-profile-switch__value,
.key-user-profile-switch__explanation,
.key-user-profile-switch__status {
  color: var(--muted, #667085);
  font-size: 12px;
}

.key-user-profile-switch__explanation,
.key-user-profile-switch__status {
  min-height: 1em;
  margin: 0;
}

.key-user-profile-switch__control {
  display: inline-grid;
  width: 42px;
  height: 24px;
  padding: 2px;
  place-items: center start;
  border: 1px solid color-mix(in srgb, #9a5b00 34%, transparent);
  border-radius: 999px;
  background: var(--surface-muted, #e8edf3);
  color: #8a5a00;
  transition: background-color 120ms ease, color 120ms ease;
}

.key-user-profile-switch__control[aria-checked="true"] {
  place-items: center end;
  background: #d99b21;
  color: #fff;
}

.key-user-profile-switch__control:focus-visible {
  outline: 3px solid color-mix(in srgb, #d99b21 38%, transparent);
  outline-offset: 2px;
}

.key-user-profile-switch__control:disabled {
  cursor: wait;
  opacity: .58;
}

[data-theme="midnight"] .key-user-marker,
[data-theme="aurora"] .key-user-marker {
  background: color-mix(in srgb, #f6c453 22%, #172033);
  color: #ffd978;
}

@media (max-width: 560px) {
  .key-user-profile-switch__line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .key-user-profile-switch__value {
    grid-column: 1;
    grid-row: 2;
  }

  .key-user-profile-switch__control {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-key-account-spinner,
  .key-user-profile-switch__control {
    transition: none;
    animation: none;
  }
}

@media (forced-colors: active) {
  .chat-key-account-bar,
  .chat-key-account-list,
  .chat-key-account-item,
  .chat-key-account-state {
    border: 1px solid CanvasText;
  }

  .chat-key-account-head:focus-visible,
  .chat-key-account-item:focus-visible,
  .chat-key-account-state button:focus-visible {
    outline-color: Highlight;
  }

  .key-user-marker,
  .key-user-profile-switch,
  .key-user-profile-switch__control {
    border: 1px solid ButtonText;
    forced-color-adjust: auto;
  }

  .key-user-row-accent {
    outline: 1px solid Highlight;
    outline-offset: -2px;
  }
}

/* User-selected display density. Keep shell columns and responsive breakpoints unchanged. */
.density-toggle button {
  min-width: 64px;
  min-height: 44px;
  justify-content: center;
}

body[data-display-density="compact"] .conversation-stack,
body[data-display-density="compact"] .plain-list,
body[data-display-density="compact"] .file-list,
body[data-display-density="compact"] .card-list {
  gap: 4px;
}

body[data-display-density="compact"] .conversation-card,
body[data-display-density="compact"] .plain-row,
body[data-display-density="compact"] .file-card {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
  padding: 7px 10px;
}

body[data-display-density="compact"] .conversation-card {
  grid-template-rows: 20px 20px;
  row-gap: 2px;
}

body[data-display-density="compact"] .conversation-card .avatar,
body[data-display-density="compact"] .plain-row .avatar,
body[data-display-density="compact"] .file-card .file-type,
body[data-display-density="compact"] .conversation-avatar-wrap {
  width: 40px;
  height: 40px;
}

body[data-display-density="compact"] .contact-row {
  min-height: 54px;
}

body[data-display-density="compact"] .setting-nav-row {
  min-height: 64px;
  padding: 9px 14px;
}

body[data-display-density="compact"] .set-row {
  padding-block: 10px;
}

body[data-display-density="compact"] .message-scroll {
  padding: 12px 20px 14px;
}

body[data-display-density="compact"] .message-flow {
  gap: 4px;
}

body[data-display-density="compact"] .message-row {
  gap: 8px;
}

/* Authoritative enterprise certification and in-conversation batch forwarding. */
.account-enterprise-certification.is-verified {
  border-color: color-mix(in srgb, #2f6fed 48%, var(--line));
  background: color-mix(in srgb, #2f6fed 10%, var(--surface));
}

.account-enterprise-certification.is-verified strong {
  color: color-mix(in srgb, #2f6fed 82%, var(--ink));
}

.account-enterprise-certification.is-loading strong,
.account-enterprise-certification.is-unavailable strong,
.account-enterprise-certification.is-inactive strong {
  color: var(--ink-3);
}

.batch-forward-inline-bar {
  flex: 0 0 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 8px 18px 18px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong), var(--surface) 40%);
  box-shadow: var(--sh-sm);
}

.batch-forward-inline-bar p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 720;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-forward-inline-bar button {
  min-width: 64px;
  min-height: 44px;
}

.batch-forward-inline-actions {
  display: flex;
  gap: 8px;
}

.message-row.is-batch-forward-selecting {
  max-width: min(74%, 680px);
  padding: 0 0 0 52px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: outline-color .14s ease, background-color .14s ease;
}

.message-row.is-me.is-batch-forward-selecting {
  padding: 0 52px 0 0;
}

.message-row.is-batch-forward-selected {
  outline: 1px solid color-mix(in srgb, var(--primary), var(--line) 32%);
  outline-offset: 7px;
  background: color-mix(in srgb, var(--primary), transparent 90%);
}

.message-row.is-batch-forward-selecting .message-stack {
  pointer-events: none;
}

.message-row.is-me.is-batch-forward-selecting .message-stack::after {
  content: "";
  width: 1px;
  min-height: 22px;
}

.batch-forward-source-check {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 0;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(-50%);
}

.message-row.is-me .batch-forward-source-check {
  right: 0;
  left: auto;
}

.batch-forward-source-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.batch-forward-source-check span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink-3);
  border-radius: 8px;
  background: var(--surface);
  color: #fff;
  font-weight: 850;
}

.batch-forward-source-check input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
}

.batch-forward-source-check input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 35%);
  outline-offset: 3px;
}

.batch-forward-source-check.is-disabled {
  cursor: not-allowed;
  opacity: .48;
}

.modal-card.batch-forward-modal-card {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(90vh, 860px);
  max-height: min(90dvh, 860px);
  overflow: hidden;
  padding: 0;
  background: var(--surface);
}

.batch-forward-shell {
  color: var(--ink);
  background: var(--surface);
}

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

.batch-forward-header {
  background: color-mix(in srgb, var(--surface), var(--bg) 4%);
}

.batch-forward-title-block h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 780;
}

.batch-forward-title-block p,
.batch-forward-pane p,
.batch-forward-delivery-summary span,
.batch-forward-selected-targets-head p {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.batch-forward-icon-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 0;
}

.batch-forward-icon-button svg {
  width: 18px;
  height: 18px;
}

.batch-forward-shell button,
.batch-forward-shell [role="tab"],
.batch-forward-shell summary {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}

.batch-forward-shell button {
  min-height: 44px;
  padding: 8px 12px;
}

.batch-forward-shell button:hover:not(:disabled),
.batch-forward-shell summary:hover,
.batch-forward-shell [role="tab"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary), var(--line) 42%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 72%);
  color: var(--ink);
}

.batch-forward-shell button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.batch-forward-pane {
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 34%);
}

/* Keep pagination at the selector bottom; an empty selected summary must not
   reserve a blank row below it. The result list owns the remaining height. */
.batch-forward-webchat .batch-forward-target-pane {
  display: flex;
  flex-direction: column;
}

.batch-forward-webchat .batch-forward-target-heading-row {
  flex: 0 0 auto;
}

.batch-forward-webchat .batch-forward-target-pane > [data-batch-forward-selected-slot] {
  order: 1;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

.batch-forward-webchat .batch-forward-target-pane > [data-batch-forward-selected-slot]:empty {
  display: none;
}

.batch-forward-webchat .batch-forward-target-pane > .batch-forward-target-panel {
  order: 2;
  flex: 1 1 0;
}

.batch-forward-pane h3,
.batch-forward-pane h4 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.batch-forward-pane [role="tablist"] {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 36%);
}

.batch-forward-target-heading-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-forward-target-heading-row .batch-forward-pane-head {
  flex: 1 1 auto;
}

.batch-forward-target-heading-row [role="tablist"] {
  flex: 0 1 auto;
  gap: 4px;
}

.batch-forward-pane [role="tab"] {
  flex: 1 1 0;
  min-width: 54px;
  min-height: 34px;
  padding: 5px 9px;
}

.batch-forward-pane [role="tab"][aria-selected="true"] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 30%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 52%);
  color: var(--primary);
  font-weight: 760;
}

.batch-forward-pane label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
}

.batch-forward-pane input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
}

.batch-forward-row,
.batch-forward-message-preview-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 8px 10px;
}

.batch-forward-row {
  cursor: pointer;
}

.batch-forward-row[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 26%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 58%);
}

.batch-forward-row[aria-disabled="true"] {
  cursor: not-allowed;
}

.batch-forward-row-copy strong,
.batch-forward-selected-label-text {
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
}

.batch-forward-row-copy small,
.batch-forward-row-copy time {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.batch-forward-row-copy em {
  margin-top: 4px;
  color: var(--danger);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.batch-forward-target-icon[data-target-kind="group"] {
  background: color-mix(in srgb, var(--primary), var(--surface) 88%);
  color: var(--primary);
}

.batch-forward-target-icon[data-target-kind="direct"] {
  background: color-mix(in srgb, var(--ok), var(--surface) 88%);
  color: color-mix(in srgb, var(--ok), var(--ink) 20%);
}

.batch-forward-target-icon {
  overflow: hidden;
}

.batch-forward-target-icon :is(.avatar, .av) {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: inherit;
}

.batch-forward-target-icon :is(.avatar, .av) img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.batch-forward-selected-targets {
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.batch-forward-selected-targets-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.batch-forward-selected-targets-heading-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-forward-selected-preview-item,
.batch-forward-selected-more,
.batch-forward-selected-remove,
.batch-forward-chip-list button {
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 56%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  padding: 4px 8px 4px 5px;
}

.batch-forward-selected-more {
  justify-content: center;
  min-width: 48px;
  padding-inline: 10px;
  color: var(--primary);
  font-weight: 780;
}

.batch-forward-selected-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.batch-forward-selected-label .batch-forward-target-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.batch-forward-selected-label .batch-forward-target-icon svg {
  width: 15px;
  height: 15px;
}

.batch-forward-selected-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-forward-selected-manage {
  flex: 0 0 auto;
  min-width: 0;
  border-top: 0;
  padding-top: 0;
}

.batch-forward-selected-manage[open] {
  border-color: var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

body[data-theme="midnight"] .batch-forward-selected-manage[open] {
  background: #121826;
}

body[data-theme="aurora"] .batch-forward-selected-manage[open],
body[data-theme="teal"] .batch-forward-selected-manage[open],
body[data-theme="graphite"] .batch-forward-selected-manage[open] {
  background: #ffffff;
}

.batch-forward-selected-manage summary {
  width: fit-content;
  min-height: 34px;
  padding: 5px 10px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 760;
}

.batch-forward-selected-manage-list {
  margin-top: 8px;
}

.batch-forward-selected-remove {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
  background: var(--surface);
}

.batch-forward-selected-remove svg,
.batch-forward-chip-list button svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.batch-forward-delivery-summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.batch-forward-limit-warning {
  color: var(--danger) !important;
  white-space: normal !important;
}

.batch-forward-footer-actions [data-batch-forward-action="confirm"] {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  font-weight: 760;
}

.batch-forward-status {
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.batch-forward-source-preview time {
  color: var(--ink-3);
  font-size: 11px;
}

.batch-forward-status.is-error,
.batch-forward-status.is-uncertain {
  background: color-mix(in srgb, var(--danger), var(--surface) 88%);
  color: var(--danger);
}

.batch-forward-status.is-offline {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.batch-forward-status.is-success {
  background: color-mix(in srgb, var(--ok), var(--surface) 88%);
  color: color-mix(in srgb, var(--ok), var(--ink) 20%);
}

.batch-forward-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface), transparent 18%);
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

body[data-theme="midnight"] .batch-forward-shell {
  background: color-mix(in srgb, var(--surface), #050812 8%);
}

body[data-theme="midnight"] .batch-forward-pane {
  background: color-mix(in srgb, var(--surface-soft), transparent 6%);
}

body[data-theme="midnight"] .batch-forward-row,
body[data-theme="midnight"] .batch-forward-message-preview-row,
body[data-theme="midnight"] .batch-forward-selected-remove {
  background: color-mix(in srgb, var(--surface), transparent 4%);
}

body[data-theme="aurora"] .batch-forward-shell,
body[data-theme="teal"] .batch-forward-shell,
body[data-theme="graphite"] .batch-forward-shell {
  background: var(--surface);
}

@media (max-width: 1280px) {
  .modal-card.batch-forward-modal-card {
    width: min(1040px, calc(100vw - 28px));
  }
}

@media (max-width: 1024px) {
  .modal-card.batch-forward-modal-card {
    width: min(940px, calc(100vw - 24px));
  }
}

@media (max-width: 620px) {
  .batch-forward-inline-bar {
    margin: 8px 10px 12px;
  }
}

@media (max-width: 480px) {
  .batch-forward-inline-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .batch-forward-inline-bar p {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .batch-forward-inline-cancel {
    grid-column: 1;
    grid-row: 2;
  }

  .batch-forward-inline-actions {
    grid-column: 2;
    grid-row: 2;
  }

  .batch-forward-inline-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .message-row.is-batch-forward-selecting,
  .message-row.is-batch-forward-selecting.is-me {
    width: min(100%, 680px);
    max-width: 94%;
  }
}

@media (forced-colors: active) {
  .message-row.is-batch-forward-selected,
  .batch-forward-inline-bar,
  .batch-forward-source-check span {
    border-color: Highlight;
  }

  .batch-forward-source-check input:checked + span {
    background: Highlight;
    color: HighlightText;
  }
}

/* Frozen responsive shell contract: 1180 detail overlay, 960 two-column,
   620 top navigation/single-column, 480 action reflow. Keep this final so
   legacy theme blocks cannot silently restore the obsolete 760px shell. */
@media (max-width: 960px) {
  :root {
    --rail-w: 64px;
    --mobile-side-w: min(340px, calc(100vw - var(--rail-w) - 24px));
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"],
  .im-shell[data-view="rtc"]:not(.is-detail-open),
  .im-shell[data-view="files"].is-detail-open,
  .im-shell[data-view="settings"].is-detail-open {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .side-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: var(--rail-w);
    width: var(--mobile-side-w);
    transform: translateX(calc(-100% - var(--rail-w)));
    visibility: hidden;
    pointer-events: none;
    transition: transform .18s ease, visibility 0s linear .18s;
    border-left: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface), #050812 12%);
  }

  .im-shell.is-list-open .side-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .list-scrim {
    position: fixed;
    z-index: 58;
    inset: 0 0 0 calc(var(--rail-w) + var(--mobile-side-w));
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--scrim);
  }

  .list-toggle {
    display: inline-grid;
  }
}

@media (max-width: 620px) {
  :root {
    --rail-h: 64px;
    --mobile-side-w: min(360px, 100vw);
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"],
  .im-shell[data-view="rtc"]:not(.is-detail-open),
  .im-shell[data-view="files"].is-detail-open,
  .im-shell[data-view="settings"].is-detail-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--rail-h) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }

  .app-rail {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: var(--rail-h);
    height: var(--rail-h);
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav,
  .rail-footer {
    width: auto;
    flex-direction: row;
    gap: 2px;
  }

  .rail-nav {
    min-width: 0;
    flex: 1;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-footer {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
  }

  .rail-item,
  .rail-user {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
  }

  .rail-item.is-active::before {
    inset: auto 12px -6px;
    width: auto;
    height: 3px;
  }

  .workspace {
    grid-column: 1;
    grid-row: 2;
  }

  .side-panel {
    top: var(--rail-h);
    left: 0;
    width: var(--mobile-side-w);
    transform: translateX(-104%);
    border-left: 0;
  }

  .list-scrim {
    inset: var(--rail-h) 0 0 var(--mobile-side-w);
  }

  .context-panel {
    top: var(--rail-h);
    width: 100vw;
  }

  .context-scrim {
    top: var(--rail-h);
    left: 0;
  }

  .mention-popover {
    left: 12px;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-side-w: 100vw;
  }

  .rtc-call-workspace .page-scroll {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .rtc-incoming-panel {
    width: 100%;
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "avatar"
      "copy"
      "actions";
    align-items: stretch;
    gap: 18px;
    padding: 20px 16px;
  }

  .rtc-incoming-panel .incoming-pulse-stage,
  .rtc-incoming-panel .rtc-call-copy {
    justify-self: center;
  }

  .rtc-incoming-panel .rtc-call-copy {
    text-align: center;
  }

  .rtc-incoming-panel.is-video .rtc-call-actions,
  .rtc-incoming-panel .rtc-call-actions {
    position: relative;
    z-index: 1;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .list-scrim {
    display: none;
  }

  .workspace-topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .topbar-title {
    flex: 1 1 100%;
  }

  .topbar-actions,
  .message-actions,
  .composer-toolbar,
  .composer-footer,
  .composer-actions {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .composer-input-row {
    flex-wrap: wrap;
  }

  .composer-input {
    flex: 1 1 calc(100% - 52px);
  }

  .attachment-file-card,
  .attachment-image-card,
  .attachment-video-card,
  .message-media {
    max-width: 100%;
  }

  .attachment-media-error-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .attachment-media-error-actions button,
  .attachment-file-action,
  .file-transfer-actions button,
  .attachment-confirm-modal footer button,
  .media-viewer-tools button {
    width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .attachment-file-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .attachment-file-action {
    grid-column: 1 / -1;
    max-width: none;
    text-align: center;
  }

  .composer-transfer-item,
  .composer-transfer-item.is-failed {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-transfer-actions,
  .attachment-confirm-modal footer,
  .media-viewer-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
}

/* Browser zoom can leave the layout viewport one device pixel narrower than
   100vw. Keep the shell parent-sized at the 200% ultra-narrow boundary so
   that rounding and fixed overlays cannot create page-level x overflow. */
@media (max-width: 320px) {
  html,
  body,
  #chat-root {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"],
  .im-shell[data-view="rtc"]:not(.is-detail-open),
  .im-shell[data-view="files"].is-detail-open,
  .im-shell[data-view="settings"].is-detail-open {
    width: 100%;
    max-width: 100%;
  }

  .workspace,
  .workspace-topbar,
  .topbar-title,
  .topbar-actions,
  .chat-top-stack,
  .message-stage,
  .message-scroll,
  .message-flow,
  .composer-panel,
  .composer-shell,
  .composer-footer,
  .composer-input-row {
    min-width: 0;
    max-width: 100%;
  }

  .topbar-title h1,
  .topbar-title p {
    overflow-wrap: anywhere;
  }
}

/* Six 44px primary targets cannot share a 240px top rail in one row. The
   navigation stays a top rail and uses a second row for the account control,
   keeping every target visible without shrinking its accessible hit area. */
@media (max-width: 260px) {
  :root {
    --rail-h: 112px;
  }

  .app-rail {
    min-height: var(--rail-h);
    height: var(--rail-h);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
  }

  .rail-nav {
    width: 100%;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    justify-items: center;
    gap: 0;
    overflow-x: visible;
  }

  .rail-footer {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin: 0;
  }

  .rail-item,
  .rail-user {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .rail-item.is-active::before {
    bottom: -2px;
  }
}

/* Overlay panels need an opaque theme surface: --surface is translucent in
   the dark workbench and otherwise lets the underlying page show through. */
@media (max-width: 1180px) {
  body[data-theme] .context-panel {
    background: var(--layer-surface);
  }
}

@media (max-width: 960px) {
  body[data-theme] .side-panel {
    background: var(--layer-surface);
  }
}

/* Size content against its available pane, including when desktop details are
   open. The existing visibility/breakpoint contract above remains authoritative. */
.composer-footer {
  flex-wrap: wrap;
}

.composer-toolbar {
  min-width: 0;
  flex-basis: 240px;
}

body[data-theme] .composer-enter-mode-control {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 44px;
  min-height: 36px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body[data-theme] .composer-enter-mode-control:hover:not(:disabled) {
  color: var(--ink);
}

body[data-theme] .composer-enter-mode-control:focus-visible {
  outline: 2px solid var(--ink-2);
  outline-offset: 2px;
}

body[data-theme] .composer-enter-mode-control:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
  text-decoration: none;
}

.message-stack .message-voice {
  min-width: 0;
  max-width: min(320px, 100%);
}

.message-stack .voice-message-body {
  grid-template-columns: minmax(0, 1fr) auto;
}

.message-stack .voice-waveform {
  min-width: 0;
}

.modal-layer {
  grid-template-columns: minmax(0, 1fr);
}

.modal-card {
  min-width: 0;
  max-width: 100%;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
}

.modal-card footer {
  flex-wrap: wrap;
}

/* Member profiles have four sections, unlike the generic three-row dialog.
   Do not squeeze the avatar/name section into the generic flexible row. */
.modal-card.member-profile-modal {
  grid-template-rows: none;
  grid-auto-rows: max-content;
  overflow-y: auto;
}

.media-viewer-modal {
  max-width: 100%;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
}

.media-viewer-modal:not(.user-avatar-preview-modal) {
  grid-template-rows: auto max-content auto;
}

/* Keep the message viewport inside the workspace: read visibility and message
   menus are anchored to .message-scroll. Only ancillary content may scroll. */
.chat-workspace .message-stage {
  flex: 1 0 min(96px, 20vh);
  flex: 1 0 min(96px, 20dvh);
  min-height: min(96px, 20vh);
  min-height: min(96px, 20dvh);
}

.chat-workspace .composer-panel {
  display: flex;
  flex: 0 1 auto;
  min-height: min(80px, 20vh);
  min-height: min(80px, 20dvh);
}

.chat-workspace .composer-shell {
  min-height: 0;
  overflow-y: auto;
  grid-auto-rows: max-content;
}

/* Search is an out-of-flow child of this stack. Scroll only the normal-flow
   status regions so their ancestor cannot clip the search overlay. */
.chat-top-stack {
  flex-shrink: 0;
  max-height: 20%;
}

.chat-top-stack > :not(.message-search-panel) {
  min-height: 0;
  overflow-y: auto;
}

.message-search-panel {
  max-height: 60vh;
  max-height: 60dvh;
  overflow-y: auto;
  grid-auto-rows: max-content;
}

/* When status strips also occupy a very short mobile pane, share the remaining
   height without making the workspace itself scroll when a control is focused. */
@media (max-width: 480px) and (max-height: 400px) {
  .chat-workspace:has(.chat-top-stack > :not(.message-search-panel)) .message-stage {
    flex-shrink: 1;
    min-height: 32px;
  }

  .chat-workspace:has(.chat-top-stack > :not(.message-search-panel)) .composer-panel {
    min-height: 44px;
  }
}

/* Older Chromium lacks relational selectors. In very short panes reserve
   usable message/input space conservatively, without scrolling the workspace. */
@supports not selector(:has(*)) {
  @media (max-width: 480px) and (max-height: 400px) {
    .chat-workspace .message-stage { flex-shrink: 1; min-height: 32px; }
    .chat-workspace .composer-panel { min-height: 44px; }
  }
}

@media (max-width: 720px), (max-height: 520px) {
  .message-search-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    left: 12px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-height: 520px) {
  .emoji-popover {
    bottom: 12px;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    min-height: 0;
  }

  .media-viewer-stage,
  .user-avatar-preview-stage,
  .user-avatar-preview-frame {
    min-height: min(40vh, 200px);
    min-height: min(40dvh, 200px);
  }

  .media-viewer-frame img,
  .media-viewer-frame video {
    max-width: 100%;
    max-height: 40vh;
    max-height: 40dvh;
  }
}

@media (min-width: 621px) and (max-height: 520px) {
  .app-rail {
    overflow-y: auto;
  }

  .rail-nav,
  .rail-footer {
    flex-shrink: 0;
  }
}

/* Unified authoritative identity presentation: verification and group members. */
.certification-name-slot {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(10rem, 48%);
  align-self: baseline;
  vertical-align: baseline;
}

.identity-name-line {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  vertical-align: baseline;
}

.identity-display-name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-metadata-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.verification-badge {
  --verification-accent: #285fb8;
  --verification-on-accent: #fff;
  --verification-surface: color-mix(in srgb, var(--verification-accent) 8%, var(--surface, #fff));
  --verification-border: color-mix(in srgb, var(--verification-accent) 28%, var(--line, transparent));
  --verification-label-limit: 9em;
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(100%, 12em);
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 2px 7px 2px 5px;
  border: 1px solid var(--verification-border);
  border-radius: 999px;
  background: var(--verification-surface);
  color: var(--verification-accent);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 740;
  line-height: 1.2;
  vertical-align: baseline;
  white-space: nowrap;
}

.verification-badge-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  place-items: center;
  color: var(--verification-accent);
}

.verification-badge-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.verification-badge-icon path:first-child {
  fill: currentColor;
  stroke: none;
}

.verification-badge-icon path:last-child {
  fill: none;
  stroke: var(--verification-on-accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verification-badge-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
}

.verification-badge-label {
  min-width: 0;
  max-width: var(--verification-label-limit);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verification-badge-source {
  display: none;
  min-width: 0;
  color: color-mix(in srgb, var(--verification-accent) 72%, var(--ink-2, #566177));
  font-size: 10px;
  font-weight: 620;
  line-height: 1.25;
}

.verification-badge.is-compact {
  --verification-label-limit: 7em;
  gap: 3px;
  min-height: 17px;
  padding: 1px 5px 1px 3px;
  font-size: 9px;
}

.verification-badge.is-compact .verification-badge-icon {
  width: 12px;
  height: 12px;
}

.verification-badge.is-standard {
  --verification-label-limit: 9em;
  min-height: 21px;
  font-size: 11px;
}

.verification-badge.is-detail {
  --verification-label-limit: none;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  gap: 8px;
  padding: 7px 11px 7px 8px;
  border-radius: 12px;
  font-size: 12px;
  white-space: normal;
}

.verification-badge.is-detail .verification-badge-icon {
  width: 21px;
  height: 21px;
}

.verification-badge.is-detail .verification-badge-copy {
  display: grid;
  gap: 2px;
}

.verification-badge.is-detail .verification-badge-label {
  max-width: 22em;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.verification-badge.is-detail .verification-badge-source {
  display: block;
}

[data-theme="midnight"] .verification-badge,
[data-theme="aurora"] .verification-badge {
  --verification-accent: #9dc0ff;
  --verification-on-accent: #10213d;
  --verification-surface: color-mix(in srgb, #5d91ee 18%, var(--surface, #172033));
  --verification-border: color-mix(in srgb, #9dc0ff 42%, var(--line, transparent));
}

/* A verified detail uses the same badge, not a page-private blue text box. */
.account-enterprise-certification {
  grid-column: 1 / -1;
}

.account-enterprise-certification.is-verified {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-soft), transparent 18%);
}

.account-certification-value {
  display: block;
  min-width: 0;
}

.account-info-list > span .verification-badge {
  width: fit-content;
  max-width: 100%;
}

.account-profile-card:not(.is-signed-out) {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "account-avatar account-name";
  align-items: center;
  column-gap: 14px;
}

.account-profile-card:not(.is-signed-out) > .identity-avatar-presence {
  grid-area: account-avatar;
}

.account-profile-card:not(.is-signed-out) > .account-name-block {
  grid-area: account-name;
  width: 100%;
}

.account-name-block .identity-name-line {
  flex: 0 1 auto;
}

/* Member rows reserve explicit avatar, primary, metadata, and action slots. */
.member-layout-row {
  --member-avatar-column: 40px;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--member-avatar-column) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.member-avatar-slot {
  width: var(--member-avatar-column);
  height: var(--member-avatar-column);
  min-width: var(--member-avatar-column);
  align-self: center;
}

.member-layout-row .member-avatar-slot > .avatar {
  width: 100%;
  height: 100%;
  min-width: 100%;
}

.member-primary-slot {
  min-width: 0;
  display: grid;
  justify-items: stretch;
  gap: 4px;
}

.member-primary-slot .identity-name-line {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 3px;
}

.member-primary-slot .certification-name-slot {
  width: fit-content;
  max-width: 100%;
  align-self: start;
}

.member-primary-slot .verification-badge {
  max-width: 100%;
}

.member-metadata-slot {
  min-height: 18px;
  justify-content: flex-start;
  overflow: hidden;
}

.member-metadata-slot .role-badge {
  max-width: 100%;
  min-width: 0;
}

.member-action-slot {
  width: 22px;
  height: 22px;
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  color: var(--ink-3);
}

.member-action-slot svg {
  width: 15px;
  height: 15px;
}

.member-grid,
.detail-member-strip {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
}

/* The group profile preview is one stable row of four equal identity tiles. */
.group-members-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.group-members-list .group-member-row.member-layout-row {
  min-height: 112px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--member-avatar-column) minmax(0, 1fr);
  align-items: start;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  text-align: center;
}

.group-members-list .member-primary-slot {
  width: 100%;
  justify-items: center;
  gap: 3px;
}

.group-members-list .identity-name-line {
  min-height: 35px;
  justify-items: center;
  align-content: start;
  gap: 2px;
}

.group-members-list .identity-display-name-text,
.group-members-list .certification-name-slot,
.group-members-list .verification-badge,
.group-members-list .verification-badge-copy,
.group-members-list .verification-badge-label {
  max-width: 100%;
}

.group-members-list .member-metadata-slot {
  justify-content: center;
}

.group-members-list .member-action-slot {
  display: none;
}

.member-card.member-layout-row,
.group-member-row.member-layout-row,
.context-member-pill.member-layout-row,
.detail-member.member-layout-row {
  min-height: 62px;
  place-items: initial;
  align-content: normal;
  justify-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 4%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 40%);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.member-card.member-layout-row:hover,
.group-member-row.member-layout-row:hover,
.context-member-pill.member-layout-row:hover,
.detail-member.member-layout-row:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 62%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 76%);
  transform: none;
}

.member-layout-row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 56%);
  outline-offset: 2px;
}

.member-card-copy .identity-metadata-line,
.detail-member-copy,
.detail-member-copy .identity-metadata-line {
  justify-content: flex-start;
  text-align: left;
}

.member-role-hero > div {
  min-width: 0;
}

.member-role-modal footer {
  flex-wrap: wrap;
}

.member-role-modal footer button {
  flex: 1 1 132px;
  min-width: 0;
}

.detail-member-more {
  width: 100%;
  min-height: 62px;
  height: auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 8px;
  border-radius: 14px;
}

@media (max-width: 560px) {
  .certification-name-slot {
    max-width: 44%;
  }

  .verification-badge {
    --verification-label-limit: 7em;
    max-width: min(100%, 8.5em);
  }

  .verification-badge.is-compact {
    --verification-label-limit: 5.8em;
  }

  .verification-badge.is-detail {
    width: 100%;
    max-width: 100%;
  }

  .account-profile-card:not(.is-signed-out) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "account-avatar account-name";
    justify-items: stretch;
    text-align: left;
  }

  .member-layout-row {
    --member-avatar-column: 36px;
    gap: 8px;
  }

  .member-grid,
  .detail-member-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-members-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .group-members-list .role-badge {
    gap: 3px;
    padding-inline: 2px;
    font-size: 10px;
  }
}

@media (forced-colors: active) {
  .presence-dot,
  .avatar-presence,
  .contact-presence,
  .status-dot::before,
  .inline-status > i,
  .behavior-live-state > i {
    border-color: Canvas;
    outline: 1px solid CanvasText;
    background: var(--soft);
    forced-color-adjust: none;
  }

  .presence-dot[data-status="online"],
  .avatar-presence[data-status="online"],
  .contact-presence[data-status="online"],
  .status-dot[data-status="online"]::before,
  .inline-status[data-status="online"] > i,
  .behavior-live-state[data-status="online"] > i {
    background: var(--ok);
  }

  .verification-badge {
    border: 2px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }

  .verification-badge-icon {
    color: CanvasText;
  }

  .verification-badge-icon path:last-child {
    stroke: Canvas;
  }

  .verification-badge-source {
    color: CanvasText;
  }

  .member-layout-row {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }
}

/* Certification label scheme 3: a stable check-and-label identity line. */
.verification-badge,
.identity-name-line .verification-badge,
.conversation-body .verification-badge,
.profile-large .verification-badge,
.account-info-list .verification-badge,
.certification-name-slot .verification-badge {
  --verification-accent: #245ca8;
  --verification-label-limit: 16em;
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 18em);
  min-height: 18px;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--verification-accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.3;
  text-align: left;
  vertical-align: baseline;
  white-space: nowrap;
}

.verification-badge-icon,
.identity-name-line .verification-badge-icon,
.conversation-body .verification-badge-icon,
.profile-large .verification-badge-icon,
.account-info-list .verification-badge-icon,
.certification-name-slot .verification-badge-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  place-items: center;
  color: currentColor;
}

.verification-badge-icon svg,
.verification-badge-icon path {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: currentColor;
  stroke: none;
}

.verification-badge .verification-badge-icon path:first-child:last-child {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}

.verification-badge-copy,
.identity-name-line .verification-badge-copy,
.conversation-body .verification-badge-copy,
.profile-large .verification-badge-copy,
.account-info-list .verification-badge-copy,
.certification-name-slot .verification-badge-copy {
  display: flex;
  min-width: min(3.5em, 100%);
  max-width: 100%;
  align-items: baseline;
}

.verification-badge-label,
.identity-name-line .verification-badge-label,
.conversation-body .verification-badge-label,
.profile-large .verification-badge-label,
.account-info-list .verification-badge-label,
.certification-name-slot .verification-badge-label {
  display: block;
  min-width: 0;
  max-width: var(--verification-label-limit);
  overflow: hidden;
  color: currentColor;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verification-badge.is-compact,
.identity-name-line .verification-badge.is-compact,
.conversation-body .verification-badge.is-compact,
.certification-name-slot .verification-badge.is-compact {
  --verification-label-limit: 11em;
  min-height: 17px;
  gap: 3px;
  font-size: 10px;
}

.verification-badge.is-compact .verification-badge-icon,
.identity-name-line .verification-badge.is-compact .verification-badge-icon,
.conversation-body .verification-badge.is-compact .verification-badge-icon,
.certification-name-slot .verification-badge.is-compact .verification-badge-icon {
  width: 13px;
  height: 13px;
}

.verification-badge.is-detail {
  --verification-label-limit: none;
  flex: 1 1 100%;
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  gap: 6px;
  padding: 0;
  font-size: 12px;
  white-space: normal;
}

.verification-badge.is-detail .verification-badge-copy {
  display: flex;
  min-width: 0;
}

.verification-badge.is-detail .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  line-break: strict;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
}

.certification-name-slot:has(.verification-badge.is-detail) {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
}

.identity-name-line:has(.verification-badge.is-detail) {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 4px;
}

/* Member popovers keep the badge next to the name; profile details center it below. */
.member-popover-head .identity-display-name-text,
.member-profile-hero .identity-display-name-text {
  flex: 0 1 auto;
}

.member-profile-hero h2.identity-name-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
  white-space: normal;
}

.member-profile-hero .certification-name-slot {
  order: 1;
  flex: 0 0 100%;
  max-width: 100%;
  justify-content: center;
}

.member-profile-hero .certification-name-slot .verification-badge {
  flex: 0 1 auto;
  justify-content: center;
  text-align: center;
}

.verification-badge:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--verification-accent), transparent 35%);
  outline-offset: 3px;
  border-radius: 4px;
}

.verification-badge:not(.is-detail):focus-visible {
  flex: 1 1 100%;
  max-width: 100%;
  white-space: normal;
}

.verification-badge:not(.is-detail):focus-visible .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
}

.identity-name-line:has(.verification-badge:focus-visible),
.certification-name-slot:has(.verification-badge:focus-visible) {
  position: relative;
  z-index: 80;
  overflow: visible;
}

.identity-name-line:has(.verification-badge:focus-visible) {
  flex-wrap: wrap;
}

body[data-theme="aurora"] .verification-badge {
  --verification-accent: #1f5aa6;
  color: var(--verification-accent);
}

body[data-theme="midnight"] .verification-badge,
[data-theme="midnight"] .verification-badge {
  --verification-accent: #9fc4ff;
  color: var(--verification-accent);
}

@media (max-width: 560px) {
  .certification-name-slot {
    max-width: 52%;
  }

  .verification-badge,
  .identity-name-line .verification-badge,
  .conversation-body .verification-badge {
    --verification-label-limit: 9em;
    max-width: 100%;
  }

  .verification-badge.is-compact,
  .identity-name-line .verification-badge.is-compact,
  .conversation-body .verification-badge.is-compact {
    --verification-label-limit: 7em;
  }

  .certification-name-slot:has(.verification-badge.is-detail) {
    max-width: 100%;
  }

  .group-members-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (forced-colors: active) {
  .verification-badge {
    border: 0;
    background: transparent;
    color: LinkText;
    forced-color-adjust: auto;
  }

  .verification-badge:focus-visible {
    outline: 2px solid Highlight;
  }

  .verification-badge .verification-badge-icon path:first-child:last-child {
    fill: LinkText;
    stroke: none;
  }
}

/* Server-owned private RTC terminal record. */
.is-rtc-call-record-bubble{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important}
.rtc-call-record-card{--rtc-record-bg:var(--surface-soft,#f6f8fc);--rtc-record-border:var(--line,#dfe5ef);--rtc-record-copy:var(--ink-1,#172033);--rtc-record-muted:var(--ink-3,#667085);--rtc-record-accent:var(--primary,#246bfe);display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;width:min(320px,100%);min-height:58px;padding:9px 11px;border:1px solid var(--rtc-record-border);border-radius:13px;background:var(--rtc-record-bg);color:var(--rtc-record-copy);font:inherit;text-align:left;cursor:pointer;transition:border-color 140ms ease,box-shadow 140ms ease,transform 140ms ease}.rtc-call-record-card:hover{border-color:color-mix(in srgb,var(--rtc-record-accent) 55%,var(--rtc-record-border));transform:translateY(-1px)}.rtc-call-record-card:focus-visible{outline:3px solid color-mix(in srgb,var(--rtc-record-accent) 32%,transparent);outline-offset:2px;border-color:var(--rtc-record-accent)}.rtc-call-record-card:disabled{cursor:wait;opacity:.72;transform:none}
.rtc-call-record-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;color:var(--rtc-record-accent);background:color-mix(in srgb,var(--rtc-record-accent) 12%,transparent)}.rtc-call-record-svg{width:20px;height:20px}.rtc-call-record-copy{display:grid;min-width:0;gap:2px}.rtc-call-record-copy strong{color:var(--rtc-record-copy);font-size:13px;font-weight:650}.rtc-call-record-status{overflow:hidden;color:var(--rtc-record-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.rtc-call-record-ended-at{color:var(--rtc-record-muted);font-size:11px;line-height:1.25}.rtc-call-record-card.is-danger .rtc-call-record-status{color:var(--danger,#d33f49)}.rtc-call-record-card.is-warning .rtc-call-record-status{color:var(--warn,#b46b16)}
.rtc-call-record-redial{color:var(--rtc-record-accent);font-size:12px;font-weight:650;white-space:nowrap}.rtc-call-record-direction{display:inline-flex;align-items:center;margin-left:3px;padding:1px 5px;border-radius:999px;background:color-mix(in srgb,var(--rtc-record-accent) 11%,transparent);color:var(--rtc-record-accent);font-size:10px;font-weight:750;line-height:1.4;vertical-align:1px}.rtc-call-record-card.viewport-narrow{grid-template-columns:32px minmax(0,1fr);width:min(274px,calc(100vw - 102px));min-height:54px;padding:8px 10px}.rtc-call-record-card.viewport-narrow .rtc-call-record-redial{grid-column:2}.rtc-call-record-card.viewport-narrow .rtc-call-record-status{overflow:visible;text-overflow:clip;white-space:normal}.rtc-call-record-fallback{color:var(--muted,#667085);font-size:13px}
@media (prefers-reduced-motion:reduce){.rtc-call-record-card{transition:none}.rtc-call-record-card:hover{transform:none}}
@media (forced-colors:active){.rtc-call-record-card{border:1px solid ButtonText;background:Canvas;color:CanvasText}.rtc-call-record-card:focus-visible{outline:3px solid Highlight}.rtc-call-record-direction,.rtc-call-record-icon{border:1px solid ButtonText;background:Canvas;color:CanvasText}}

/* Group member surfaces keep identity, search and actions stable as one local island. */
.group-member-surface {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.group-member-surface-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-member-surface-title {
  min-width: 0;
  display: inline-flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 7px;
  text-align: left;
}

.group-member-surface-title h3,
.group-member-surface-title span {
  min-width: 0;
  margin: 0;
}

.group-member-surface-title h3 {
  flex: 0 0 auto;
}

.group-member-surface-title span {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-surface-head .member-list-actions {
  position: static;
  z-index: auto;
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 0;
  background: none;
}

.group-member-invite-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.group-member-invite-button svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
}

.group-member-invite-button span {
  display: inline;
  line-height: 1;
}

.group-member-results {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.member-primary-slot .identity-name-line,
.member-primary-slot .identity-name-line:has(.verification-badge:focus-visible) {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--identity-inline-gap);
  overflow: hidden;
  text-align: left;
}

.member-primary-slot .identity-display-name-text {
  width: auto;
  min-width: 2ch;
  max-width: 100%;
  flex: 0 1 auto;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-primary-slot .certification-name-slot {
  min-width: 0;
  max-width: min(42%, 10rem);
  flex: 0 1 auto;
  align-self: center;
  overflow: hidden;
}

.member-primary-slot .certification-name-slot .verification-badge {
  width: 100%;
  max-width: 100%;
}

.member-primary-slot .key-user-marker {
  min-width: 0;
  max-width: 28%;
  flex: 0 1 auto;
  overflow: hidden;
}

.member-primary-slot .member-metadata-slot {
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  max-width: 100%;
  flex: 0 1 auto;
  justify-content: flex-start;
  overflow: hidden;
}

.member-primary-slot .member-metadata-slot .role-badge {
  min-width: 0;
  max-width: 5.5em;
  flex: 0 1 auto;
}

.member-primary-slot .member-metadata-slot .role-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-members-list .group-member-row.member-layout-row {
  text-align: left;
}

.group-members-list .member-primary-slot {
  align-items: stretch;
  justify-items: stretch;
  text-align: left;
}

.group-members-list .identity-name-line {
  min-height: 0;
  justify-content: flex-start;
  align-content: normal;
  justify-items: stretch;
  text-align: left;
}

.group-members-list .member-metadata-slot {
  justify-content: flex-start;
}

body[data-theme="teal"] .role-badge.is-owner,
body[data-theme="graphite"] .role-badge.is-owner {
  color: #8a5200;
}

@media (max-width: 560px) {
  .group-member-surface-head {
    gap: 8px;
  }

  .group-member-surface-title {
    gap: 5px;
  }

  .group-member-invite-button {
    padding-inline: 10px;
  }

  .member-primary-slot .certification-name-slot {
    max-width: 38%;
  }
}

@media (forced-colors: active) {
  .group-member-invite-button,
  .member-layout-row {
    forced-color-adjust: auto;
  }
}

/* One token and one inline geometry for member, message-sender and call identities. */
:root {
  --identity-inline-gap: 6px;
}

.message-meta > .message-sender-name {
  width: auto;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--identity-inline-gap);
  overflow: visible;
  vertical-align: middle;
}

.message-meta > .message-sender-name:has(.verification-badge:focus-visible) {
  flex-wrap: wrap;
  align-items: center;
  position: static;
  z-index: auto;
  overflow: visible;
}

.message-meta > .message-sender-name > .identity-display-name-text {
  order: 0;
  flex: 0 1 auto;
  min-width: 2ch;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta > .message-sender-name > .certification-name-slot {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  align-self: center;
  overflow: visible;
}

.message-meta > .message-sender-name > .certification-name-slot:has(.verification-badge:focus-visible) {
  position: static;
  z-index: auto;
  overflow: visible;
}

.message-meta > .message-sender-name .verification-badge:not(.is-detail):focus-visible {
  flex: 0 1 auto;
  max-width: 100%;
  outline-offset: -1px;
  white-space: normal;
}

.message-meta > .message-sender-name .verification-badge:not(.is-detail):focus-visible .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.message-meta > .message-sender-name > .certification-name-slot .verification-badge,
.call-identity-line > .certification-name-slot .verification-badge {
  width: 100%;
  max-width: 100%;
  align-items: center;
}

.message-meta > .message-sender-name > .certification-name-slot .verification-badge {
  width: auto;
  max-width: 100%;
  white-space: normal;
}

.message-meta > .message-sender-name .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.call-identity-line {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--identity-inline-gap);
  overflow: hidden;
  vertical-align: middle;
}

.call-identity-line:has(.verification-badge:focus-visible) {
  flex-wrap: nowrap;
  align-items: center;
}

.call-history-row .call-history-identity,
.rtc-record-card .rtc-contact-identity,
.rtc-detail-profile-card .rtc-detail-identity {
  display: inline-flex;
}

.call-identity-line > .identity-display-name-text {
  flex: 0 1 auto;
  min-width: 2ch;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-identity-line > .certification-name-slot {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(48%, 11em);
  align-self: center;
  overflow: hidden;
}

.call-history-row > span,
.rtc-contact-card > div:not(.rtc-contact-actions) {
  min-width: 0;
  text-align: left;
}

.call-history-row > .call-identity-avatar,
.rtc-contact-card > .call-identity-avatar,
.rtc-detail-profile-card > .call-identity-avatar {
  min-width: 0;
  display: inline-grid;
  place-items: center;
}

.call-history-identity {
  justify-content: flex-start;
  justify-self: start;
  text-align: left;
}

.rtc-contact-identity {
  justify-content: flex-start;
  justify-self: start;
  text-align: left;
}

.rtc-contact-actions {
  flex: 0 0 auto;
}

.rtc-record-grid {
  container-type: inline-size;
}

@container (max-width: 620px) {
  .rtc-contact-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rtc-contact-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .rtc-contact-actions button {
    flex: 1;
    justify-content: center;
  }
}

.rtc-detail-profile-card .rtc-detail-identity {
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  justify-self: center;
  text-align: center;
}

@media (max-width: 560px) {
  .call-identity-line > .certification-name-slot {
    max-width: 46%;
  }

  .message-meta > .message-sender-name > .certification-name-slot {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .message-meta > .message-sender-name,
  .call-identity-line {
    gap: 5px;
  }
}

@media (forced-colors: active) {
  .message-meta > .message-sender-name,
  .call-identity-line {
    forced-color-adjust: auto;
  }
}

/* Group member role labels stay optional and complete beside the stable arrow. */
.member-layout-row {
  --member-action-column: 28px;
  grid-template-columns: var(--member-avatar-column) minmax(0, 1fr) max-content var(--member-action-column);
  column-gap: 8px;
}

.member-primary-slot {
  grid-column: 2;
  min-width: 0;
}

.member-role-slot {
  grid-column: 3;
  min-width: max-content;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  overflow: visible;
  white-space: nowrap;
}

.member-role-slot .role-badge {
  min-width: max-content;
  max-width: none;
  flex: 0 0 auto;
  overflow: visible;
  white-space: nowrap;
}

.member-role-slot .role-badge span {
  min-width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.member-action-slot {
  grid-column: 4;
  width: var(--member-action-column);
  min-width: var(--member-action-column);
  height: var(--member-action-column);
}

.group-members-list {
  grid-template-columns: minmax(0, 1fr);
}

.group-members-list .group-member-row.member-layout-row {
  min-height: 60px;
  grid-template-columns: var(--member-avatar-column) minmax(0, 1fr) max-content var(--member-action-column);
  grid-template-rows: none;
  align-items: center;
  justify-items: stretch;
  gap: 8px;
  padding: 9px 10px;
  text-align: left;
}

.group-members-list .member-primary-slot {
  width: auto;
  min-width: 0;
  justify-items: stretch;
}

.group-members-list .identity-name-line {
  min-height: 0;
  justify-content: flex-start;
  align-content: normal;
  text-align: left;
}

.group-members-list .member-action-slot {
  display: inline-grid;
}

@media (max-width: 560px) {
  .member-layout-row {
    --member-action-column: 26px;
    column-gap: 7px;
  }

  .group-members-list .group-member-row.member-layout-row {
    gap: 7px;
    padding-inline: 8px;
  }
}


/* Personal certification uses the same authority as the existing name marker.
   Decoration is out of flow; group/company avatars never receive this child. */
.has-avatar-certification,
:is(.avatar, .directory-avatar, .signed-out-avatar, .message-avatar, .detail-avatar, .incoming-avatar).has-avatar-certification,
.rail-user > span.has-avatar-certification {
  position: relative;
  overflow: visible;
  border-radius: 50%;
}
.has-avatar-certification > img[data-avatar-image] {
  border-radius: 50%;
}
.avatar-certification-decoration {
  position: absolute;
  inset: 0;
  container-type: inline-size;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.avatar-certification-ring {
  position: absolute;
  inset: -1.5%;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1.5px rgb(47 107 255 / 92%);
  box-shadow: inset 0 0 0 max(1.5px, 4.5cqi) rgb(47 107 255 / 92%);
  border-radius: 50%;
}
.avatar-certification-shield {
  position: absolute;
  right: -1%;
  bottom: -1%;
  width: max(13px, 33%);
  height: auto;
  display: block;
  overflow: visible;
}

/* Keep connectivity and certification separate, matching iOS corner placement. */
.has-avatar-certification > .avatar-presence,
.conversation-avatar-wrap.has-certified-avatar > .avatar-presence,
.identity-avatar-presence.has-certified-avatar > .avatar-presence,
.member-avatar-wrap.has-certified-avatar > .avatar-presence,
.rail-user.has-certified-avatar > .presence-dot {
  left: 0;
  right: auto;
}

/* Mirror the contact dot onto the circle's left edge, clear of the shield. */
.contact-avatar-wrap.has-certified-avatar > .contact-presence {
  left: 6px;
  right: auto;
}

/* Keep the conversation indicator above the avatar decoration without moving rows. */
.conversation-avatar-wrap {
  overflow: visible;
  isolation: isolate;
}
.conversation-avatar-wrap > .avatar-presence {
  z-index: 3;
}

/* Clip the image itself; the message avatar's ring and shield remain outside it. */
.message-row.has-certified-avatar {
  overflow-clip-margin: 3px;
}
.message-row > .message-avatar.has-avatar-certification {
  overflow: visible;
  isolation: isolate;
}
.message-row > .message-avatar > img[data-avatar-image],
.message-row > .message-avatar > .avatar-fallback {
  border-radius: 50%;
  clip-path: circle(50%);
}

.topbar-behavior-entry[data-action="open-behavior-analysis"] {
  width: auto;
  min-width: 38px;
  padding-inline: 6px;
  white-space: nowrap;
}

.user-context-profile > div {
  width: 100%;
}
.user-context-profile h3.identity-name-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
  white-space: normal;
}
.user-context-profile .identity-display-name-text {
  flex: 0 1 auto;
}
.user-context-profile .certification-name-slot {
  order: 1;
  flex: 0 0 100%;
  max-width: 100%;
  justify-content: center;
}
.user-context-profile .certification-name-slot .verification-badge {
  flex: 0 1 auto;
  justify-content: center;
  text-align: center;
}

.behavior-base-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
.behavior-base-status button {
  flex-shrink: 0;
  white-space: nowrap;
}
.behavior-profile-presence > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Group member previews and complete lists share a four-column avatar matrix. */
.member-grid,
.detail-member-strip,
.group-members-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.member-layout-row.member-layout-tile,
.group-members-list .group-member-row.member-layout-tile {
  min-width: 0;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px 20px;
  align-content: start;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 10px 3px 6px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: none;
  transition: border-color .15s, background-color .15s;
}
.member-layout-row.member-layout-tile:hover,
.group-members-list .group-member-row.member-layout-tile:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}
.member-layout-row.member-layout-tile:focus-visible,
.group-members-list .group-member-row.member-layout-tile:focus-visible {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  box-shadow: none;
  transform: none;
}
.member-layout-tile .member-avatar-slot {
  position: relative;
  grid-column: 1;
  width: 40px;
  height: 40px;
  overflow: visible;
}
.member-layout-tile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.member-layout-tile .avatar img {
  border-radius: 50%;
}
.member-layout-tile .member-primary-slot,
.group-members-list .member-layout-tile .member-primary-slot {
  grid-column: 1;
  display: block;
  width: 100%;
  min-width: 0;
  text-align: center;
}
.member-layout-tile .member-primary-slot .identity-name-line,
.group-members-list .member-layout-tile .identity-name-line {
  display: flex;
  width: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.member-layout-tile .identity-display-name-text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  text-align: center;
}
.member-layout-tile .member-role-slot {
  position: absolute;
  top: -5px;
  right: -4px;
  z-index: 1;
}
.member-layout-tile .member-avatar-slot .member-role-slot .role-badge {
  background: var(--bg-soft);
  gap: 2px;
  padding: 2px 3px;
  font-size: 10px;
}
body[data-theme="teal"] .member-layout-tile .member-role-slot .role-badge.is-owner,
body[data-theme="graphite"] .member-layout-tile .member-role-slot .role-badge.is-owner {
  background: #fff6df;
}
.member-layout-tile .member-role-slot .role-badge svg {
  width: 11px;
  height: 11px;
}
.member-layout-tile .member-action-slot,
.group-members-list .member-layout-tile .member-action-slot {
  display: none;
}
.group-member-invite-button.primary-button {
  background: #245fc8;
  border: 1px solid #245fc8;
  color: #fff;
  opacity: 1;
}
.group-member-invite-button.primary-button span {
  color: inherit;
}
.group-member-invite-button.primary-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: #194ca6;
  color: #fff;
}
.group-member-invite-button.primary-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.context-kind-group .context-overview .group-member-invite-button.primary-button:is(:disabled, [aria-disabled="true"]),
.group-member-invite-button.primary-button:disabled,
.group-member-invite-button.primary-button[aria-disabled="true"] {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink-2);
  box-shadow: none;
}
.context-kind-group .context-overview .group-member-invite-button.primary-button:is(:disabled, [aria-disabled="true"]) svg {
  color: inherit;
}
@media (forced-colors: active) {
  .group-member-invite-button.primary-button {
    background: ButtonFace;
    border-color: ButtonText;
    color: ButtonText;
  }
}

/* Global search: distinct failure, partial result, and empty states. */
.global-search-results .global-search-empty,
.global-search-results .global-search-category-empty,
.global-search-results .global-search-note {
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}
.global-search-results .global-search-empty .ghost-action,
.global-search-results .global-search-category-empty .ghost-action,
.global-search-results .global-search-note .ghost-action {
  justify-self: start;
}
.global-search-results .global-search-empty.is-error,
.global-search-results .global-search-category-empty.is-error {
  border-color: color-mix(in srgb, var(--danger), var(--line) 58%);
  color: var(--danger);
}
.global-search-results .global-search-category-empty.is-degraded {
  border-color: color-mix(in srgb, var(--warn), var(--line) 58%);
  color: var(--warn);
}
.global-search-results .global-search-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px;
}
.global-search-results .global-search-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.global-search-results .global-search-tab.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--ink);
}
.global-search-results .global-search-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* The independent group workspace uses its available width; drawers stay four columns. */
.group-workspace-members .member-grid {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.group-workspace-member-scroll { padding: 2px; }
.group-workspace-member-scroll > .group-member-results > .member-grid {
  max-height: min(536px, 60dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.group-workspace-members .group-member-surface-head { align-items: center; gap: 12px; }
.group-workspace-members .group-member-surface-head h3 { margin: 0; }
.group-workspace-members .member-filter-bar { margin-block: 10px; }
.group-workspace-members .member-filter-field { min-width: 0; flex: 1; }
.group-profile-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.group-profile-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 600;
  line-height: 22px;
  transform: none;
}
.group-profile-actions > button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.group-profile-actions > .primary-button { background: var(--grad); color: #fff; }
.group-profile-actions > .secondary-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
}
.group-profile-actions > button:is(:hover, :active) { transform: none; }
.group-profile-actions > button:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--primary);
  filter: brightness(1.06);
}
.group-profile-actions > .secondary-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.group-profile-actions > button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.group-profile-actions > button:is(:disabled, [aria-disabled="true"]) {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-3);
  box-shadow: none;
  filter: none;
  cursor: not-allowed;
}

.global-search-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.global-search-head > strong { min-width: 0; overflow-wrap: anywhere; flex: 1 1 150px; }
.global-search-head > span { color: var(--ink-2); font-size: 12px; }
.global-search-empty { padding: 18px 14px; }
.global-search-empty > strong { color: var(--ink); }
.global-search-empty > span { color: var(--ink-2); line-height: 1.6; }
.global-search-category-empty { line-height: 1.6; }
.global-search-category-empty.is-guidance { color: var(--ink-2); }


/* The time picker stays in the existing modal body, never above its footer. */
.modal-card.group-mute-modal { max-height: min(100%, calc(100vh - 24px)); max-height: min(100%, calc(100dvh - 24px)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; }
.group-mute-modal .group-mute-form { min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; grid-auto-rows: max-content; }
.group-mute-modal .group-mute-time-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; }
.group-mute-modal .group-mute-time-row:nth-of-type(2) { border-bottom: 0; }
.group-mute-time-value { grid-column: 3; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); font-variant-numeric: tabular-nums; }
.group-mute-time-value svg { width: 14px; height: 14px; }
.group-mute-time-picker { min-width: 0; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); }
.group-mute-time-picker-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.group-mute-time-picker-title span { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.group-mute-time-picker-title svg { width: 16px; height: 16px; color: var(--primary); }
.group-mute-time-picker-title b { font-size: 20px; font-variant-numeric: tabular-nums; }
.group-mute-time-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.group-mute-time-column { min-width: 0; display: grid; gap: 6px; text-align: center; color: var(--ink-2); font-size: 12px; }
.group-mute-time-options { position: relative; height: min(168px,28vh); height: min(168px,28dvh); min-height: 80px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); scrollbar-width: thin; }
.group-mute-time-options button { display: block; width: 100%; min-height: 40px; margin: 2px 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.group-mute-time-options button[aria-selected="true"] { border-color: var(--primary); background: color-mix(in srgb,var(--primary),transparent 85%); color: var(--ink); font-weight: 800; }
.group-mute-time-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group-mute-time-picker-actions button { min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--ink); font: inherit; font-weight: 700; }
.group-mute-time-picker-actions .primary-button { background: var(--grad); color: #fff; }
.group-mute-time-row:hover:not(:disabled), .group-mute-time-options button:hover:not(:disabled), .group-mute-time-picker-actions button:hover:not(:disabled) { border-color: var(--primary); background-color: color-mix(in srgb,var(--primary),transparent 88%); }
.group-mute-time-row:focus-visible, .group-mute-time-options button:focus-visible, .group-mute-time-picker-actions button:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
.group-mute-modal button:disabled { cursor: not-allowed; opacity: .55; }
.group-mute-modal[aria-busy="true"] button:disabled { cursor: wait; }
@media (max-width: 480px) { .group-mute-time-row { gap: 6px; padding-inline: 10px; } .group-mute-time-value { padding: 8px; } }

.detail-setting-row > .group-dissolve-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger), transparent 45%);
  background: color-mix(in srgb, var(--danger), transparent 94%);
}
.detail-setting-row > .group-dissolve-entry:hover {
  background: color-mix(in srgb, var(--danger), transparent 87%);
}
.detail-setting-row > .group-dissolve-entry:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.group-dissolve-entry > span { white-space: nowrap; }
.group-dissolve-entry > svg { width: 18px; height: 18px; flex: 0 0 18px; }

/* Group ownership controls share the same layout in the full page and sidebar. */
.group-owner-actions{display:flex;flex-wrap:wrap;gap:10px;padding-top:18px;margin-top:18px;border-top:1px solid var(--line,rgba(130,145,170,.16))}
.group-owner-actions .group-owner-action{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 1 auto;min-height:38px;padding:8px 13px;border:1px solid rgba(105,117,255,.24);border-radius:10px;background:rgba(105,117,255,.06);color:var(--primary,#6674ee);font-size:12px;white-space:nowrap;cursor:pointer}
.group-owner-actions .group-dissolve-entry{width:auto;min-height:44px;color:#e45b70;border-color:rgba(228,91,112,.27);background:rgba(228,91,112,.045)}
.group-owner-action svg,.group-mute-list-label>svg{width:16px;height:16px;flex:0 0 16px}
.group-mute-list-label{display:flex;align-items:center;gap:9px}
.group-mute-list-label>svg{color:#dca452}
.group-owner-transfer-modal{width:min(560px,calc(100vw - 28px));height:min(660px,calc(100vh - 36px));height:min(660px,calc(100dvh - 36px));max-height:calc(100vh - 36px);max-height:calc(100dvh - 36px);display:flex;flex-direction:column;overflow:hidden}
.group-owner-transfer-modal .notice-modal-head{flex:0 0 auto;padding:20px 22px;gap:12px}
.group-owner-transfer-modal .notice-modal-title{min-width:0;display:flex;align-items:center;gap:12px}
.group-owner-transfer-modal .notice-modal-title>div{min-width:0}
.group-owner-transfer-modal .notice-modal-title p{max-width:380px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-owner-title-icon{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;border-radius:13px;background:linear-gradient(135deg,#6096ff,#8874ff);color:white}
.group-owner-title-icon svg{width:22px;height:22px}
.group-owner-transfer-modal .group-owner-transfer-body{display:flex;flex-direction:column;gap:13px;padding:18px 22px;flex:1;min-height:0;overflow:hidden}
.group-owner-transfer-note{margin:0;color:var(--muted,#8994ad);font-size:12px;line-height:1.7}
.group-owner-search{display:flex;align-items:center;gap:9px;flex:0 0 auto;padding:10px 12px;border:1px solid var(--line,rgba(130,145,170,.18));border-radius:11px;background:rgba(136,150,180,.055)}
.group-owner-search svg{width:17px;height:17px;color:var(--muted,#8994ad)}
.group-owner-search input{width:100%;min-width:0;border:0!important;background:transparent!important;outline:none;padding:0!important;font-size:13px}
.group-owner-search:focus-within{border-color:#8993ff;box-shadow:0 0 0 3px rgba(110,124,255,.10)}
.group-owner-list-heading{display:flex;justify-content:space-between;gap:10px;font-size:12px;font-weight:600}
.group-owner-list-heading small{font-weight:400;color:var(--muted,#8994ad)}
.group-owner-transfer-candidates{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0;overflow-y:scroll;overscroll-behavior:contain;scrollbar-gutter:stable;padding:2px 6px 2px 2px;scrollbar-width:thin;scrollbar-color:#bbc4d9 transparent}
.group-owner-transfer-candidates::-webkit-scrollbar{width:7px}
.group-owner-transfer-candidates::-webkit-scrollbar-thumb{background:#bbc4d9;border-radius:8px}
.group-owner-transfer-candidate{position:relative;display:flex;align-items:center;gap:12px;flex:0 0 auto;min-height:70px;padding:11px 12px;border:1px solid var(--line,rgba(130,145,170,.18));border-radius:12px;cursor:pointer;background:var(--surface,#fff);transition:border-color .15s,background .15s}
.group-owner-transfer-candidate:hover{border-color:#a7afff;background:rgba(105,117,255,.025)}
.group-owner-transfer-candidate.is-selected{border-color:#8090ff;background:rgba(105,117,255,.065);box-shadow:0 0 0 1px rgba(105,117,255,.12)}
.group-owner-transfer-candidate:focus-within{outline:2px solid #7b89ff;outline-offset:1px}
.group-owner-transfer-candidate>input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.group-owner-transfer-modal .avatar{width:40px;height:40px;flex:0 0 40px;border-radius:50%}
.group-owner-identity{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.group-owner-identity strong,.group-owner-identity small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-owner-identity strong{font-size:13px}
.group-owner-identity small{font-size:11px;color:var(--muted,#8994ad)}
.group-owner-choice{display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border:1.5px solid #cad1df;border-radius:50%}
.is-selected>.group-owner-choice{background:#7684ff;border-color:#7684ff;color:white}
.group-owner-choice svg{width:14px;height:14px}
.group-owner-empty{margin:auto;text-align:center;max-width:230px;color:var(--muted,#8994ad);font-size:13px;line-height:1.7}
.group-owner-transfer-modal .group-owner-transfer-footer{display:flex;justify-content:space-between;align-items:center;gap:14px;flex:0 0 auto;padding:16px 22px;border-top:1px solid var(--line,rgba(130,145,170,.16));background:var(--surface,#fff)}
.group-owner-selected{display:flex;align-items:center;gap:9px;min-width:0;flex:1}
.group-owner-selected .avatar{width:32px;height:32px;flex-basis:32px}
.group-owner-selected>span{min-width:0;display:flex;flex-direction:column;gap:3px}
.group-owner-selected strong{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.group-owner-selected small,.group-owner-unselected{font-size:11px;color:var(--muted,#8994ad)}
.group-owner-footer-buttons{display:flex;gap:9px;flex:0 0 auto}
.group-owner-footer-buttons>button{min-height:38px;padding:9px 16px;border-radius:10px;white-space:nowrap}
.group-owner-transfer-modal .form-error{flex:0 0 auto;margin:0;font-size:12px}
.group-owner-confirm-target{display:flex;align-items:center;gap:14px;padding:22px 18px;border:1px solid rgba(105,117,255,.2);border-radius:14px;background:rgba(105,117,255,.04);margin-top:12px}
.group-owner-confirm-target .avatar{width:54px;height:54px;flex-basis:54px}
.group-owner-confirm-note{padding:14px;border-radius:12px;font-size:12px;line-height:1.8;color:#936c32;background:rgba(232,185,91,.08)}
.group-owner-transfer-modal.is-confirming{height:auto;min-height:360px}
@media(max-width:480px){.group-owner-transfer-modal .notice-modal-head{padding:16px}.group-owner-transfer-modal .group-owner-transfer-body{padding:14px 16px;gap:11px}.group-owner-transfer-modal .group-owner-transfer-footer{padding:14px 16px;flex-wrap:wrap}.group-owner-selected{min-width:100%;}.group-owner-footer-buttons{width:100%;justify-content:flex-end}.group-owner-footer-buttons>button{flex:1}.group-owner-transfer-modal .notice-modal-title p{max-width:230px}}
@media(max-height:560px){.group-owner-transfer-note{font-size:11px}.group-owner-transfer-modal .notice-modal-head{padding:12px 16px}.group-owner-transfer-modal .group-owner-transfer-body{padding:10px 16px;gap:8px}.group-owner-transfer-modal .group-owner-transfer-footer{padding:10px 16px}}

.group-owner-actions>.detail-setting-row{width:100%}
.detail-setting-row > .group-leave-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 0;
  text-align: left;
}
.group-leave-entry > svg { width: 16px; height: 16px; flex: 0 0 16px; }

.group-owner-transfer-modal.is-confirming .group-owner-transfer-body{overflow-y:auto;overscroll-behavior:contain}
.group-owner-transfer-modal.is-confirming .group-owner-transfer-body>*{flex-shrink:0}

/* These editors have a bounded body between header and actions. Grid content
   must scroll within its row instead of painting over the footer in short windows. */
.password-change-body,
.group-profile-modal > .group-profile-editor,
.my-avatar-modal > .group-profile-editor,
.attachment-confirm-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  align-content: start;
  grid-auto-rows: max-content;
}
/* Admission errors add a fourth section; keep the actual footer out of an
   implicit grid row and let only the preview body shrink. */
.modal-card.attachment-confirm-modal {
  display: flex;
  flex-direction: column;
}
.attachment-confirm-modal > header,
.attachment-confirm-modal > .modal-error,
.attachment-confirm-modal > footer {
  flex: 0 0 auto;
}
.attachment-confirm-modal > .attachment-confirm-body { flex: 0 1 auto; }
/* Report sender, excerpt and form are separate sections. Like member profiles,
   use one reachable scrolling surface rather than a three-row grid. */
.modal-card.message-report-modal {
  grid-template-rows: none;
  grid-auto-rows: max-content;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-height: 480px) {
  /* At this height the transfer header/search/footer cannot all fit around a
     useful list. Scroll the card as a whole, with a real candidate viewport. */
  .modal-card.group-owner-transfer-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
  }
  .group-owner-transfer-modal .group-owner-transfer-body { flex: 0 0 auto; }
  .group-owner-transfer-modal .group-owner-transfer-body > * { flex-shrink: 0; }
  .group-owner-transfer-candidates { flex: 0 0 auto; height: min(180px, 40vh); min-height: 112px; }
  .group-mute-list-body { overflow-y: auto; overscroll-behavior: contain; }
  .group-mute-list-add, .group-mute-list-section { flex: 0 0 auto; }
  .group-mute-list-candidates, .group-mute-list-rows { height: 112px; }
}

/* Default group friends: only the enhanced create/invite drawer uses this layout. */
.drawer-card:is(.drawer-invite, .drawer-group-create):has([data-default-group-picker]) {
  width: min(760px, calc(100vw - 28px));
}
[data-default-group-picker] {
  container-type: inline-size;
  min-width: 0;
  color: var(--ink);
  gap: 12px;
}
[data-default-group-picker] .group-member-picker-fields { max-height: 58%; gap: 10px; }
[data-default-group-picker] .default-group-feature {
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 65%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 70%);
}
[data-default-group-picker] .default-group-feature p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
[data-default-group-picker] .default-group-feature-head,
[data-default-group-picker] .default-group-restore,
[data-default-group-picker] .default-group-dirty-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
[data-default-group-picker] .default-group-feature-head strong { font-size: 14px; }
[data-default-group-picker] .default-group-feature-summary {
  display: flex;
  flex: 1 1 160px;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
[data-default-group-picker] .default-group-feature-summary > strong { flex: 0 0 auto; }
[data-default-group-picker] .default-group-feature-head > button { flex: 0 0 auto; align-self: flex-start; }
[data-default-group-picker] .default-group-saved-avatars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 3px;
}
[data-default-group-picker] .default-group-saved-avatar { display: inline-flex; flex: 0 0 auto; }
[data-default-group-picker] .default-group-saved-avatar > .avatar { width: 24px; height: 24px; font-size: 11px; }

[data-default-group-picker] .default-group-count {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  color: var(--primary);
  background: var(--surface);
  font-size: 12px;
}
[data-default-group-picker] .default-group-restore {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
[data-default-group-picker] .default-group-restore small {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 11px;
}
[data-default-group-picker] button { min-height: 44px; }
[data-default-group-picker] .default-group-feature button,
[data-default-group-picker] .default-group-dirty-note button {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--primary);
  background: var(--surface);
}
[data-default-group-picker] button:disabled { cursor: not-allowed; opacity: .6; }
[data-default-group-picker] button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
[data-default-group-picker] .invite-search-field input { min-height: 44px; }
[data-default-group-picker] .invite-friend-list { grid-template-columns: minmax(0, 1fr); padding: 2px 4px 4px 2px; }
[data-default-group-picker] .invite-friend-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
}
[data-default-group-picker] .invite-friend-row.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 65%);
}
[data-default-group-picker] .invite-friend-row.is-disabled { opacity: 1; }
[data-default-group-picker] .invite-friend-row .avatar { width: 36px; height: 36px; }
[data-default-group-picker] .invite-friend-row > .status-dot { display: none; }
[data-default-group-picker] .group-create-selected-list .invite-friend-row { grid-template-columns: 36px minmax(0, 1fr); }
[data-default-group-picker] .invite-friend-row button { padding: 0 9px; font-size: 12px; }
[data-default-group-picker] .identity-name-line { align-items: center; gap: 4px; flex-wrap: nowrap; }
[data-default-group-picker] .identity-display-name-text { flex: 0 1 auto; }
[data-default-group-picker] .identity-name-line > :not(.identity-display-name-text) { flex-shrink: 0; }
[data-default-group-picker] .identity-name-line .verification-badge { max-width: 82px; }
[data-default-group-picker] .invite-friend-copy small { font-size: 11px; }
[data-default-group-picker] .invite-friend-copy .default-group-person-state { color: var(--ink-3); }
[data-default-group-picker] .default-group-selection { flex: 0 1 auto; min-height: 0; }
[data-default-group-picker] .default-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  max-height: min(116px, 18dvh);
  overflow: auto;
  padding: 3px;
  overscroll-behavior: contain;
}
[data-default-group-picker] .default-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 3px 9px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface-soft);
}
[data-default-group-picker] .default-group-chip .avatar { width: 26px; height: 26px; flex: 0 0 26px; }
[data-default-group-picker] .default-group-chip > span:not(.avatar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-default-group-picker] .default-group-chip > span[aria-hidden] { flex: 0 0 auto; }
[data-default-group-picker] .group-create-actions { padding-top: 10px; }
[data-default-group-picker] .default-group-dirty-note { flex: 0 0 auto; color: var(--ink-2); }
@container (min-width: 650px) {
  [data-default-group-picker] .invite-friend-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-default-group-picker] .invite-search-note.is-error,
[data-default-group-picker] .default-group-feature .is-error { color: var(--danger); }

/* Use the existing modal/button palette without replacing the underlying draft. */
.chat-confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.chat-confirm-dialog::backdrop { background: rgba(12, 18, 35, .48); backdrop-filter: blur(4px); }
.chat-confirm-dialog h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.4; }
.chat-confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.75; overflow-wrap: anywhere; }
.chat-confirm-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chat-confirm-dialog button { min-height: 40px; padding: 9px 16px; border-radius: 11px; }
.chat-confirm-dialog button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@media (max-width: 360px) {
  .chat-confirm-dialog { padding: 20px; }
  .chat-confirm-dialog footer button { flex: 1 1 auto; }
}

/* Recent successful accounts share the existing theme palette. */
.login-layout { position: relative; z-index: 1; display: grid; justify-items: center; gap: 24px; width: min(1100px, 100%); min-width: 0; }
.recent-logins { box-sizing: border-box; width: min(100%, max(540px, calc(var(--recent-columns) * 246px + (var(--recent-columns) - 1) * 12px + 48px))); min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: color-mix(in srgb, var(--surface), transparent 3%); }
.web-login-form .quick-login-limit { color: var(--danger, #dc3545); font-size: 12px; }
.recent-logins-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent-logins-heading h2 { margin: 0; font-size: 15px; font-weight: 750; color: var(--ink); }
.recent-logins-heading > span { color: var(--muted); font-size: 11px; }
.recent-logins-note, .recent-logins-empty { margin: 8px 0 16px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.recent-logins-empty { padding: 12px; border-radius: 12px; background: var(--surface); text-align: center; }
.recent-logins-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 2px; }
.recent-logins-list { display: grid; gap: 12px; width: min(100%, calc(var(--recent-columns) * 246px + (var(--recent-columns) - 1) * 12px)); margin-inline: auto; min-width: calc(var(--recent-columns) * 208px + (var(--recent-columns) - 1) * 12px); }
.recent-logins-row { display: grid; grid-template-columns: repeat(var(--recent-columns), minmax(0, 1fr)); gap: 12px; width: 100%; padding: 0; margin: 0; list-style: none; }
.recent-logins-row li { position: relative; display: flex; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.recent-login-choice { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 24px 10px 7px; background: transparent; border: 0; border-radius: 12px; text-align: left; color: var(--ink); }
.recent-login-avatar { position: relative; display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; border-radius: 13px; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); font-weight: 750; }
.recent-login-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recent-login-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.recent-login-copy strong, .recent-login-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-login-copy strong { font-size: 13px; font-weight: 650; }
.recent-login-copy small { color: var(--muted); font-size: 11px; }
.recent-login-remove { position: absolute; right: 4px; top: 4px; width: 26px; min-height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; }
.recent-login-choice:hover, .recent-login-remove:hover { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); }
.recent-logins button:focus-visible, .recent-logins-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.recent-logins button:disabled { opacity: .55; cursor: wait; }
.login-screen { align-items: safe center; }
@media (max-width: 600px) {
  .login-layout { gap: 16px; }
  .recent-logins { padding: 18px 14px; border-radius: 20px; }
}


/* Compact layouts keep navigation and call actions within their own pane. */
.list-panel-back { display: none; }
@media (max-width: 960px) {
  .list-panel-back { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .settings-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .settings-pane-head { flex-wrap: wrap; }
  .settings-pane-head > div { flex: 1; min-width: 0; }
  .settings-pane-head h2, .settings-pane-head .lead { overflow-wrap: anywhere; }
  .rtc-idle-workspace .page-scroll { grid-auto-rows: max-content; gap: 16px; padding: 16px; }
  .rtc-empty-panel { min-height: 0; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px; }
  .rtc-empty-visual { width: 64px; height: 64px; border-radius: 20px; }
  .rtc-empty-icon svg { width: 30px; height: 30px; }
  .rtc-empty-copy h2 { font-size: 22px; }
  .rtc-empty-copy p:not(.eyebrow) { font-size: 13px; }
  .rtc-contact-actions button { min-height: 44px; }
  .rtc-video-preflight { min-width: 0; max-width: 100%; min-height: 0; grid-template-rows: auto minmax(100px, 26dvh) auto auto; gap: 12px; padding: 16px; }
  .rtc-video-preflight > *, .rtc-video-preflight-copy { min-width: 0; max-width: 100%; }
  .rtc-video-preflight-copy h2 { overflow-wrap: anywhere; }
  .rtc-video-preflight > .rtc-video-frame { min-height: 0; }
  .rtc-video-frame-label { max-width: 100%; }
  .rtc-video-workspace.is-active-call .rtc-video-stage { grid-template-rows: minmax(120px, 34dvh) auto; }
  .rtc-video-local-pip { width: min(100%, 112px); height: 90px; }
  .rtc-video-workspace.is-active-call .rtc-call-actions.call-controls { position: static; flex: 0 0 auto; z-index: 4; padding: 10px; gap: 8px; }
  .rtc-video-workspace .rtc-reversible-controls { width: 100%; }
  .rtc-video-workspace .rtc-reversible-controls .call-answer { flex: 1; min-width: 0; }
  .rtc-video-workspace .rtc-downgrade-action, .rtc-video-workspace .rtc-isolated-hangup { width: auto; flex: 1; min-width: 0; margin-inline-start: 0; }
  .rtc-call-workspace.is-active-call:not(.rtc-video-workspace) .page-scroll { grid-template-rows: minmax(min-content, 1fr) auto; gap: 12px; padding: 12px; }
  .rtc-call-workspace.is-active-call .page-scroll { display: flex; flex-direction: column; overflow: hidden; }
  .rtc-call-workspace.is-active-call .rtc-voice-stage { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; gap: 12px; padding: 8px; }
  .rtc-video-workspace.is-active-call .rtc-video-stage { flex: 1 1 auto; height: auto; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  .rtc-voice-avatar-stage { width: 150px; height: 150px; }
  .rtc-voice-controls { position: static; flex: 0 0 auto; z-index: 4; }
  .rtc-voice-control { min-height: 88px; padding: 6px 4px; grid-template-rows: 38px auto auto; }
  .rtc-voice-control > span { width: 36px; height: 36px; }
  .rtc-voice-control svg { width: 20px; height: 20px; }
  .group-workspace-member-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; }
  .incoming-call-notice { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .incoming-call-card { min-width: 0; max-width: 100%; min-height: 0; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 20px 16px; }
  .incoming-call-main, .incoming-copy { width: 100%; min-width: 0; max-width: 100%; }
  .incoming-copy .identity-name-line { max-width: 100%; justify-content: center; }
  .incoming-copy .identity-display-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .incoming-call-actions { gap: 8px; }
  .incoming-call-actions button { padding-inline: 8px; min-height: 48px; }
}
@media (max-width: 620px) {
  .app-rail { padding-top: calc(6px + env(safe-area-inset-top)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .composer-panel { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .page-scroll, .side-content { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .rtc-empty-panel { padding: 16px; gap: 12px; }
  .rtc-empty-visual { width: 52px; height: 52px; border-radius: 16px; }
  .rtc-empty-copy h2 { font-size: 20px; }
}
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 620px) { :root { --rail-h: calc(64px + env(safe-area-inset-top)); } }
  @media (max-width: 260px) { :root { --rail-h: calc(112px + env(safe-area-inset-top)); } }
}
@media (max-width: 960px) and (max-height: 520px) {
  .rtc-call-workspace .workspace-topbar { min-height: 56px; flex-wrap: nowrap; }
  .rtc-call-workspace .topbar-title { flex: 1 1 0; min-width: 0; }
  .rtc-call-workspace .topbar-actions { width: auto; flex-wrap: nowrap; gap: 4px; }
  .rtc-video-workspace.is-active-call .rtc-video-stage { grid-template-rows: minmax(0, 1fr); grid-template-areas: "remote remote"; }
  .rtc-video-stage-status { position: absolute; left: 8px; bottom: 8px; min-height: 28px; padding-inline: 8px; gap: 6px; }
  .rtc-video-local-pip { position: absolute; right: 8px; bottom: 8px; height: 60px; width: 80px; }
  .rtc-video-preflight { grid-template-rows: auto minmax(72px, 24dvh) auto auto; }
  .rtc-call-workspace.is-active-call .rtc-voice-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 6px; }
  .rtc-voice-call-meta { grid-column: 1; grid-row: 1; }
  .rtc-voice-peer { grid-column: 2; grid-row: 1 / 3; }
  .rtc-voice-self-card { grid-column: 1; grid-row: 2; }
  .rtc-voice-avatar-stage { width: 96px; height: 96px; }
  .rtc-voice-avatar-stage .avatar { width: 64px; height: 64px; min-width: 64px; min-height: 64px; }
  .rtc-voice-self-card { min-height: 64px; padding: 8px 12px; }
  .rtc-voice-self-card .avatar { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .incoming-call-card { gap: 10px; padding: 12px; }
  .incoming-call-main { gap: 8px; }
  .incoming-avatar { width: 72px; height: 72px; }
  .incoming-avatar > .incoming-avatar-core { width: 64px; height: 64px; min-width: 64px; min-height: 64px; border-radius: 22px; }
  .incoming-copy strong { font-size: 20px; }
}

/* Shared with the standards inert polyfill; keep it in the existing stylesheet. */
[inert] { pointer-events: none; cursor: default; }
[inert], [inert] * { user-select: none; -webkit-user-select: none; -ms-user-select: none; }

/* Unsupported var()-based colors can invalidate component focus shorthands. */
@supports not (color: color-mix(in srgb, black, white)) {
  :focus-visible { outline: 2px solid currentColor !important; outline-offset: -2px !important; }
}

/* Bounded member DOM; records/search/pagination remain owned by the model. */
.member-grid.is-virtualized {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-height: 480px;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  align-content: start;
}
.member-grid.is-virtualized .member-virtual-spacer {
  flex: 0 0 100%;
  width: 100%;
  pointer-events: none;
  min-height: 0;
}
.member-grid.is-virtualized .member-virtual-item { flex-grow: 0; flex-shrink: 0; box-sizing: border-box; min-width: 0; padding-left: 6px; padding-right: 6px; }
.member-grid.is-virtualized .member-virtual-item > .member-card { width: 100%; height: 100%; }

html[data-low-resource-mode],
html[data-low-resource-mode] *,
html[data-low-resource-mode] *::before,
html[data-low-resource-mode] *::after {
  animation: none !important;
  transition: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
}

html[data-low-resource-mode],
html[data-low-resource-mode] :not(:focus-visible),
html[data-low-resource-mode] *::before,
html[data-low-resource-mode] *::after {
  box-shadow: none !important;
}

html[data-chat-input-priority] :is(.side-content, .message-flow, .composer-shell, .context-panel) {
  contain: inline-size;
}

html[data-native-composer-sizing] .composer-input textarea {
  field-sizing: content;
  overflow-y: auto;
  transition: none;
}

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --rail-w: 68px;
  --side-w: 320px;
  --detail-w: 400px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow-sm: 0 8px 18px rgba(26, 37, 64, 0.12);
  --shadow-lg: 0 24px 70px rgba(26, 37, 64, 0.2);
  --unread-badge-bg: linear-gradient(135deg, #ff6577 0%, #e11d48 100%);
  --unread-badge-shadow: rgba(225, 29, 72, 0.32);
  --unread-badge-ring: rgba(255, 255, 255, 0.82);
}

body[data-theme="aurora"] {
  color-scheme: light;
  --bg: #e9edf6;
  --rail: #f2f5fb;
  --rail-ink: #56627d;
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --surface-strong: #eef2f8;
  --ink: #1b2336;
  --muted: #56627d;
  --soft: #93a0b8;
  --line: #e3e8f2;
  --primary: #4f8cff;
  --primary-soft: #e8f0ff;
  --secondary: #7c6bff;
  --accent: #3aa0ff;
  --ok: #1aa97a;
  --warn: #b9791a;
  --danger: #e2566a;
  --unread-badge-bg: linear-gradient(135deg, #ff6b7d 0%, #e11d48 100%);
  --unread-badge-shadow: rgba(225, 29, 72, 0.28);
  --bubble-me: #e8f0ff;
  --bubble-other: #f1f4fa;
  --mention-user-bg: #e7f0ff;
  --mention-user-ink: #2f63c7;
  --mention-user-ring: rgba(79, 140, 255, 0.3);
  --mention-user-hover-bg: #dce9ff;
  --mention-all-bg: #fff0c2;
  --mention-all-ink: #9a5b00;
  --mention-all-ring: rgba(180, 112, 0, 0.36);
  --mention-all-hover-bg: #ffe6a3;
  --scrim: rgba(40, 52, 86, 0.32);
}

body[data-theme="teal"] {
  --bg: #f2fbf9;
  --rail: #10231f;
  --rail-ink: #d9f6f0;
  --surface: #ffffff;
  --surface-soft: #e9f6f3;
  --surface-strong: #d7ece8;
  --ink: #12302b;
  --muted: #5d756f;
  --soft: #82928f;
  --line: #cde2de;
  --primary: #0d9488;
  --primary-soft: #dcf7f2;
  --secondary: #2563eb;
  --accent: #ea580c;
  --ok: #087f5b;
  --warn: #a65f00;
  --danger: #c92f2f;
  --unread-badge-bg: linear-gradient(135deg, #f56565 0%, #c81e3a 100%);
  --unread-badge-shadow: rgba(200, 30, 58, 0.26);
  --bubble-me: #dff5ef;
  --bubble-other: #ffffff;
  --mention-user-bg: #ddf7f3;
  --mention-user-ink: #08786f;
  --mention-user-ring: rgba(13, 148, 136, 0.28);
  --mention-user-hover-bg: #cbf1eb;
  --mention-all-bg: #fff0c2;
  --mention-all-ink: #8f4e00;
  --mention-all-ring: rgba(166, 95, 0, 0.34);
  --mention-all-hover-bg: #ffe5a3;
  --scrim: rgba(16, 35, 31, 0.48);
}

body[data-theme="graphite"] {
  --bg: #f5f6f8;
  --rail: #1f2937;
  --rail-ink: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #eef0f3;
  --surface-strong: #e1e5ea;
  --ink: #182230;
  --muted: #667085;
  --soft: #8c95a1;
  --line: #d9dee7;
  --primary: #365d8f;
  --primary-soft: #e7eef7;
  --secondary: #0d9488;
  --accent: #b85f2e;
  --ok: #087f5b;
  --warn: #a65f00;
  --danger: #c92f2f;
  --unread-badge-bg: linear-gradient(135deg, #f56565 0%, #c81e3a 100%);
  --unread-badge-shadow: rgba(200, 30, 58, 0.26);
  --bubble-me: #e6eef7;
  --bubble-other: #ffffff;
  --mention-user-bg: #e6eef8;
  --mention-user-ink: #2f5f9d;
  --mention-user-ring: rgba(54, 93, 143, 0.3);
  --mention-user-hover-bg: #dce8f5;
  --mention-all-bg: #fff0c2;
  --mention-all-ink: #884d00;
  --mention-all-ring: rgba(166, 95, 0, 0.34);
  --mention-all-hover-bg: #ffe5a3;
  --scrim: rgba(24, 34, 48, 0.5);
}

body[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #070a12;
  --rail: #0a0e18;
  --rail-ink: #e8edf9;
  --surface: #121826;
  --surface-soft: #171f30;
  --surface-strong: #1e2740;
  --ink: #e8edf9;
  --muted: #9aa6c2;
  --soft: #5c6680;
  --line: #232c44;
  --primary: #5b9dff;
  --primary-soft: #18233f;
  --secondary: #7c6bff;
  --accent: #6ad6ff;
  --ok: #37e0a6;
  --warn: #ffcc6b;
  --danger: #ff6f7d;
  --unread-badge-bg: linear-gradient(135deg, #ff7b8b 0%, #ff3d5e 100%);
  --unread-badge-shadow: rgba(255, 61, 94, 0.38);
  --unread-badge-ring: rgba(255, 255, 255, 0.18);
  --bubble-me: #2f57c2;
  --bubble-other: #161d2e;
  --mention-user-bg: rgba(91, 157, 255, 0.18);
  --mention-user-ink: #9cc9ff;
  --mention-user-ring: rgba(91, 157, 255, 0.3);
  --mention-user-hover-bg: rgba(91, 157, 255, 0.26);
  --mention-all-bg: rgba(255, 204, 107, 0.2);
  --mention-all-ink: #ffd166;
  --mention-all-ring: rgba(255, 204, 107, 0.34);
  --mention-all-hover-bg: rgba(255, 204, 107, 0.28);
  --scrim: rgba(4, 7, 14, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body,
#chat-root {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.16s var(--ease-out),
    border-color 0.16s var(--ease-out),
    color 0.16s var(--ease-out),
    opacity 0.16s var(--ease-out),
    transform 0.16s var(--ease-out),
    box-shadow 0.16s var(--ease-out);
}

button:hover {
  border-color: var(--line);
  background: var(--primary-soft);
}

@supports (color: color-mix(in srgb, black, white)) {
  button:hover {
    border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
    background: color-mix(in srgb, var(--primary-soft), var(--surface) 40%);
  }
}

button:active {
  opacity: 0.78;
  transform: translateY(1px);
}

button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 30%);
  outline-offset: 2px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 72px;
  resize: none;
  padding: 10px 12px;
  line-height: 1.55;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

p {
  line-height: 1.55;
}

small,
time {
  color: var(--muted);
  font-size: 12px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft), transparent 45%);
  background-clip: content-box;
}

.im-shell {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(288px, var(--side-w)) minmax(0, 1fr);
  background: var(--bg);
  overflow: hidden;
}

.im-shell.is-detail-open {
  grid-template-columns: var(--rail-w) minmax(292px, var(--side-w)) minmax(0, 1fr);
}

.app-rail,
.side-panel,
.workspace,
.context-panel {
  min-width: 0;
  min-height: 0;
}

.app-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 6px;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-button {
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.brand-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rail-nav,
.rail-footer {
  display: grid;
  gap: 6px;
  align-content: start;
}

.rail-item {
  position: relative;
  width: 54px;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px 3px;
  border-color: transparent;
  background: transparent;
  color: color-mix(in srgb, var(--rail-ink), transparent 15%);
}

.rail-item:hover,
.rail-item.is-active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 3px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
}

.rail-mark {
  font-size: 16px;
  font-weight: 800;
}

.rail-label {
  font-size: 10px;
}

.rail-badge {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.rail-user {
  position: relative;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
}

.presence-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--rail);
  border-radius: 999px;
  background: var(--soft);
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 10%);
  overflow: hidden;
}

.account-block,
.panel-search {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.account-block {
  display: grid;
  gap: 9px;
}

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

.account-copy,
.conversation-body,
.file-text,
.plain-row span,
.topbar-title,
.topbar-title div,
.profile-large div {
  min-width: 0;
}

.account-copy strong,
.conversation-body strong,
.file-text strong,
.plain-row strong,
.profile-large h2,
.profile-large h3 {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy span,
.conversation-body span,
.file-text small,
.plain-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.account-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.data-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), var(--surface) 86%);
  color: var(--primary);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.data-source-pill.is-mock {
  border-color: color-mix(in srgb, #f0b84a, transparent 55%);
  background: color-mix(in srgb, #f0b84a, var(--surface) 84%);
  color: color-mix(in srgb, #f0b84a, var(--ink) 34%);
}

.data-source-pill.is-live {
  border-color: color-mix(in srgb, var(--ok), transparent 56%);
  background: color-mix(in srgb, var(--ok), var(--surface) 88%);
  color: color-mix(in srgb, var(--ok), var(--ink) 30%);
}

.data-source-banner {
  width: calc(100% - 36px);
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 18px 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, #f0b84a, transparent 52%);
  border-radius: 12px;
  background: color-mix(in srgb, #f0b84a, var(--surface) 86%);
  color: color-mix(in srgb, #f0b84a, var(--ink) 28%);
  font-size: 12px;
  font-weight: 760;
}

.data-source-banner strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.data-source-topbar-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, #f0b84a, transparent 54%);
  border-radius: 999px;
  background: color-mix(in srgb, #f0b84a, var(--surface) 88%);
  color: color-mix(in srgb, #d29a2d, var(--ink) 28%);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  vertical-align: middle;
}

.status-button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok), transparent 65%);
  background: color-mix(in srgb, var(--ok), transparent 92%);
}

.theme-strip {
  display: flex;
  align-items: center;
  gap: 7px;
}

.theme-strip button {
  position: relative;
  width: 26px;
  min-width: 26px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  overflow: hidden;
}

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

.theme-strip button::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 5px;
  background: var(--primary);
  box-shadow: inset -8px 0 0 var(--secondary), inset -16px 0 0 var(--accent);
}

.theme-strip button[data-theme-choice="teal"]::before {
  background: #0d9488;
  box-shadow: inset -8px 0 0 #2563eb, inset -16px 0 0 #ea580c;
}

.theme-strip button[data-theme-choice="graphite"]::before {
  background: #365d8f;
  box-shadow: inset -8px 0 0 #0d9488, inset -16px 0 0 #b85f2e;
}

.theme-strip button[data-theme-choice="midnight"]::before {
  background: #60a5fa;
  box-shadow: inset -8px 0 0 #2dd4bf, inset -16px 0 0 #fb923c;
}

.theme-strip button.is-active,
.filter-tabs button.is-active,
.context-tabs button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 750;
}

.search-field {
  position: relative;
  display: block;
}

.search-field span {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: transparent;
  width: 15px;
  height: 15px;
  border: 2px solid var(--soft);
  border-radius: 999px;
  pointer-events: none;
}

.search-field span::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  background: var(--soft);
  transform: rotate(45deg);
  border-radius: 999px;
}

.search-field input {
  padding-left: 38px;
  min-height: 38px;
}

.filter-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.filter-tabs button {
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.side-content,
.page-scroll,
.message-scroll,
.context-body,
.drawer-body {
  overflow: auto;
}

.side-content {
  padding: 8px 10px 12px;
}

.side-section-head {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  color: var(--muted);
}

.side-section-head strong {
  color: var(--ink);
}

.side-section-head button {
  min-height: 30px;
  padding: 0 9px;
}

.conversation-stack,
.plain-list,
.file-list,
.card-list {
  display: grid;
  gap: 6px;
}

.plain-list.compact {
  margin-top: 4px;
}

.conversation-card,
.plain-row,
.file-card {
  width: 100%;
  display: grid;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.conversation-card {
  align-items: center;
}

.conversation-body {
  min-width: 0;
  display: block;
}

.conversation-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  position: relative;
  min-height: 68px;
  padding: 8px 9px;
}

.plain-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 8px 9px;
}

.plain-row i,
.setting-nav-row i {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.file-card {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 64px;
  padding: 8px 9px;
}

.conversation-card:hover,
.conversation-card.is-active,
.plain-row:hover,
.plain-row.is-active,
.file-card:hover,
.file-card.is-active,
.member-card:hover {
  border-color: var(--line);
  background: var(--surface);
}

.conversation-card.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.line-one {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.line-two,
.line-three {
  margin-top: 2px;
}

.conversation-state b {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.conversation-state i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

.avatar-fallback,
.avatar img[data-avatar-image] {
  grid-area: 1 / 1;
}

.avatar img,
.directory-avatar img,
.signed-out-avatar img,
.rail-user img,
.incoming-avatar > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.avatar img[data-avatar-image],
.directory-avatar img[data-avatar-image],
.signed-out-avatar img[data-avatar-image],
.message-avatar img[data-avatar-image],
.detail-avatar img[data-avatar-image],
.incoming-avatar img[data-avatar-image] {
  visibility: hidden;
}

.avatar img[data-avatar-image].is-avatar-loaded,
.directory-avatar img[data-avatar-image].is-avatar-loaded,
.signed-out-avatar img[data-avatar-image].is-avatar-loaded,
.message-avatar img[data-avatar-image].is-avatar-loaded,
.detail-avatar img[data-avatar-image].is-avatar-loaded,
.incoming-avatar img[data-avatar-image].is-avatar-loaded {
  visibility: visible;
}

.avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.directory-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.signed-out-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.message-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.detail-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.incoming-avatar:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback,
.rail-user > span:has(img[data-avatar-image].is-avatar-loaded) .avatar-fallback {
  visibility: hidden;
}

.avatar:has(img[data-avatar-image].is-avatar-loaded),
.avatar-soft:has(img[data-avatar-image].is-avatar-loaded),
.avatar-user:has(img[data-avatar-image].is-avatar-loaded),
.message-avatar:has(img[data-avatar-image].is-avatar-loaded),
.detail-avatar:has(img[data-avatar-image].is-avatar-loaded),
.directory-avatar:has(img[data-avatar-image].is-avatar-loaded),
.signed-out-avatar:has(img[data-avatar-image].is-avatar-loaded),
.incoming-avatar:has(img[data-avatar-image].is-avatar-loaded),
.contact-avatar-wrap .avatar-xl:has(img[data-avatar-image].is-avatar-loaded),
.conversation-card .avatar:has(img[data-avatar-image].is-avatar-loaded),
.conversation-avatar-wrap .avatar:has(img[data-avatar-image].is-avatar-loaded) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.avatar img.is-avatar-broken {
  display: none;
}

.avatar-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar-user {
  background: var(--secondary);
}

.avatar-xl {
  width: 62px;
  height: 62px;
  font-size: 22px;
}

.avatar.is-system {
  background: var(--accent);
}

.file-type {
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.pill,
.tag,
.status-pill,
.ok-chip,
.alert-chip,
.message-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
}

.pill,
.tag {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
}

.pill.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 65%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.status-pill,
.ok-chip {
  min-height: 28px;
  padding: 0 10px;
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok), transparent 62%);
  background: color-mix(in srgb, var(--ok), transparent 92%);
}

.status-pill[data-status="offline"] {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--muted), transparent 62%);
  background: color-mix(in srgb, var(--muted), transparent 92%);
}

.alert-chip {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: color-mix(in srgb, var(--bg), var(--surface) 8%);
}

.chat-workspace {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chat-top-stack {
  position: relative;
  z-index: 18;
  min-width: 0;
  display: grid;
}

.chat-top-stack:empty {
  display: none;
}

.workspace-topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 8%);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.hero-actions,
.button-row,
.message-actions,
.composer-footer,
.call-controls,
.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row.vertical {
  align-items: stretch;
  flex-direction: column;
}

.icon-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.detail-action {
  min-width: 56px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: color-mix(in srgb, var(--primary), #000 10%);
  color: #fff;
}

.danger-button {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 45%);
}

.danger-button:hover {
  background: color-mix(in srgb, var(--danger), transparent 91%);
}

.list-toggle {
  display: none;
}

.room-strip,
.conversation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 54%);
}

.room-strip-main,
.conversation-hero div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-strip span,
.conversation-hero span {
  color: var(--muted);
  font-size: 12px;
}

.room-strip strong {
  color: var(--ink);
  font-size: 12px;
}

.room-strip-main > span:first-child {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
}

.room-strip-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-strip-actions button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), transparent 18%);
}

.message-scroll {
  padding: 16px 24px 18px;
  overflow-anchor: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 38%), transparent 120px),
    color-mix(in srgb, var(--bg), var(--surface) 7%);
}

.message-flow {
  width: 100%;
  max-width: 980px;
  min-height: 100%;
  display: grid;
  align-content: start;
  margin: 0 auto;
}

.timeline-marker,
.system-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-marker {
  margin: 2px 0 14px;
}

.system-line {
  margin: 10px 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 42px;
}

.system-line span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.chat-history-skeleton {
  min-height: min(520px, 72vh);
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 8px 0 24px;
}

.chat-history-skeleton-row {
  width: min(520px, 82%);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.chat-history-skeleton-row.is-short {
  width: min(390px, 66%);
}

.chat-history-skeleton-row.is-me {
  width: min(460px, 74%);
  justify-self: end;
  grid-template-columns: minmax(0, 1fr);
}

.chat-history-skeleton-row i,
.chat-history-skeleton-row b {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--surface-soft), transparent 6%), color-mix(in srgb, var(--line), transparent 10%), color-mix(in srgb, var(--surface-soft), transparent 6%));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.1s linear infinite;
}

.chat-history-skeleton-row i {
  width: 32px;
  height: 32px;
}

.chat-history-skeleton-row.is-me i {
  display: none;
}

.chat-history-skeleton-row b {
  height: 58px;
  border-radius: 14px;
}

.message-virtual-spacer {
  width: 1px;
  min-height: 0;
  pointer-events: none;
}

@keyframes skeleton-shimmer {
  to { background-position: -220% 0; }
}

.message-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 680px);
  align-items: start;
  gap: 9px;
  margin-bottom: 12px;
  /* The virtual message window already bounds mounted rows. Placeholder
     heights here shift the reading anchor after a detail-panel width change. */
  animation: message-in 0.22s var(--ease-out);
}

.message-row.is-me {
  grid-template-columns: minmax(0, 680px);
  justify-content: end;
}

.message-scroll.is-restored-primary-view .message-row {
  animation: none;
}

.message-row > .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.message-stack {
  min-width: 0;
  display: grid;
  gap: 4px;
  position: relative;
}

.message-row.is-me .message-stack {
  justify-items: end;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bubble {
  max-width: min(680px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bubble-other);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink), transparent 94%);
}

.message-row.is-me .bubble {
  background: var(--bubble-me);
  border-color: color-mix(in srgb, var(--primary), var(--line) 70%);
}

.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.is-group-invite-approval-bubble {
  width: min(520px, 100%);
  padding: 0;
  overflow: hidden;
}

.group-invite-approval-card {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.group-invite-approval-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-invite-approval-head span {
  font-weight: 800;
  color: var(--ink);
}

.group-invite-approval-head em,
.group-invite-approval-result {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.group-invite-approval-result {
  display: grid;
  gap: 3px;
}

.group-invite-approval-result small {
  color: var(--ink-3);
}

.group-invite-approval-head em {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.group-invite-approval-head em[data-status="pending"] {
  color: #b7791f;
  border-color: rgba(245, 158, 11, .28);
  background: rgba(245, 158, 11, .12);
}

.group-invite-approval-head em[data-status="approved"] {
  color: #0f9f6e;
  border-color: rgba(16, 185, 129, .25);
  background: rgba(16, 185, 129, .12);
}

.group-invite-approval-head em[data-status="rejected"] {
  color: #e2566a;
  border-color: rgba(226, 86, 106, .28);
  background: rgba(226, 86, 106, .12);
}

.group-invite-approval-copy {
  display: grid;
  gap: 4px;
}

.group-invite-approval-copy strong {
  color: var(--ink);
  line-height: 1.45;
}

.group-invite-approval-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.group-invite-approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.bubble blockquote {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: var(--surface-soft);
}

.bubble blockquote b,
.bubble blockquote span {
  display: block;
  font-size: 12px;
}

.bubble blockquote span {
  color: var(--muted);
  margin-top: 2px;
}

.attachment-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  text-align: left;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 36%);
}

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

.attachment-card small {
  color: var(--muted);
}

.attachment-image-card {
  max-width: 100%;
  min-width: 0;
  display: block;
  padding: 8px;
}

.attachment-video-card {
  width: min(190px, 100%);
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

.attachment-image-card img {
  display: block;
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-soft);
}

.attachment-video-thumb {
  position: relative;
  display: block;
  aspect-ratio: var(--media-ratio, 16 / 9);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #080d18;
}

.attachment-video-thumb img,
.attachment-video-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.attachment-video-thumb i,
.media-play-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .48);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.attachment-video-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.attachment-video-info strong,
.attachment-video-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-video-meta {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.attachment-video-thumb i svg,
.media-play-dot svg {
  width: 20px;
  height: 20px;
}

.attachment-image-card span {
  display: block;
  margin-top: 8px;
}

.file-transfer-progress {
  position: relative;
  display: block;
  height: 18px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft), var(--line) 40%);
}

.file-transfer-progress i {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.file-transfer-progress em {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0 8px;
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-thumb {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
}

.media-file-thumb img,
.media-file-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-file-thumb.is-video .media-play-dot {
  width: 22px;
  height: 22px;
  background: rgba(5, 10, 22, .62);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}

.media-file-thumb.is-video video {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.media-file-thumb.is-video .media-play-dot svg {
  width: 12px;
  height: 12px;
}

.message-edited-mark {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong), transparent 18%);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.message-edited-mark time {
  color: inherit;
  font-size: 10.5px;
}

.message-row.is-me .message-edited-mark {
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .78);
}

.message-pinned-mark {
  width: fit-content;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong), transparent 18%);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.message-row.is-me .message-pinned-mark {
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .78);
}

body[data-theme="aurora"] .message-row.is-me .message-edited-mark {
  background: rgba(255, 255, 255, .48);
  color: #53627f;
}

body[data-theme="aurora"] .message-row.is-me .message-pinned-mark {
  background: rgba(255, 255, 255, .48);
  color: #53627f;
}

.message-foot {
  display: grid;
  align-items: start;
  justify-items: start;
  gap: 3px;
  min-height: 20px;
}

.message-state {
  min-height: 22px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface-soft);
}

button.message-state {
  border: 0;
  cursor: pointer;
}

button.message-state:hover {
  color: var(--primary);
  text-decoration: underline;
  box-shadow: none;
}

.message-state[data-state="failed"] {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.message-actions button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
}

.message-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  max-width: min(460px, 100%);
  max-height: 0;
  margin-top: -2px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    max-height 0.16s var(--ease-out),
    margin-top 0.16s var(--ease-out),
    padding 0.16s var(--ease-out),
    opacity 0.14s var(--ease-out),
    transform 0.14s var(--ease-out),
    visibility 0.14s var(--ease-out);
}

.message-row:hover .message-actions,
.message-row:focus-within .message-actions,
.message-row.is-failed .message-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  max-height: 72px;
  margin-top: 1px;
  padding: 2px 0 0;
  transform: translateY(0);
}

.quick-reaction-bar {
  position: absolute;
  z-index: 5;
  top: -28px;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transition:
    opacity 0.14s var(--ease-out),
    transform 0.14s var(--ease-out);
}

.message-row:not(.is-me) .quick-reaction-bar {
  left: 0;
}

.message-row.is-me .quick-reaction-bar {
  right: 0;
}

.message-row:hover .quick-reaction-bar,
.message-row:focus-within .quick-reaction-bar {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.quick-reaction-bar button,
.reaction-strip button,
.emoji-grid button {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
}

.quick-reaction-bar button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.reaction-strip { display: flex; flex-wrap: wrap; }
.reaction-strip button { display: inline-flex; align-items: center; }

.composer-panel {
  padding: 10px 24px 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 6%);
}

.composer-shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 7px;
  margin: 0 auto;
}

.reply-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.reply-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
}

.reply-copy b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.reply-copy em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-bar button {
  min-height: 26px;
  flex: 0 0 auto;
}

.reply-clear-button {
  padding: 0 10px;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 40%);
}

.composer-toolbar,
.tool-dock {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.composer-tool,
.tool-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 0 8px;
  background: var(--surface);
}

.composer-tool span,
.tool-button span {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: var(--primary-soft);
  font-weight: 800;
  color: var(--primary);
  font-size: 11px;
}

.composer-tool strong {
  font-size: 11px;
}

.composer-tool i,
.tool-button small,
.tool-button i {
  font-size: 11px;
  color: var(--muted);
  font-style: normal;
}

.composer-tool.is-pending,
.tool-button.is-pending {
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 45%);
}

.composer-tool.is-pending::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--soft);
}

.more-tool {
  border-style: dashed;
}

.composer-input textarea {
  min-height: 56px;
  max-height: 104px;
  background: var(--surface);
}

.composer-footer {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.emoji-popover {
  position: fixed;
  left: calc(var(--rail-w) + var(--side-w) + 28px);
  bottom: 124px;
  z-index: 60;
  width: min(440px, calc(100vw - 32px));
  height: min(420px, calc(100vh - 152px));
  min-height: 280px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  transform-origin: left bottom;
  contain: layout paint;
  animation: emoji-popover-in .16s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes emoji-popover-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.emoji-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.emoji-head strong {
  color: var(--ink);
}

.emoji-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.emoji-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-weight: 700;
}

.emoji-tabs button.is-active {
  color: var(--ink);
  background: var(--raise);
}

.emoji-picker-view {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
}

.emoji-picker-view button {
  padding: 0;
}

.emoji-picker-search {
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.emoji-picker-search:focus-within {
  border-color: color-mix(in srgb, var(--primary), var(--line) 42%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-soft), transparent 32%);
}

.emoji-picker-search input {
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.emoji-picker-search button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--raise);
}

.emoji-picker-categories {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.emoji-picker-categories::-webkit-scrollbar {
  display: none;
}

.emoji-picker-categories button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  filter: grayscale(.18);
}

.emoji-picker-categories button:hover,
.emoji-picker-categories button.is-active {
  background: var(--primary-soft);
  filter: none;
}

.emoji-picker-categories button.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 48%);
}

.emoji-picker-meta {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}

.emoji-virtual-viewport {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: 0;
  scrollbar-gutter: stable;
}

.emoji-virtual-grid {
  display: grid;
  grid-template-columns: repeat(var(--emoji-picker-columns, 8), minmax(0, 1fr));
  grid-auto-rows: 38px;
  align-content: start;
  gap: 5px;
}

.emoji-virtual-grid button {
  min-width: 0;
  min-height: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 22px;
  line-height: 1;
}

.emoji-virtual-grid button:hover,
.emoji-virtual-grid button:focus {
  background: var(--primary-soft);
  transform: translateY(-1px) scale(1.04);
}

.emoji-picker-cell {
  position: relative;
  min-width: 0;
}

.emoji-picker-cell > [data-emoji-picker-item] {
  width: 100%;
}

.emoji-picker-cell .emoji-picker-variant-trigger {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--raise), transparent 8%);
  color: var(--muted);
  font-family: var(--font);
  font-size: 9px;
  line-height: 1;
}

.emoji-picker-variants {
  position: absolute;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raise);
  box-shadow: var(--shadow-lg);
}

.emoji-picker-variants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
}

.emoji-picker-variants-head button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
}

.emoji-picker-variants-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-picker-variants-grid button {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 22px;
}

.emoji-picker-variants-grid button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.emoji-virtual-spacer {
  min-height: 0;
  pointer-events: none;
}

.emoji-picker-empty {
  min-height: 150px;
  padding: 24px 12px;
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
  color: var(--muted);
}

.emoji-picker-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.emoji-picker-empty span {
  font-size: 11px;
}

.emoji-grid {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  animation: emoji-panel-body-in .14s ease-out both;
}

@keyframes emoji-panel-body-in {
  from {
    opacity: .72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-grid button {
  min-height: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 20px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.emoji-grid button:hover {
  background: var(--primary-soft);
}

.sticker-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  display: grid;
  align-content: start;
  gap: 12px;
  animation: emoji-panel-body-in .14s ease-out both;
}

.sticker-section {
  display: grid;
  gap: 8px;
}

.sticker-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sticker-section-head span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.sticker-section-head strong {
  color: var(--ink);
  font-size: 13px;
}

.sticker-section-head small {
  color: var(--muted);
  font-size: 11px;
}

.sticker-section-actions {
  flex: 0 0 auto;
}

.sticker-section-actions button,
.sticker-actions button {
  min-width: 30px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ink-2);
  background: var(--surface-soft);
}

.sticker-section-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.sticker-section-actions svg,
.sticker-actions svg {
  width: 15px;
  height: 15px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sticker-card {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.sticker-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.sticker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sticker-thumb em {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(0, 0, 0, .52);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-card.is-active .sticker-thumb em {
  background: rgba(28, 151, 106, .82);
}

.sticker-card.is-processing .sticker-thumb {
  opacity: .72;
}

.sticker-card.is-uploading .sticker-thumb {
  border: 1px dashed rgba(99, 112, 255, .42);
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(99, 112, 255, .12), rgba(49, 196, 141, .1)),
    var(--surface-soft);
}

.sticker-card.is-uploading.is-failed .sticker-thumb {
  border-color: rgba(255, 108, 108, .48);
  color: var(--danger);
  background:
    linear-gradient(135deg, rgba(255, 108, 108, .12), rgba(255, 176, 84, .1)),
    var(--surface-soft);
}

.sticker-upload-percent {
  position: relative;
  z-index: 1;
  color: currentColor;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.sticker-card.is-busy {
  opacity: .7;
}

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

.sticker-actions button {
  padding: 0;
}

.sticker-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.sticker-inline-error,
.sticker-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.sticker-inline-error {
  color: var(--danger);
  text-align: left;
}

.sticker-empty.is-compact {
  padding: 8px;
}

@media (max-width: 720px) {
  .emoji-popover {
    left: 12px;
    right: 12px;
    bottom: 104px;
    width: auto;
    height: min(420px, calc(100vh - 128px));
  }

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

}

@media (prefers-reduced-motion: reduce) {
  .emoji-popover,
  .emoji-grid,
  .sticker-panel {
    animation: none;
  }
}

.emoji-grid.is-modal {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 16px;
}

.page-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}

.page-scroll {
  padding: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.content-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.content-stack {
  display: grid;
  gap: 14px;
}

.panel,
.feature-panel,
.file-preview,
.file-focus,
.rtc-stage,
.empty-state,
.error-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel,
.feature-panel,
.file-preview {
  padding: 16px;
}

.feature-panel,
.panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.profile-large {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.profile-large.compact {
  grid-template-columns: auto minmax(0, 1fr);
}

.profile-large p,
.muted {
  color: var(--muted);
}

.info-grid,
.info-list {
  display: grid;
  gap: 10px;
}

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

.info-grid > span,
.info-list > span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.info-grid strong,
.info-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-user-id-button {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  height: 18px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: none;
  outline: 0;
  transform: none;
  contain: layout paint style;
  transition: color .12s ease;
}

.copy-user-id-button span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 18px;
}

.copy-user-id-button svg {
  width: 12px;
  height: 12px;
  min-width: 12px;
  flex: 0 0 12px;
  opacity: .58;
  color: currentColor;
}

.copy-user-id-button:hover,
.copy-user-id-button:focus {
  color: var(--primary);
  outline: none;
}

.copy-user-id-button:focus {
  box-shadow: none;
}

.info-grid strong:has(.copy-user-id-button),
.info-list strong:has(.copy-user-id-button),
.detail-kv strong:has(.copy-user-id-button),
.contact-info-grid strong:has(.copy-user-id-button) {
  width: auto;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button {
  height: auto;
  min-height: 0;
  gap: 6px;
  color: var(--primary);
  font-weight: 800;
  line-height: 1.35;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button span,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button span,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button span,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button span {
  line-height: 1.35;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button svg,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button svg,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button svg,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button svg {
  width: 13px;
  height: 13px;
  min-width: 13px;
  opacity: .7;
}

.info-grid strong:has(.copy-user-id-button) .copy-user-id-button:hover,
.info-list strong:has(.copy-user-id-button) .copy-user-id-button:hover,
.detail-kv strong:has(.copy-user-id-button) .copy-user-id-button:hover,
.contact-info-grid strong:has(.copy-user-id-button) .copy-user-id-button:hover {
  color: var(--primary-strong);
}

.notice-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 38%);
}

.group-notice-box {
  gap: 12px;
  padding: 14px;
}

.notice-box-head,
.group-members-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notice-box-head strong,
.group-members-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.group-members-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
}

.group-members-head span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.group-members-head button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 92%);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.group-members-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.member-load-more {
  justify-self: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}

.group-member-row {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 52%);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.group-member-row:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 68%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 70%);
  transform: translateY(-1px);
}

.group-member-row .avatar {
  width: 36px;
  height: 36px;
}

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

.identity-avatar-presence,
.member-avatar-wrap,
.contact-avatar-wrap,
.conversation-avatar-wrap {
  position: relative;
}

.identity-avatar-presence {
  display: inline-flex;
  flex: 0 0 auto;
}

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

.group-member-row-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.group-member-row-copy small {
  color: var(--muted);
  font-size: 11px;
}

.group-member-row .role-badge {
  justify-self: end;
}

.group-manage-panel {
  gap: 14px;
}

.group-readonly-panel {
  align-content: start;
}

.file-preview,
.file-focus {
  display: grid;
  gap: 14px;
}

.file-focus {
  padding: 16px;
}

.file-focus-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.file-focus-foot p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.preview-canvas,
.modal-preview,
.preview-mini {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--primary), var(--line) 45%);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.preview-canvas {
  min-height: 360px;
}

.preview-canvas span,
.modal-preview span,
.preview-mini span {
  min-width: 68px;
  height: 68px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.rtc-stage {
  padding: 16px;
}

.video-grid {
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.video-grid div {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.video-grid span {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.call-controls {
  justify-content: center;
  padding-top: 14px;
}

.pane-head {
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 23, .5);
}

.pane-head h3 {
  flex: 1;
  color: var(--ink);
  font-size: 17px;
  font-weight: 660;
}

.pick {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink);
  font-size: 13px;
}

.pick svg {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.file-load-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.file-load-more button {
  min-width: 132px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
}

.file-load-more button:disabled {
  cursor: wait;
  color: var(--ink-3);
  opacity: .72;
}

.fcard {
  min-width: 0;
  min-height: 338px;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr auto;
  align-content: start;
  gap: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
  transition: transform .15s var(--ease-out), border-color .15s var(--ease-out), background .15s var(--ease-out);
}

.fcard:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, .04);
}

.fcard .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  border: 0;
  border-radius: 12px;
}

.fcard .thumb svg {
  width: 38px;
  height: 38px;
}

.fc-doc {
  background: var(--grad-soft);
  color: var(--brand);
}

.fc-img {
  background: linear-gradient(135deg, rgba(124, 107, 255, .25), rgba(106, 214, 255, .2));
  color: #cdd8ff;
}

.fc-video {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(33, 39, 63, .98), rgba(88, 102, 255, .24));
  color: #dbe4ff;
}

.fc-pdf {
  background: linear-gradient(135deg, rgba(255, 82, 82, .22), rgba(255, 138, 91, .18));
  color: #ffc7c0;
}

.fcard .thumb.has-media-thumb {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.fcard .thumb.has-media-thumb img,
.fcard .thumb.has-media-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fc-zip {
  background: linear-gradient(135deg, rgba(255, 138, 91, .22), rgba(255, 111, 125, .18));
  color: #ffb59b;
}

.fc-aud {
  background: linear-gradient(135deg, rgba(47, 211, 168, .22), rgba(63, 155, 255, .18));
  color: #9af0d6;
}

.fcard b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fmeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.file-download-status {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  color: var(--ink-3);
  font-size: 11.5px;
}

.file-download-status.is-cached {
  border-color: rgba(47, 211, 168, .22);
  color: var(--ok);
}

.file-download-status.is-busy {
  border-color: rgba(79, 140, 255, .24);
  color: var(--ink-2);
}

.file-download-status.is-failed {
  border-color: rgba(255, 107, 107, .24);
  color: var(--danger);
}

.file-download-status > i {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.file-download-status > i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--grad);
}

.file-download-status em {
  display: flex;
  gap: 6px;
  font-style: normal;
}

.file-download-status button {
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 11px;
}

.file-cache-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
}

.file-cache-panel > div:first-child {
  display: grid;
  gap: 3px;
}

.file-cache-panel strong {
  color: var(--ink);
  font-size: 13px;
}

.file-cache-panel span,
.file-cache-panel small {
  color: var(--ink-3);
  font-size: 11.5px;
}

.file-cache-actions {
  display: flex;
  gap: 8px;
}

.file-cache-actions button {
  flex: 1;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 12px;
}

.wm {
  padding: 1px 6px;
  border: 1px solid rgba(255, 204, 107, .3);
  border-radius: 6px;
  color: var(--warn);
  font-size: 10px;
}

.frow {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.frow button {
  flex: 0 0 auto;
  min-width: 72px;
  max-width: 96px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 12px;
}

.frow button.pri {
  border: 0;
  background: var(--grad);
  color: #fff;
}

.stage {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(79, 140, 255, .18), transparent 60%),
    #070a12;
}

.stage-head {
  height: 60px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.stage-head h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 660;
}

.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
}

.timer .rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(255, 111, 125, .2);
}

.tiles {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(40, 50, 80, .5), rgba(20, 26, 44, .7));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.tile.main {
  grid-row: span 2;
  background: linear-gradient(135deg, rgba(79, 140, 255, .22), rgba(124, 107, 255, .16));
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .28), 0 18px 50px rgba(79, 140, 255, .18);
}

.big-av {
  width: 96px;
  height: 96px;
  border-radius: 30px;
  font-size: 34px;
}

.tile:not(.main) .big-av {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 26px;
}

.nm {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  font-size: 13px;
  backdrop-filter: blur(6px);
}

.ping {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  color: var(--ink-2);
  font-size: 11px;
}

.call-bar {
  height: 88px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 23, .6);
}

.cbtn {
  width: 54px;
  height: 54px;
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raise);
  color: var(--ink);
}

.cbtn svg {
  width: 22px;
  height: 22px;
}

.cbtn.on {
  border: 0;
  background: var(--grad);
  color: #fff;
}

.cbtn.end {
  width: 64px;
  border: 0;
  background: linear-gradient(135deg, #ff6f7d, #ff4d62);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 77, 98, .4);
}

.rtc-idle-workspace .page-scroll {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 26px 28px;
}

.rtc-empty-panel {
  min-height: 320px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  padding: 34px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 50%);
  border-radius: 24px;
  background:
    radial-gradient(520px 240px at 84% 0%, color-mix(in srgb, var(--primary), transparent 78%), transparent 72%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 42%), var(--surface));
  box-shadow: 0 24px 70px rgba(79, 140, 255, .12);
}

.rtc-empty-visual {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 50%);
  border-radius: 36px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 20px 50px rgba(79, 140, 255, .28);
}

.rtc-empty-icon svg {
  width: 52px;
  height: 52px;
}

.rtc-empty-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.rtc-empty-copy .eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 760;
}

.rtc-empty-copy h2 {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
}

.rtc-empty-copy p:not(.eyebrow) {
  max-width: 660px;
  color: var(--ink-2);
  line-height: 1.75;
}

.rtc-empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rtc-empty-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raise);
  color: var(--ink);
  white-space: nowrap;
}

.rtc-empty-actions svg {
  width: 18px;
  height: 18px;
}

.rtc-recent-section {
  display: grid;
  gap: 12px;
}

.rtc-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.rtc-idle-workspace .rtc-recent-section {
  min-width: 0;
  container: rtc-contacts / inline-size;
}

.rtc-idle-workspace .rtc-record-grid {
  grid-template-columns: minmax(0, 1fr);
}

@container rtc-contacts (min-width: 560px) {
  .rtc-idle-workspace .rtc-record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container rtc-contacts (min-width: 860px) {
  .rtc-idle-workspace .rtc-record-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rtc-record-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

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

.rtc-record-card strong {
  color: var(--ink);
  font-size: 14px;
}

.rtc-record-card small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.rtc-record-card em {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 86%);
  color: var(--warn);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.rtc-record-card em.is-done {
  background: color-mix(in srgb, var(--ok), transparent 88%);
  color: var(--ok);
}

.rtc-record-card button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink);
}

.call-history-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.call-history-row em {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok), transparent 84%);
  color: var(--ok);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.call-history-row.is-ringing .avatar,
.rtc-record-card.is-ringing .avatar {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok), transparent 84%);
}

.rtc-call-workspace .page-scroll {
  display: grid;
  gap: 24px;
  padding: 28px 32px 30px;
}

.rtc-incoming-panel,
.rtc-live-panel {
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-radius: 24px;
  background:
    radial-gradient(520px 280px at 78% 8%, color-mix(in srgb, var(--primary), transparent 78%), transparent 72%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), var(--surface) 34%), var(--surface));
  box-shadow: 0 24px 70px rgba(79, 140, 255, .14);
}

.rtc-incoming-panel {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(132px, 160px) minmax(0, 1fr);
  grid-template-areas:
    "avatar copy"
    "actions actions";
  align-items: center;
  gap: 28px;
  padding: 36px;
}

.incoming-pulse-stage {
  grid-area: avatar;
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}

.incoming-pulse-stage .avatar {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  border-radius: 30px;
  background: var(--grad);
  box-shadow: 0 22px 50px rgba(79, 140, 255, .3);
}

.incoming-ring {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  left: 18px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 28%);
  border-radius: 44px;
  animation: call-ring 1.9s var(--ease-out) infinite;
}

.incoming-ring.two {
  animation-delay: .55s;
}

.rtc-call-copy {
  grid-area: copy;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.rtc-call-copy .eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 780;
}

.rtc-call-copy h2 {
  max-width: 100%;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.16;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.rtc-call-copy p:not(.eyebrow) {
  color: var(--ink-2);
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.rtc-caller-trust {
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 58%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-soft), transparent 24%);
}

.rtc-caller-trust svg {
  width: 18px;
  height: 18px;
  color: var(--primary-2);
}

.rtc-caller-trust strong {
  color: var(--ink);
  font-size: 13px;
}

.rtc-caller-trust span {
  color: var(--ink-3);
  font-size: 12px;
}

.rtc-incoming-accept-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 0;
  color: var(--primary-2);
  font-size: 14px;
  font-weight: 760;
}

.rtc-incoming-accept-status i {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid color-mix(in srgb, var(--primary-2), transparent 68%);
  border-top-color: var(--primary-2);
  border-radius: 999px;
  animation: rtc-accept-spin .75s linear infinite;
}

@keyframes rtc-accept-spin {
  to { transform: rotate(360deg); }
}

.rtc-call-actions {
  width: min(100%, 560px);
  min-width: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 12px;
}

.rtc-incoming-panel .rtc-call-actions {
  grid-area: actions;
}

.rtc-call-actions button,
.call-answer,
.call-end {
  min-width: 0;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 760;
  white-space: nowrap;
}

.call-answer {
  background: linear-gradient(135deg, #19c88f, #36d399);
  box-shadow: 0 16px 34px rgba(25, 200, 143, .26);
}

.call-end {
  background: linear-gradient(135deg, #ff6475, #e83f58);
  box-shadow: 0 16px 34px rgba(232, 63, 88, .24);
}

.rtc-call-actions button:disabled,
.incoming-call-actions button:disabled {
  opacity: .56;
  cursor: wait;
  box-shadow: none;
}

.rtc-call-actions svg,
.call-answer svg,
.call-end svg {
  width: 18px;
  height: 18px;
}

.rtc-live-panel {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
  padding: 18px;
}

.rtc-live-duration {
  justify-self: center;
  min-width: 218px;
  min-height: 78px;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 16px;
  padding: 12px 28px 13px;
  border: 1px solid rgba(112, 165, 255, .36);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(35, 45, 70, .78), rgba(12, 18, 31, .72));
  color: var(--ink-2);
  box-shadow:
    0 18px 44px rgba(23, 52, 104, .34),
    inset 0 1px 0 rgba(255, 255, 255, .10);
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.rtc-live-duration span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding-right: 15px;
  border-right: 1px solid rgba(132, 180, 255, .22);
  color: #b8c4dc;
  font-size: 14px;
  font-weight: 780;
  line-height: 1;
}

.rtc-live-duration strong {
  color: #84b4ff;
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 860;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 10px 26px rgba(91, 157, 255, .28);
}

body[data-theme="aurora"] .rtc-live-duration {
  border-color: rgba(79, 140, 255, .36);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(243, 247, 255, .9));
  box-shadow:
    0 18px 40px rgba(79, 140, 255, .14),
    inset 0 1px 0 rgba(255, 255, 255, .86);
}

body[data-theme="aurora"] .rtc-live-duration span {
  border-right-color: rgba(79, 140, 255, .22);
  color: #5f6f90;
}

body[data-theme="aurora"] .rtc-live-duration strong {
  color: #4f82ff;
  text-shadow: 0 8px 22px rgba(79, 140, 255, .16);
}

.rtc-live-tile {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: default;
  transition: none;
}

.rtc-live-tile:hover,
.rtc-live-tile:focus,
.rtc-live-tile:focus-within,
.rtc-live-tile:active {
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  transform: none;
}

.rtc-live-tile.is-peer {
  background:
    radial-gradient(380px 240px at 50% 10%, color-mix(in srgb, var(--primary), transparent 68%), transparent 72%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft), var(--surface) 24%), var(--surface-soft));
}

.rtc-live-tile.is-peer:hover,
.rtc-live-tile.is-peer:focus,
.rtc-live-tile.is-peer:focus-within,
.rtc-live-tile.is-peer:active {
  background:
    radial-gradient(380px 240px at 50% 10%, color-mix(in srgb, var(--primary), transparent 68%), transparent 72%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft), var(--surface) 24%), var(--surface-soft));
}

.rtc-live-tile .avatar {
  width: 86px;
  height: 86px;
  border-radius: 28px;
}

.rtc-live-tile strong {
  color: var(--ink);
  font-size: 18px;
}

.rtc-live-tile small {
  color: var(--ink-2);
}

.rtc-live-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.incoming-call-notice {
  position: fixed;
  z-index: 140;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #040a14;
}

.incoming-call-card {
  width: min(560px, 100%);
  min-height: min(480px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 36px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 42%);
  border-radius: 30px;
  background: #111827;
  color: var(--ink);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .5);
  animation: call-notice-in .24s var(--ease-out);
}

.incoming-call-main {
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
}

.incoming-call-kicker {
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), var(--surface) 88%);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.incoming-avatar {
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
}

.incoming-avatar > .incoming-avatar-core {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  min-width: 104px;
  min-height: 104px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: var(--grad);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.incoming-avatar i {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 38px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 24%);
  animation: call-ring 1.8s var(--ease-out) infinite;
}

.incoming-copy {
  display: block;
  min-width: 0;
}

.incoming-copy strong,
.incoming-copy small,
.incoming-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-copy strong {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
}

.incoming-copy small {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.incoming-copy em {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 13px;
  font-style: normal;
}

.incoming-call-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.incoming-call-actions:has(.call-accept:only-child),
.incoming-call-actions:not(:has(.is-audio, .is-video)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.incoming-call-actions button {
  min-height: 62px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-weight: 760;
  line-height: 1;
  transition: transform .16s var(--ease-out), background-color .16s var(--ease-out), border-color .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}

.incoming-call-actions .call-decline {
  background: color-mix(in srgb, var(--danger), var(--surface) 82%);
  border-color: color-mix(in srgb, var(--danger), transparent 68%);
  color: var(--danger);
}

.incoming-call-actions .call-accept {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: color-mix(in srgb, var(--primary), transparent 38%);
  color: #fff;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary), transparent 72%);
  white-space: nowrap;
}

.incoming-call-actions .call-decline:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--danger), var(--surface) 72%);
  border-color: color-mix(in srgb, var(--danger), transparent 44%);
  color: color-mix(in srgb, var(--danger), #7f1020 18%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--danger), transparent 84%);
}

.incoming-call-actions .call-accept:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary), #fff 8%), color-mix(in srgb, var(--secondary), #fff 6%));
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary), transparent 64%);
}

.incoming-call-actions .call-decline:active,
.incoming-call-actions .call-accept:active {
  transform: translateY(0);
}

.incoming-call-actions .call-decline:focus,
.incoming-call-actions .call-accept:focus {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 72%);
  outline-offset: 3px;
}

.incoming-call-actions svg {
  width: 17px;
  height: 17px;
}

.incoming-call-actions .call-accept svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.incoming-call-actions .call-decline svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

body[data-theme="aurora"] .incoming-call-card {
  background: #fff;
  box-shadow: 0 22px 48px rgba(37, 65, 118, .16);
}

body[data-theme="aurora"] .incoming-call-actions .call-decline {
  background: #fff0f3;
  border-color: #ffc6d1;
  color: #e84d62;
}

body[data-theme="aurora"] .incoming-call-actions .call-decline:hover {
  background: #ffdfe6;
  border-color: #ff9daf;
  color: #d9364d;
  box-shadow: 0 14px 28px rgba(232, 77, 98, .18);
}

body[data-theme="aurora"] .incoming-call-actions .call-accept:hover {
  box-shadow: 0 16px 34px rgba(45, 167, 116, .24);
}

body[data-theme="midnight"] .incoming-call-actions .call-decline {
  background: rgba(255, 111, 125, .16);
  border-color: rgba(255, 111, 125, .34);
  color: #ff8796;
}

body[data-theme="midnight"] .incoming-call-actions .call-decline:hover {
  background: rgba(255, 111, 125, .24);
  border-color: rgba(255, 111, 125, .56);
  color: #ffd7dd;
  box-shadow: 0 14px 30px rgba(255, 85, 105, .16);
}

body[data-theme="midnight"] .incoming-call-actions .call-accept {
  box-shadow: 0 16px 36px rgba(91, 157, 255, .24);
}

body[data-theme="midnight"] .incoming-call-actions .call-accept:hover {
  border-color: rgba(103, 214, 166, .52);
  box-shadow: 0 18px 38px rgba(52, 211, 153, .22);
}

.im-shell .incoming-call-actions .call-decline:hover,
.im-shell .incoming-call-actions .call-decline:focus {
  background: linear-gradient(135deg, #ff7080, #ee5066) !important;
  border-color: color-mix(in srgb, #ff8b98, transparent 18%) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(238, 80, 102, .24) !important;
}

.im-shell .incoming-call-actions .call-accept:hover,
.im-shell .incoming-call-actions .call-accept:focus {
  background: linear-gradient(135deg, #35d59b, #4fd18f) !important;
  border-color: color-mix(in srgb, #56daa0, transparent 18%) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(53, 213, 155, .24) !important;
}

.im-shell .rtc-call-actions .call-end:hover,
.im-shell .rtc-call-actions .call-end:focus,
.im-shell .call-end:hover,
.im-shell .call-end:focus {
  background: linear-gradient(135deg, #ff7080, #e83f58) !important;
  border-color: color-mix(in srgb, #ff8b98, transparent 20%) !important;
  color: #fff !important;
  box-shadow: 0 18px 38px rgba(232, 63, 88, .26) !important;
}

.im-shell .rtc-call-actions .call-answer:hover,
.im-shell .rtc-call-actions .call-answer:focus,
.im-shell .call-answer:hover,
.im-shell .call-answer:focus {
  background: linear-gradient(135deg, #19c88f, #3ed99f) !important;
  border-color: color-mix(in srgb, #55deb0, transparent 18%) !important;
  color: #fff !important;
  box-shadow: 0 18px 38px rgba(25, 200, 143, .28) !important;
}

.im-shell .incoming-call-actions .call-decline:active,
.im-shell .incoming-call-actions .call-accept:active,
.im-shell .rtc-call-actions .call-end:active,
.im-shell .rtc-call-actions .call-answer:active {
  transform: translateY(0) scale(.98);
}

@keyframes call-ring {
  0% {
    opacity: .85;
    transform: scale(.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes call-notice-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 920px) {
  .incoming-call-notice {
    place-items: end center;
    padding: 0;
  }

  .incoming-call-card {
    width: 100%;
    min-height: min(640px, 72vh);
    padding: 30px 24px calc(24px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 30px 30px 0 0;
  }

  .incoming-call-main {
    gap: 16px;
  }

  .incoming-call-actions {
    justify-content: stretch;
  }

  .incoming-call-actions button {
    min-height: 58px;
  }
}

@media (max-width: 480px) {
  .incoming-call-card {
    min-height: min(620px, 78vh);
    gap: 18px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .incoming-avatar {
    width: 104px;
    height: 104px;
  }

  .incoming-avatar > .incoming-avatar-core {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    border-radius: 28px;
  }

  .incoming-call-actions button {
    min-height: 56px;
    padding: 0 10px;
    font-size: 12px;
  }

  .rtc-incoming-panel,
  .rtc-live-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .rtc-incoming-panel {
    grid-template-areas:
      "avatar"
      "copy"
      "actions";
  }

  .rtc-incoming-panel .incoming-pulse-stage,
  .rtc-incoming-panel .rtc-call-copy {
    justify-self: center;
  }

  .rtc-incoming-panel .rtc-call-copy {
    text-align: center;
  }

  .rtc-call-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .incoming-ring,
  .incoming-avatar i {
    animation: none;
  }

  .incoming-call-card {
    animation: none;
  }
}

.settings-workspace .page-scroll {
  padding: 0;
}

.set-pane {
  width: min(760px, calc(100% - 60px));
  max-width: 760px;
  padding: 28px 32px;
}

.settings-pane-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.settings-pane-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(124, 140, 255, .24);
  border-radius: 15px;
  background: var(--grad-soft);
  color: #fff;
  box-shadow: 0 12px 28px rgba(79, 140, 255, .12);
}

.settings-pane-icon svg {
  width: 23px;
  height: 23px;
}

.set-pane h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 680;
}

.set-pane .lead {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13px;
}

.set-group {
  margin-top: 24px;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
}

.set-group .gl {
  padding: 14px 0 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.set-row:first-of-type {
  border-top: 0;
}

.set-row .sr-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.set-row .sr-body b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 560;
}

.set-row .sr-body p {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

button.set-row.legal-document-row {
  width: 100%;
  min-height: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

button.set-row.legal-document-row:hover,
button.set-row.legal-document-row:focus {
  background: var(--surface-soft);
}

.legal-document-row .sr-body > span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.legal-document-affordance {
  flex: none;
  pointer-events: none;
}

.set-row.is-policy .sr-body p {
  color: var(--ink-2);
}

.setting-status {
  flex: none;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
}

.setting-status.is-ok {
  border-color: rgba(55, 224, 166, .32);
  background: rgba(55, 224, 166, .08);
  color: var(--ok);
}

.device-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.device-card:first-of-type {
  border-top: 0;
}

.device-card b,
.device-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card b {
  color: var(--ink);
  font-size: 14px;
}

.device-card p {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.device-card-copy {
  min-width: 0;
}

.device-card-copy p {
  display: flex;
  align-items: center;
  gap: 7px;
}

.device-card-copy p span,
.device-card-copy p code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card-copy p code {
  max-width: min(280px, 42vw);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font: 500 11px/1.3 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.danger-pick {
  color: var(--bad);
}

.device-remove-trigger {
  border-color: color-mix(in srgb, var(--bad) 34%, var(--line));
  background: color-mix(in srgb, var(--bad) 7%, transparent);
  font-weight: 680;
}

.device-remove-trigger:hover,
.device-remove-trigger:focus {
  border-color: color-mix(in srgb, var(--bad) 58%, var(--line));
  background: color-mix(in srgb, var(--bad) 13%, transparent);
}

.device-removal-dialog-layer {
  position: fixed;
  z-index: 180;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, #060912 72%, transparent);
  backdrop-filter: blur(8px);
  animation: scrim-in .16s var(--ease-out);
}

.device-removal-dialog {
  width: min(500px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 40px));
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--bad) 24%, var(--line-2));
  border-radius: 22px;
  background:
    radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--bad) 11%, transparent), transparent 68%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #fff 4%), var(--surface));
  color: var(--ink);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .48), 0 0 0 1px color-mix(in srgb, var(--bad) 7%, transparent);
  animation: dialog-in .18s var(--ease-out);
}

.device-removal-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
}

.device-removal-dialog__heading {
  min-width: 0;
}

.device-removal-dialog__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--bad);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
}

.device-removal-dialog__heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 760;
  line-height: 1.25;
}

.device-removal-dialog__close {
  flex: none;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
}

.device-removal-dialog__body {
  display: grid;
  gap: 16px;
  padding: 0 22px 22px;
}

.device-removal-dialog__description {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
}

.device-removal-dialog__device {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
}

.device-removal-dialog__device-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 13px;
  background: var(--grad-soft);
  color: #fff;
  font-size: 14px;
  font-weight: 760;
}

.device-removal-dialog__device-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.device-removal-dialog__device-copy strong,
.device-removal-dialog__device-copy span,
.device-removal-dialog__device-copy code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-removal-dialog__device-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.device-removal-dialog__device-copy span {
  color: var(--ink-3);
  font-size: 12px;
}

.device-removal-dialog__device-copy code {
  color: var(--ink-2);
  font: 500 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.device-removal-dialog__status {
  justify-self: end;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line));
  border-radius: 999px;
  color: var(--ok);
  font-size: 11px;
  font-weight: 680;
}

.device-removal-dialog__warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 24%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--bad) 7%, transparent);
  color: color-mix(in srgb, var(--bad) 78%, var(--ink));
  font-size: 12px;
  line-height: 1.5;
}

.device-removal-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
}

.device-removal-dialog__footer button {
  min-width: 112px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
}

.device-removal-dialog__cancel {
  border: 1px solid var(--line-2);
  background: var(--surface-soft);
  color: var(--ink);
}

.device-removal-dialog__confirm {
  border: 1px solid color-mix(in srgb, var(--bad) 72%, #fff 8%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bad) 88%, #fff 12%), var(--bad));
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--bad) 28%, transparent);
}

.device-removal-dialog__close:focus,
.device-removal-dialog__cancel:focus,
.device-removal-dialog__confirm:focus {
  outline: 3px solid color-mix(in srgb, var(--primary) 52%, transparent);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .device-removal-dialog-layer {
    place-items: end center;
    padding: 12px;
  }

  .device-removal-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .device-removal-dialog__header {
    padding: 19px 18px 14px;
  }

  .device-removal-dialog__body {
    padding: 0 18px 18px;
  }

  .device-removal-dialog__device {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .device-removal-dialog__status {
    grid-column: 2;
    justify-self: start;
  }

  .device-removal-dialog__footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 18px 18px;
  }

  .device-removal-dialog__footer button {
    min-width: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-removal-dialog-layer,
  .device-removal-dialog {
    animation: none;
  }
}

.theme-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-cards button {
  min-height: 84px;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 12px;
}

.theme-cards button span {
  width: 100%;
  height: 24px;
  border-radius: 6px;
  background: var(--primary);
  border-right: 48px solid var(--secondary);
  box-shadow: inset -96px 0 0 var(--accent);
}

.theme-cards button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.context-scrim {
  position: fixed;
  z-index: 54;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--scrim);
  cursor: default;
  animation: scrim-in 0.18s var(--ease-out);
}

.list-scrim {
  display: none;
}

.context-scrim:hover {
  background: var(--scrim);
}

.context-panel {
  position: fixed;
  z-index: 55;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--detail-w), calc(100vw - var(--rail-w)));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(104%);
  transition:
    transform 0.24s var(--ease-out),
    opacity 0.18s var(--ease-out);
}

.im-shell.is-detail-open .context-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.context-head {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.context-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.context-tabs {
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.context-tabs button {
  min-height: 30px;
  padding: 0 6px;
  font-size: 12px;
}

.context-body {
  padding: 14px;
}

.context-section {
  display: grid;
  gap: 14px;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 10px 10px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.activity-item b,
.activity-item span,
.activity-item small {
  min-width: 0;
}

.activity-item span {
  overflow-wrap: anywhere;
  color: var(--ink);
}

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

.member-list-actions {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 0 0 8px;
  background: linear-gradient(180deg, var(--surface) 72%, transparent);
}

.member-list-actions button {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 11px;
}

.member-card {
  min-width: 0;
  min-height: 108px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
}

.member-card-copy,
.context-member-copy,
.detail-member-copy {
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: stretch;
  gap: 4px;
}

.member-card-copy .identity-name-line,
.context-member-copy .identity-name-line,
.detail-member-copy .identity-name-line {
  width: 100%;
}

.member-card-copy .identity-metadata-line {
  justify-content: center;
}

.member-card .member-avatar-wrap,
.member-card .avatar {
  min-width: 0;
}

.member-card strong,
.member-card small,
.member-card .role-badge {
  max-width: 100%;
  min-width: 0;
}

.member-card strong,
.member-card small,
.member-card .role-badge span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card strong {
  width: auto;
  text-align: center;
}

.switch-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row.is-permission-blocked > span {
  color: var(--ink-3);
}

.switch {
  width: 42px;
  min-width: 42px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  border-color: var(--line);
  background: var(--surface-strong);
}

.switch::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--surface);
  transition: margin 0.16s ease, background 0.16s ease;
}

.switch.is-on {
  background: var(--primary);
  border-color: var(--primary);
}

.switch.is-permission-blocked {
  cursor: not-allowed;
  opacity: .58;
  filter: grayscale(.18) saturate(.75);
}

.switch.is-permission-blocked:hover {
  transform: none;
  box-shadow: none;
}

.switch.is-on::before {
  margin-left: 20px;
}

.tag-row {
  gap: 6px;
}

.empty-state,
.error-state,
.loading-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.empty-state p,
.error-state p {
  color: var(--muted);
}

.error-state {
  border-color: color-mix(in srgb, var(--danger), var(--line) 45%);
  background: color-mix(in srgb, var(--danger), transparent 94%);
}

.chat-top-stack > .connection-recovery {
  min-height: 0;
  margin: 8px 12px 0;
  padding: 10px 12px;
}

.connection-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.connection-recovery-actions .connection-recovery-logout {
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.connection-recovery-actions .connection-recovery-logout:hover,
.connection-recovery-actions .connection-recovery-logout:focus {
  color: var(--ink);
}

.loading-state span {
  width: min(420px, 80%);
  height: 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  animation: pulse 1.2s ease-in-out infinite;
}

.menu-popover {
  position: fixed;
  z-index: 50;
  top: 64px;
  right: auto;
  left: 18px;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--ink), transparent 86%);
  animation: pop-in 0.14s var(--ease-out);
}

.menu-popover button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  justify-content: start;
  text-align: left;
  border-color: transparent;
  background: transparent;
}

.menu-popover button svg {
  width: 17px;
  height: 17px;
  color: var(--ink-2);
}

.menu-popover button span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-create-popover {
  width: 224px;
  padding: 7px;
  border-radius: 16px;
}

.quick-create-popover button {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 54px;
  padding: 9px 10px;
  border-radius: 12px;
}

.quick-create-popover button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 68%);
  background: color-mix(in srgb, var(--primary), transparent 91%);
}

.quick-create-popover button svg {
  width: 19px;
  height: 19px;
  justify-self: center;
  color: var(--primary);
}

.quick-create-popover button span {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.quick-create-popover button strong,
.quick-create-popover button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-create-popover button strong {
  color: var(--ink);
  font-size: 13px;
}

.quick-create-popover button small {
  color: var(--ink-3);
  font-size: 11px;
}

.overlay {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--scrim);
  animation: scrim-in 0.18s var(--ease-out);
}

.modal-layer {
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card,
.drawer-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  animation: dialog-in 0.2s var(--ease-out);
}

.modal-card.wide {
  width: min(760px, 100%);
}

.modal-card.compact {
  width: min(420px, 100%);
}

.modal-card.reaction-modal {
  width: min(440px, 100%);
  height: min(600px, calc(100vh - 36px));
  height: min(600px, calc(100dvh - 36px));
  grid-template-rows: auto minmax(0, 1fr);
}

.reaction-modal header {
  align-items: center;
  padding: 14px 16px 12px;
}

.reaction-modal header h2 {
  margin: 0;
  font-size: 16px;
}

.reaction-modal .emoji-grid.is-modal {
  padding: 12px 16px 16px;
  gap: 10px;
}

.reaction-modal .emoji-grid button {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
}

.reaction-modal .emoji-picker-view {
  min-width: 0;
  overflow: hidden;
  padding: 12px 16px 16px;
}

.reaction-modal .emoji-picker-view.is-fallback {
  grid-template-rows: auto minmax(0, 1fr);
}

.reaction-modal .emoji-picker-search:focus-within {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.reaction-modal .emoji-virtual-viewport {
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: auto;
  /* Keep the fixed-width native scrollbar on Chromium/macOS, rather than
     switching it to a transient overlay through scrollbar-color. */
  scrollbar-color: auto;
}

.reaction-modal .emoji-virtual-viewport::-webkit-scrollbar {
  width: 14px;
}

.reaction-modal .emoji-virtual-viewport::-webkit-scrollbar-thumb {
  min-height: 32px;
  border-width: 3px;
  background-color: color-mix(in srgb, var(--muted), transparent 25%);
}

.reaction-modal .emoji-picker-cell,
.reaction-modal .emoji-virtual-grid > button {
  width: 38px;
  max-width: 100%;
  justify-self: center;
}

.reaction-modal .emoji-grid button, .reaction-modal .emoji-virtual-grid button, .reaction-modal .emoji-picker-categories button, .reaction-modal .emoji-picker-variants button {
  transform: none;
  transition: background-color .15s, box-shadow .15s;
}

.reaction-modal .emoji-grid button:hover, .reaction-modal .emoji-virtual-grid button:hover, .reaction-modal .emoji-picker-categories button:hover, .reaction-modal .emoji-picker-variants button:hover {
  background: var(--primary-soft);
  transform: none;
}

.reaction-modal .emoji-grid button:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}

.reaction-modal .emoji-virtual-grid button:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}

.reaction-modal .emoji-picker-categories button:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}

.reaction-modal .emoji-picker-variants button:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}

.reaction-modal .emoji-virtual-viewport:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}

.reaction-modal .emoji-picker-categories button.is-active,
.reaction-modal .emoji-picker-variants button[aria-pressed="true"] {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.modal-card.read-modal {
  width: min(620px, 100%);
}

.modal-card header,
.drawer-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-card header p,
.drawer-card header p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.modal-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.modal-card.account-modal {
  width: min(480px, calc(100vw - 28px));
}

.account-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.account-profile-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background:
    radial-gradient(180px 90px at 0% 0%, color-mix(in srgb, var(--primary), transparent 78%), transparent 70%),
    color-mix(in srgb, var(--surface-soft), var(--surface) 32%);
}

.account-profile-card .avatar {
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary), transparent 72%);
}

.account-avatar-edit-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.account-name-block {
  min-width: 0;
  display: grid;
  align-items: start;
  gap: 5px;
}

.account-name-block h3 {
  min-width: 0;
}

.account-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.account-name-row .identity-name-line {
  flex: 0 1 auto;
  width: auto;
  max-width: calc(100% - 33px);
}

.account-certification-line {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
}

.account-certification-line > .certification-name-slot {
  flex: 1 1 auto;
  max-width: 100%;
}

.account-certification-line .verification-badge {
  max-width: 100%;
}

.account-profile-edit-button.group-edit-icon-button {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.account-profile-edit-button.group-edit-icon-button svg {
  width: 13px;
  height: 13px;
}

.account-profile-card h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.account-profile-card p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 62%);
  border-radius: 999px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.account-status.is-warn {
  border-color: color-mix(in srgb, var(--warn), transparent 55%);
  color: var(--warn);
}

.account-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.account-info-list > span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 18%);
}

.account-info-list small {
  color: var(--ink-3);
  font-size: 11.5px;
}

.account-info-list strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-invite-card{min-width:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--surface-soft),transparent 12%)}
.account-invite-copy{flex:1 1 150px;min-width:0;display:grid;gap:5px}
.account-invite-card small{color:var(--ink-3);font-size:11.5px}
.account-invite-copy strong{min-width:0;display:flex;align-items:center;gap:6px;color:var(--ink);font-size:14px;font-weight:760;line-height:1.45}
.account-invite-copy strong>span{min-width:0;overflow-wrap:anywhere}
.account-invite-card.is-ok{border-color:color-mix(in srgb,var(--primary),transparent 62%);background:color-mix(in srgb,var(--primary),transparent 91%)}
.account-invite-card.is-warn strong{color:var(--warn)}
.account-invite-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto}
.account-invite-actions .soft-button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:76px;height:32px;min-height:32px;padding:0 10px;border-radius:8px;font-size:12px;line-height:1;white-space:nowrap}
.account-invite-actions .soft-button svg{width:14px;height:14px;flex:none}
.account-invite-card .account-invite-actions .account-invite-copy-button{border-color:var(--primary-soft);background:var(--primary-soft);color:color-mix(in srgb,var(--primary) 40%,var(--ink));font-weight:650}
.account-invite-card .account-invite-actions .account-invite-copy-button:hover{border-color:var(--primary)}
.account-invite-card .account-invite-actions .account-invite-refresh-button{background:var(--surface);color:var(--ink-2)}
.account-invite-card .account-invite-actions .account-invite-refresh-button:hover{border-color:var(--primary);background:var(--surface-soft)}
.account-invite-loading{display:inline-flex;flex:none;color:var(--primary)}
.account-invite-loading svg{width:14px;height:14px;animation:account-invite-loading .9s linear infinite}
@keyframes account-invite-loading{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.account-invite-loading svg{animation:none}}

.account-modal-footer .danger-button {
  min-width: 118px;
}

.web-login-form {
  display: grid;
  gap: 12px;
}

.web-login-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 760;
}

.web-login-form label span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 740;
}

.web-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.web-login-form input:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 32%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 84%);
}

.web-login-form .login-remember-option { flex-wrap: wrap; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: fit-content; color: var(--muted); font-size: 13px; font-weight: 680; line-height: 1.3; cursor: pointer; user-select: none; }

.web-login-form .login-remember-option input { flex: 0 0 auto; width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; accent-color: var(--primary); cursor: pointer; }

.web-login-form .login-remember-option span { color: inherit; font-size: inherit; font-weight: inherit; }

.password-input-shell {
  position: relative;
  display: block;
  width: 100%;
}

.web-login-form label .password-input-shell {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.password-input-shell input {
  padding-right: 48px !important;
}

.password-reveal-button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.password-reveal-button:hover,
.password-reveal-button:focus {
  background: var(--raise);
  color: var(--ink);
}

.password-reveal-button svg {
  width: 17px;
  height: 17px;
}

.web-login-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.slide-captcha-slot:empty {
  display: none;
}

.web-slide-captcha-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, #020617, transparent 18%);
  backdrop-filter: blur(14px);
}

.web-slide-captcha-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
}

.web-slide-captcha-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.web-slide-captcha-panel strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.web-slide-captcha-panel header span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.web-slide-captcha-panel .slide-captcha-slot {
  min-height: 232px;
  display: grid;
  place-items: center;
}

.slide-captcha-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
}

.slide-captcha-box.is-image {
  width: min(360px, 100%) !important;
  border-radius: 12px;
}

.slide-captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slide-captcha-head strong {
  color: var(--ink);
  font-size: 13px;
}

.slide-captcha-head span {
  color: var(--muted);
  font-size: 12px;
}

.slide-captcha-track {
  position: relative;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
  touch-action: none;
}

.slide-captcha-fill {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 65%), color-mix(in srgb, var(--ok), transparent 74%));
  transition: width .08s linear;
}

.slide-captcha-label {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 760;
  pointer-events: none;
}

.slide-captcha-thumb {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 5px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary), transparent 70%);
  transition: left .08s linear;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.slide-captcha-thumb:active {
  cursor: grabbing;
}

.slide-captcha-track input {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
}

.slide-captcha-track input:active {
  cursor: grabbing;
}

.slide-captcha-box.is-passed .slide-captcha-track {
  border-color: color-mix(in srgb, var(--ok), transparent 48%);
}

.slide-captcha-box.is-passed .slide-captcha-label {
  color: var(--ok);
}

.modal-card.enterprise-modal {
  width: min(520px, calc(100vw - 28px));
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface), #fff 3%), color-mix(in srgb, var(--surface-soft), var(--surface) 36%));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.enterprise-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.enterprise-current {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 18px;
  background:
    radial-gradient(220px 110px at 0% 0%, color-mix(in srgb, var(--primary), transparent 72%), transparent 72%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong), transparent 12%), color-mix(in srgb, var(--surface), transparent 2%));
}

.enterprise-current small,
.enterprise-option small,
.enterprise-join p,
.enterprise-join label span {
  color: var(--ink-3);
}

.enterprise-current strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.enterprise-current p {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.enterprise-modal-note{margin:0;padding:10px 12px;border:1px solid color-mix(in srgb,#f59e0b,transparent 70%);border-radius:12px;background:color-mix(in srgb,#f59e0b,transparent 90%);color:var(--ink-2);font-size:12.5px}
.enterprise-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:4px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--surface-soft),transparent 34%)}.enterprise-tabs button{min-width:0;min-height:38px;border:0;border-radius:10px;background:transparent;color:var(--ink-2);font:inherit;font-size:13px;font-weight:760;cursor:pointer;transition:background .16s var(--ease-out),color .16s var(--ease-out),box-shadow .16s var(--ease-out)}.enterprise-tabs button:hover{background:color-mix(in srgb,var(--primary),transparent 92%);color:var(--ink)}.enterprise-tabs button.is-active{background:color-mix(in srgb,var(--primary),transparent 84%);color:var(--primary);box-shadow:0 10px 26px color-mix(in srgb,var(--primary),transparent 88%)}.enterprise-tabs button:focus{outline:3px solid color-mix(in srgb,var(--primary),transparent 72%);outline-offset:2px}
.enterprise-default-toggle{display:inline-flex;align-items:center;justify-self:start;gap:10px;min-height:40px;padding:8px 10px;border:1px solid transparent;border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 94%);color:var(--primary);font-size:13px;font-weight:650;cursor:pointer;transition:border-color .18s ease,background .18s ease,color .18s ease}.enterprise-default-check{width:22px;height:22px;flex:0 0 22px;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--primary),transparent 24%);border-radius:7px;background:transparent;color:transparent;box-shadow:none;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease}.enterprise-default-check svg{width:15px;height:15px;stroke-width:2.4}.enterprise-default-toggle.is-on,.enterprise-default-toggle:hover:not(:disabled){border-color:color-mix(in srgb,var(--primary),transparent 62%);background:color-mix(in srgb,var(--primary),transparent 88%)}.enterprise-default-toggle.is-on .enterprise-default-check{border-color:var(--primary);background:transparent;color:var(--primary)}.enterprise-default-toggle:hover:not(:disabled) span:last-child{text-decoration:underline;text-underline-offset:3px}.enterprise-default-toggle:focus{outline:3px solid color-mix(in srgb,var(--primary),transparent 68%);outline-offset:2px}.enterprise-default-toggle:disabled{cursor:not-allowed;opacity:.56}

.enterprise-list {
  display: grid;
  gap: 8px;
}

.enterprise-empty{min-height:80px;display:grid;align-items:center;padding:14px 12px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--surface-soft),transparent 36%);color:var(--ink-2);font-size:13px;line-height:1.6}

.enterprise-option{width:100%;min-width:0;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface-soft),transparent 28%);color:var(--ink);text-align:left;transition:transform .16s var(--ease-out),border-color .16s var(--ease-out),background .16s var(--ease-out)}.enterprise-option:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--primary),transparent 54%);background:color-mix(in srgb,var(--surface-strong),transparent 18%)}.enterprise-option:disabled{cursor:default;color:var(--ink)}.enterprise-option:disabled:hover,.enterprise-option.is-disabled:hover{transform:none}.enterprise-option.is-active{border-color:color-mix(in srgb,var(--primary),transparent 42%);background:color-mix(in srgb,var(--primary),transparent 86%)}.enterprise-option.is-selected{border-color:color-mix(in srgb,var(--primary),transparent 30%);background:color-mix(in srgb,var(--primary),transparent 84%)}.enterprise-option.is-disabled{border-color:color-mix(in srgb,var(--line),transparent 12%);background:color-mix(in srgb,var(--surface-soft),transparent 42%)}.enterprise-option.is-disabled:hover{border-color:color-mix(in srgb,var(--primary),transparent 68%)}
.enterprise-radio{width:18px;height:18px;display:grid;place-items:center;border:2px solid color-mix(in srgb,var(--ink-3),transparent 20%);border-radius:999px;background:var(--surface)}.enterprise-radio::after{width:8px;height:4px;border:solid #fff;border-width:0 0 2px 2px;content:"";opacity:0;transform:rotate(-45deg) translate(1px,-1px);transition:opacity .16s ease}.enterprise-option.is-selected .enterprise-radio{border-color:var(--primary);background:var(--primary)}.enterprise-option.is-selected .enterprise-radio::after{opacity:1}.enterprise-option.is-disabled .enterprise-radio{opacity:.5}

.enterprise-option strong{display:block;max-width:100%;overflow:hidden;color:var(--ink);font-size:14px;font-weight:720;text-overflow:ellipsis;white-space:nowrap}.enterprise-option small{display:block;margin-top:3px;overflow:hidden;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.enterprise-option em{justify-self:end;min-width:42px;padding:5px 8px;border-radius:999px;background:color-mix(in srgb,var(--primary),transparent 86%);color:var(--primary);font-size:11px;font-style:normal;font-weight:760;text-align:center;white-space:nowrap}.enterprise-option em.is-pending{background:color-mix(in srgb,#f59e0b,transparent 86%);color:#b7791f}.enterprise-option em.is-rejected{background:color-mix(in srgb,#ef4444,transparent 88%);color:#dc2626}.enterprise-option em.is-disabled{background:color-mix(in srgb,var(--line),transparent 48%);color:var(--ink-3)}

.enterprise-actions{display:flex;justify-content:flex-end;gap:10px}.enterprise-actions .primary-button{min-width:120px}.enterprise-actions .primary-button:disabled,.enterprise-modal .icon-action:disabled{cursor:progress;opacity:.68}.enterprise-actions .primary-button.is-loading{box-shadow:none}
.enterprise-join{display:grid;gap:12px;padding:14px;border:1px solid var(--line);border-radius:18px;background:color-mix(in srgb,var(--surface-soft),transparent 34%)}.enterprise-join strong{color:var(--ink);font-size:14px;font-weight:760}.enterprise-join p{margin-top:4px;font-size:12.5px;line-height:1.55}

.enterprise-entry-state{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:10px 12px;border:1px solid color-mix(in srgb,var(--primary),transparent 70%);border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 92%);color:var(--ink-2);font-size:12.5px;line-height:1.5}.enterprise-entry-state strong{min-width:58px;color:var(--primary);font-size:12px;font-weight:780;white-space:nowrap}.enterprise-entry-state span{min-width:0;overflow-wrap:anywhere}.enterprise-entry-state.is-pending_approval strong,.enterprise-entry-state.is-pending strong,.enterprise-entry-state.is-preparing strong{color:#b7791f}.enterprise-entry-state.is-failed strong,.enterprise-entry-state.is-revoked strong{color:#dc2626}
.enterprise-entry-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid color-mix(in srgb,var(--primary),transparent 72%);border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 92%)}.enterprise-entry-card strong{display:block;color:var(--ink);font-size:13px;font-weight:760}.enterprise-entry-card small{display:block;margin-top:3px;color:var(--ink-2);font-size:12px;line-height:1.45}.enterprise-entry-card em{font-style:normal;color:var(--primary);font-size:12px;font-weight:760;white-space:nowrap}

.enterprise-join label{display:grid;gap:7px}.enterprise-join input{width:100%;min-height:42px;padding:0 12px;border:1px solid var(--line);border-radius:12px;outline:0;background:color-mix(in srgb,var(--surface),transparent 10%);color:var(--ink);font:inherit;font-size:13.5px;box-shadow:none;transition:border-color .16s var(--ease-out),box-shadow .16s var(--ease-out),background .16s var(--ease-out)}.enterprise-join input:focus{border-color:color-mix(in srgb,var(--primary),transparent 38%);background:color-mix(in srgb,var(--surface),transparent 0%);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary),transparent 82%)}.enterprise-join .primary-button{width:100%}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  overflow: auto;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.contact-apply-flow {
  display: grid;
  gap: 16px;
  padding: 18px 20px 22px;
}

.contact-search-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 10%);
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong), transparent 8%), color-mix(in srgb, var(--surface), transparent 4%));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff, transparent 92%);
}

.contact-search-card-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.contact-search-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 62%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary), transparent 90%);
  color: var(--primary);
}

.contact-search-mark svg {
  width: 17px;
  height: 17px;
}

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

.contact-search-card-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
}

.contact-search-card-head small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.contact-search-field,
.contact-verify-field {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 620;
}

.contact-search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.contact-input-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-soft), transparent 3%);
  color: var(--ink-3);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.contact-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--primary), transparent 32%);
  background: color-mix(in srgb, var(--surface), transparent 0%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%);
}

.contact-input-wrap svg {
  width: 16px;
  height: 16px;
}

.contact-search-field input,
.contact-verify-field textarea {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
}

.contact-search-field input {
  min-height: 40px;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.contact-search-field input:focus,
.contact-search-field input:focus {
  border: 0 !important;
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

.contact-search-field .contact-search-button {
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--primary), #fff 10%);
  border-radius: 13px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #7ab7ff 18%), color-mix(in srgb, var(--primary), #7b68ff 24%));
  color: #fff;
  font-weight: 720;
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--primary), transparent 74%),
    inset 0 1px 0 rgba(255, 255, 255, .18);
}

.contact-search-field .contact-search-button:hover {
  border-color: color-mix(in srgb, var(--primary), #fff 24%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #8fc5ff 24%), color-mix(in srgb, var(--primary), #8a76ff 32%));
  color: #fff;
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--primary), transparent 68%),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

.contact-search-field .contact-search-button:disabled {
  opacity: .72;
  transform: none;
  cursor: wait;
}

.contact-verify-field textarea {
  min-height: 92px;
  resize: vertical;
}

.contact-search-state {
  display: grid;
  gap: 6px;
  min-height: 72px;
  align-content: center;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface), transparent 18%);
}

.contact-search-guide {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 28%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface), transparent 30%);
}

.contact-search-guide strong,
.contact-search-state strong {
  color: var(--ink);
  font-size: 14px;
}

.contact-search-guide small,
.contact-search-state small {
  color: var(--ink-3);
  font-size: 12px;
}

.contact-search-state.loading-state {
  border-style: solid;
}

.contact-search-state.loading-state span {
  width: 100%;
}

.contact-search-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 70%);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 91%), color-mix(in srgb, var(--surface-strong), transparent 8%));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary), transparent 88%);
}

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

.contact-search-result strong {
  color: var(--ink);
  font-size: 14px;
}

.contact-search-result small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.contact-apply-submit {
  width: 100%;
}

.contact-apply-flow .muted-note {
  margin: -2px 0 0;
}

.span-2 {
  grid-column: 1 / -1;
}

.modal-preview {
  min-height: 360px;
  margin: 16px;
}

.seen-list {
  display: grid;
  gap: 8px;
  padding: 16px;
  overflow: auto;
}

.seen-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(110px, 0.45fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.seen-row strong,
.seen-row small {
  display: block;
}

.seen-row small,
.seen-row span:nth-child(3),
.seen-row time {
  color: var(--muted);
  font-size: 12px;
}

.drawer-layer { display: grid; grid-template-rows: minmax(0, 1fr); align-items: stretch; justify-content: end; min-height: 0; overflow: hidden; }

.drawer-card { width: min(480px, calc(100vw - 28px)); height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; animation: drawer-in .22s var(--ease-out); }

.drawer-body { min-height: 0; padding: 16px; overflow: auto; }

.drawer-card.drawer-invite {
  width: min(520px, calc(100vw - 28px));
}

.drawer-card.drawer-group-create {
  width: min(560px, calc(100vw - 28px));
}

.drawer-card.drawer-invite .drawer-body,
.drawer-card.drawer-group-create .drawer-body { display: grid; overflow: hidden; }

/* Optional errors and summaries belong to the fields, never to implicit rows.
   On short windows only the fields and candidates scroll; actions stay visible. */
.invite-friends-panel,
.group-create-panel { min-height: 0; height: 100%; display: flex; flex-direction: column; gap: 14px; }

.group-member-picker-fields { flex: 0 1 auto; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; }
.group-member-picker-fields > * { flex: 0 0 auto; }
.group-member-picker-fields > .invite-search-note { margin: 0; }

.invite-friends-panel > .invite-friend-list, .group-create-panel > .invite-friend-list { flex: 1 0 72px; }
.invite-friends-panel > .group-create-actions, .group-create-panel > .group-create-actions { flex: 0 0 auto; }
.group-create-confirm-card strong { overflow-wrap: anywhere; }

.group-create-name,
.invite-search-field { display: grid; gap: 8px; color: var(--ink-2); font-size: 12px; font-weight: 800; }

.group-create-name input,
.invite-search-field input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--surface-soft); color: var(--ink); font: inherit; outline: none; }

.group-create-name input { height: 44px; }
.invite-search-field input { height: 42px; }

.group-create-name input:focus,
.invite-search-field input:focus { border-color: color-mix(in srgb, var(--primary), var(--line) 18%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%); }

.invite-target-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 42%);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 46%), var(--surface));
}

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

.invite-target-card strong {
  color: var(--ink);
  font-size: 15px;
}

.invite-target-card small,
.invite-search-note,
.invite-friend-copy small {
  color: var(--ink-2);
}

.invite-search-note {
  padding: 0 2px;
  font-size: 12.5px;
  line-height: 1.6;
}

.invite-friend-list { min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 10px; padding-right: 4px; }

.invite-selection-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; color: var(--ink-2); font-size: 12px; font-weight: 760; }

.invite-selection-summary button { min-height: 28px; padding: 0 10px; border-radius: 10px; color: var(--primary); background: color-mix(in srgb, var(--primary-soft), transparent 26%); }
.group-picker-summary-actions { display: flex; gap: 6px; }
.invite-selection-summary .group-picker-select-all { min-height: 28px; white-space: nowrap; }
.invite-selection-summary .group-picker-select-all:disabled { color: var(--ink-2); background: var(--raise); cursor: not-allowed; }

.group-create-confirm-card { display: grid; gap: 6px; padding: 16px; border: 1px solid color-mix(in srgb, var(--primary), var(--line) 38%); border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 44%), var(--surface)); }

.group-create-confirm-card small,
.group-create-confirm-card p { margin: 0; color: var(--ink-2); }

.group-create-confirm-card strong { color: var(--ink); font-size: 18px; }

.group-create-selected-list .invite-friend-row { grid-template-columns: auto minmax(0, 1fr) auto; }

.invite-friend-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); transition: transform .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out); }

.invite-friend-row:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary), var(--line) 48%); background: var(--surface); }

.invite-friend-row.is-disabled { opacity: .72; }

.invite-friend-row.is-selected { border-color: color-mix(in srgb, var(--primary), var(--line) 28%); background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%); }

.invite-friend-copy { min-width: 0; }

.invite-friend-copy strong,
.invite-friend-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.invite-friend-copy strong { color: var(--ink); font-size: 14px; }

.invite-friend-copy small { margin-top: 3px; font-size: 12px; }

.status-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 11.5px; white-space: nowrap; }

.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ink-3); }

.status-dot[data-status="online"]::before { background: var(--ok); }

.status-dot[data-status="offline"]::before { background: var(--muted); }

.invite-friend-row button { min-height: 34px; padding: 0 12px; border-radius: 11px; white-space: nowrap; }

.invite-friend-row button:disabled { cursor: not-allowed; color: var(--ink-3); background: var(--raise); box-shadow: none; }

.group-create-actions { padding-top: 12px; border-top: 1px solid var(--line); background: var(--surface); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.group-create-actions button { min-height: 42px; border-radius: 13px; }

.drawer-card.drawer-edit-profile {
  width: min(520px, calc(100vw - 28px));
}

.drawer-card.drawer-edit-remark {
  width: min(480px, calc(100vw - 28px));
}

.edit-profile-panel {
  display: grid;
  gap: 14px;
}

.edit-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 42%);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 46%), var(--surface));
}

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

.edit-profile-card strong {
  color: var(--ink);
  font-size: 15px;
}

.edit-profile-card small {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
}

.profile-edit-form {
  padding: 0;
  overflow: visible;
}

.profile-edit-form input,
.profile-edit-form select {
  min-height: 42px;
}

.remark-edit-form {
  display: grid;
  gap: 10px;
}

.remark-edit-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}

.remark-edit-form textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

.remark-edit-form p {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.6;
}

.edit-profile-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
}

.edit-profile-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--raise);
  color: var(--ink);
}

.edit-profile-actions .primary-button {
  border: 0;
  color: #fff;
}

.tool-grid {
  display: grid;
  gap: 10px;
}

.tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tool-card p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.toast-stack {
  position: fixed;
  z-index: 90;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 36px));
  height: 104px;
  pointer-events: none;
  perspective: 900px;
  transition: height .28s var(--ease-out);
}

.toast-stack:hover,
.toast-stack:focus-within {
  height: min(312px, calc(100vh - 36px));
}

.toast {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
  transform:
    translate3d(0, calc(var(--toast-depth) * 16px), calc(var(--toast-depth) * -1px))
    scale(calc(1 - var(--toast-depth) * .045));
  opacity: calc(1 - var(--toast-depth) * .08);
  transition:
    transform .35s cubic-bezier(.25,.75,.6,.98),
    opacity .24s ease,
    border-color .18s ease,
    background .18s ease;
  will-change: transform;
}

.toast-stack:hover .toast,
.toast-stack:focus-within .toast {
  transform: translate3d(0, calc(var(--toast-depth) * 82px), 0) scale(1);
  opacity: 1;
}

.toast-content {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.toast-content strong,
.toast-content p {
  overflow-wrap: anywhere;
}

.toast-close {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.toast-close:hover {
  background: color-mix(in srgb, var(--ink), transparent 92%);
  color: var(--ink);
}

.toast[data-tone="warn"] {
  border-left-color: var(--warn);
}

.toast[data-tone="danger"] {
  border-left-color: var(--danger);
}

.toast p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

/* Global page-loading surfaces (login overlay + in-app thin bar).
   Body-level fixed layer: z-index 980 sits above the message interaction
   overlay host (220) and below the slide-captcha mask (1200), so the captcha
   stays visible and clickable on top of the login overlay. Both surfaces are
   pointer-events: none — they never intercept clicks. */
.page-loading-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 980;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.page-loading-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: color-mix(in srgb, var(--bg) 64%, transparent);
  backdrop-filter: blur(3px);
}

.page-loading-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.page-loading-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-top-color: var(--primary);
  animation: page-loading-spin 0.8s linear infinite;
}

.page-loading-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 980;
  overflow: hidden;
  pointer-events: none;
}

.page-loading-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 999px;
  background: var(--primary);
  animation: page-loading-slide 1.1s ease-in-out infinite;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes page-loading-slide {
  0% {
    left: -38%;
  }
  100% {
    left: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading-spinner,
  .page-loading-bar::before {
    animation: none;
  }

  .page-loading-bar::before {
    left: 0;
    width: 100%;
    opacity: 0.55;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawer-in {
  from {
    transform: translateX(18px);
  }
  to {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1220px) {
  .im-shell,
  .im-shell.is-detail-open {
    grid-template-columns: var(--rail-w) minmax(292px, var(--side-w)) minmax(0, 1fr);
  }

  .context-panel {
    position: fixed;
    z-index: 55;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, calc(100vw - var(--rail-w)));
    border-left: 1px solid var(--line);
  }

  .im-shell.is-detail-open .context-panel {
    display: grid;
  }
}

@media (max-width: 980px) {
  :root {
    --side-w: 312px;
  }

  .topbar-actions .ok-chip,
  .topbar-actions .alert-chip {
    display: none;
  }

  .content-grid,
  .content-grid.three {
    grid-template-columns: 1fr;
  }

  .group-members-list {
    grid-template-columns: 1fr;
  }

  .composer-tool i {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --rail-w: 64px;
    --mobile-side-w: min(300px, calc(100vw - var(--rail-w) - 36px));
  }

  .im-shell,
  .im-shell.is-detail-open {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .brand-button,
  .rail-user {
    width: 48px;
  }

  .rail-item {
    width: 48px;
  }

  .rail-label {
    display: none;
  }

  .side-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: var(--rail-w);
    width: var(--mobile-side-w);
    transform: translateX(calc(-100% - var(--rail-w)));
    transition: transform 0.18s ease;
    border-left: 1px solid var(--line);
  }

  .im-shell.is-list-open .side-panel {
    transform: translateX(0);
  }

  .list-scrim {
    position: fixed;
    z-index: 58;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(var(--rail-w) + var(--mobile-side-w));
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--scrim);
    animation: scrim-in 0.18s var(--ease-out);
  }

  .list-scrim:hover {
    background: var(--scrim);
  }

  .list-toggle {
    display: inline-grid;
  }

  .workspace-topbar {
    min-height: 62px;
    padding: 10px 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions > button:not(.primary-button):not(.detail-action):not(.icon-action),
  .conversation-hero .hero-actions,
  .room-strip-actions {
    display: none;
  }

  .room-strip,
  .conversation-hero,
  .message-scroll,
  .composer-panel,
  .page-scroll {
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .message-row,
  .message-row.is-me {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-row > .avatar {
    display: none;
  }

  .room-strip-main {
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
  }

  .composer-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .composer-tool {
    min-width: 58px;
    justify-content: center;
  }

  .composer-tool i {
    display: none;
  }

  .emoji-popover {
    left: calc(var(--rail-w) + 12px);
    right: 12px;
    bottom: 172px;
    width: auto;
  }

  .seen-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .seen-row span:nth-child(3),
  .seen-row time {
    grid-column: 2;
  }

  .composer-footer {
    align-items: stretch;
  }

  .composer-footer span {
    display: none;
  }

  .form-grid,
  .info-grid,
  .theme-cards {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .video-grid {
    grid-template-columns: 1fr;
    min-height: 520px;
  }
}

.im-shell { --radius: 12px; }

.brand-button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 8px 22px rgba(79, 140, 255, 0.42);
}

.brand-button.has-logo {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 22px rgba(79, 140, 255, 0.24);
}
.rail-item { border-radius: 14px; }
.rail-item:hover {
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
}
.rail-item.is-active {
  border: 1px solid color-mix(in srgb, var(--primary), transparent 60%);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary), transparent 84%),
    color-mix(in srgb, var(--secondary), transparent 87%));
  color: var(--primary);
  box-shadow: none;
}
.rail-item.is-active::before { background: linear-gradient(180deg, #4f8cff, #7c6bff); }
.rail-badge { background: linear-gradient(135deg, #ff6f7d, #ff4d62); box-shadow: 0 4px 12px rgba(255, 77, 98, 0.4); }

.filter-tabs { gap: 4px; padding: 4px; border-radius: 12px; }
.filter-tabs button { border: 0; border-radius: 9px; }
.filter-tabs button.is-active {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary), transparent 84%),
    color-mix(in srgb, var(--secondary), transparent 88%));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 62%);
}

.conversation-card { border-radius: 14px; }
.conversation-card.is-active,
.plain-row.is-active,
.file-card.is-active {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary), transparent 84%),
    color-mix(in srgb, var(--secondary), transparent 89%));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 64%);
}
.conversation-card.is-active::before { background: linear-gradient(180deg, #4f8cff, #7c6bff); }

.bubble {
  border-radius: 16px;
  border-top-left-radius: 6px;
}
.message-row.is-me .bubble {
  border: 0;
  border-radius: 16px;
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary), transparent 70%);
}
.message-row.is-me .bubble p,
.message-row.is-me .bubble a { color: #fff; }
.message-row.is-me .bubble blockquote { border-left-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.12); }
.message-row.is-me .bubble blockquote b,
.message-row.is-me .bubble blockquote span { color: rgba(255, 255, 255, 0.9); }

.composer {
  border-radius: 18px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--ink), transparent 90%);
}

.quick-reaction-bar { border-radius: 999px; box-shadow: 0 16px 38px color-mix(in srgb, var(--ink), transparent 78%); }
.quick-reaction-bar button { border-radius: 50%; }

.is-primary,
[data-variant="primary"] {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.36);
}
.is-primary:hover,
[data-variant="primary"]:hover { background: linear-gradient(135deg, #5b95ff 0%, #8676ff 100%); }

.rail-ico { display: grid; place-items: center; }
.rail-ico svg { width: 22px; height: 22px; }
.rail-item { gap: 0; }
.brand-button { border-radius: 14px; }

.avatar {
  border-radius: 13px;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.26);
}
.avatar-user { background: linear-gradient(135deg, #b66bff 0%, #7c6bff 100%); }
.avatar.is-system { background: linear-gradient(135deg, #3a4670 0%, #566089 100%); box-shadow: none; }
.avatar-soft {
  background: color-mix(in srgb, var(--primary), transparent 86%);
  color: var(--primary);
  box-shadow: none;
}
.avatar-xl { border-radius: 20px; }

.icon-action svg { width: 18px; height: 18px; display: block; }
.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  color: var(--ink-2, var(--ink));
  background: transparent;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-action:hover {
  background: color-mix(in srgb, var(--ink), transparent 92%);
  color: var(--ink);
}
.icon-action.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.icon-action.is-primary {
  color: #fff;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.34);
}
.icon-action.is-primary:hover { background: linear-gradient(135deg, #5b95ff 0%, #8676ff 100%); color: #fff; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}
.panel-head strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
  color: var(--ink);
}
.panel-head-acts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.announcement-top-button {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 10%);
  color: color-mix(in srgb, var(--muted), var(--primary) 18%);
  line-height: 0;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.announcement-top-button svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.announcement-top-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 66%);
  color: var(--primary);
}

.announcement-top-button span {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: #ff5c7a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(255, 92, 122, .26);
}

.announcement-top-button.has-unread {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 44%);
}

.message-sound-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 10%);
  color: color-mix(in srgb, var(--muted), var(--primary) 18%);
  line-height: 0;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.message-sound-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.message-sound-toggle:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 66%);
  color: var(--primary);
}

.message-sound-toggle.is-on {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 35%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 54%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary), transparent 78%);
}

.theme-quick-toggle {
  position: relative;
  width: 64px;
  min-width: 64px;
  height: 32px;
  min-height: 32px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid #27272a;
  background: #09090b;
  color: #71717a;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.theme-quick-toggle:hover {
  color: #e4e4e7;
  border-color: #3f3f46;
  background: #09090b;
}

.theme-quick-toggle:focus {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 40%);
  outline-offset: 2px;
}

.theme-quick-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-quick-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #71717a;
  opacity: 1;
  pointer-events: none;
}

.theme-quick-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #27272a;
  border: 0;
  box-shadow: none;
  transition: transform .24s ease, background .2s ease, color .2s ease;
  pointer-events: none;
}

.theme-quick-toggle.is-light .theme-quick-thumb {
  transform: translateX(32px);
  color: #374151;
  background: #e5e7eb;
  box-shadow: none;
}

body[data-theme="aurora"] .theme-quick-toggle {
  background: #fff;
  border-color: #e5e7eb;
  color: #111827;
}

body[data-theme="aurora"] .theme-quick-toggle:hover {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}

body[data-theme="aurora"] .theme-quick-icon {
  color: #111827;
}

body[data-theme="midnight"] .theme-quick-toggle {
  background: #09090b;
  border-color: #27272a;
  color: #71717a;
}

body[data-theme="midnight"] .theme-quick-toggle:hover {
  background: #09090b;
  color: #e4e4e7;
  border-color: #3f3f46;
}

body[data-theme="midnight"] .theme-quick-thumb {
  background: #27272a;
  color: #fff;
  box-shadow: none;
}

.theme-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink), transparent 94%);
  border: 1px solid color-mix(in srgb, var(--ink), transparent 90%);
}
.theme-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-2, var(--ink));
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.theme-toggle button svg { width: 17px; height: 17px; }
.theme-toggle button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.30);
}

.side-section-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3, var(--ink-2));
  background: color-mix(in srgb, var(--ink), transparent 92%);
}

:root {
  --bg: #070a12;
  --bg-soft: #0b0f1a;
  --ink: #e8edf9;
  --ink-2: #9aa6c2;
  --ink-3: #5c6680;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .025);
  --glass: rgba(17, 22, 36, .55);
  --raise: rgba(255, 255, 255, .04);
  --brand: #5b9dff;
  --brand-2: #8b7bff;
  --cyan: #6ad6ff;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .14));
  --ok: #37e0a6;
  --warn: #ffcc6b;
  --danger: #ff6f7d;
  --bad: #ff6f7d;
  --surface: rgba(255, 255, 255, .035);
  --surface-soft: rgba(255, 255, 255, .04);
  --surface-strong: rgba(255, 255, 255, .08);
  --primary: #5b9dff;
  --primary-soft: rgba(79, 140, 255, .14);
  --secondary: #8b7bff;
  --accent: #ff6f7d;
  --muted: #9aa6c2;
  --soft: #5c6680;
  --bubble-me: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --bubble-other: rgba(255, 255, 255, .05);
  --scrim: rgba(4, 7, 14, .62);
  --rail-w: 74px;
  --side-w: 332px;
  --detail-w: 312px;
  --radius: 14px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --sh: 0 12px 40px rgba(0, 0, 0, .45);
  --sh-sm: 0 6px 20px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body,
body[data-theme="aurora"],
body[data-theme="teal"],
body[data-theme="graphite"],
body[data-theme="midnight"] {
  --bg: #070a12;
  --bg-soft: #0b0f1a;
  --ink: #e8edf9;
  --ink-2: #9aa6c2;
  --ink-3: #5c6680;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --panel: rgba(255, 255, 255, .025);
  --glass: rgba(17, 22, 36, .55);
  --raise: rgba(255, 255, 255, .04);
  --brand: #5b9dff;
  --brand-2: #8b7bff;
  --cyan: #6ad6ff;
  --grad: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .14));
  --ok: #37e0a6;
  --warn: #ffcc6b;
  --danger: #ff6f7d;
  --bad: #ff6f7d;
  --surface: rgba(255, 255, 255, .035);
  --surface-soft: rgba(255, 255, 255, .04);
  --surface-strong: rgba(255, 255, 255, .08);
  --primary: #5b9dff;
  --primary-soft: rgba(79, 140, 255, .14);
  --secondary: #8b7bff;
  --accent: #ff6f7d;
  --muted: #9aa6c2;
  --soft: #5c6680;
  --bubble-me: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%);
  --bubble-other: rgba(255, 255, 255, .05);
  --scrim: rgba(4, 7, 14, .62);
  color-scheme: dark;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(79, 140, 255, .20), transparent 60%),
    radial-gradient(900px 500px at 8% 4%, rgba(124, 107, 255, .16), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(106, 214, 255, .07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body:not([data-theme="aurora"]) {
  --ink-2: #b8c4dc;
  --ink-3: #8794b2;
  --muted: #b8c4dc;
  --soft: #8794b2;
  --line: rgba(203, 213, 225, .12);
  --line-2: rgba(203, 213, 225, .20);
  --surface-soft: rgba(255, 255, 255, .055);
  --surface-strong: rgba(255, 255, 255, .10);
}

body[data-theme="aurora"] {
  --bg: #e9edf6;
  --bg-soft: #ffffff;
  --ink: #1b2336;
  --ink-2: #56627d;
  --ink-3: #93a0b8;
  --line: rgba(20, 30, 55, .10);
  --line-2: rgba(20, 30, 55, .17);
  --panel: rgba(20, 30, 55, .02);
  --glass: rgba(255, 255, 255, .72);
  --raise: rgba(20, 30, 55, .045);
  --grad-soft: linear-gradient(135deg, rgba(79, 140, 255, .14), rgba(124, 107, 255, .12));
  --surface: rgba(255, 255, 255, .82);
  --surface-soft: rgba(20, 30, 55, .045);
  --surface-strong: rgba(20, 30, 55, .08);
  --muted: #56627d;
  --soft: #93a0b8;
  --bubble-other: #eef2f8;
  --scrim: rgba(40, 52, 86, .32);
  --sh: 0 14px 44px rgba(35, 48, 82, .16);
  --sh-sm: 0 6px 20px rgba(35, 48, 82, .10);
  color-scheme: light;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(79, 140, 255, .14), transparent 60%),
    radial-gradient(900px 500px at 8% 4%, rgba(124, 107, 255, .12), transparent 55%),
    #e6eaf4;
}

body[data-theme="aurora"] .im-shell {
  background: linear-gradient(180deg, #ffffff, #f4f6fb);
}

body[data-theme="aurora"] .app-rail {
  background: rgba(244, 247, 252, .82);
}

body[data-theme="aurora"] .side-panel,
body[data-theme="aurora"] .context-panel {
  background: rgba(248, 250, 253, .74);
}

body[data-theme="aurora"] .workspace,
body[data-theme="aurora"] .chat-workspace {
  background: rgba(250, 252, 255, .78);
}

body[data-theme="aurora"] .workspace-topbar,
body[data-theme="aurora"] .pane-head,
body[data-theme="aurora"] .stage-head {
  background: rgba(252, 253, 255, .82);
}

body[data-theme="aurora"] .composer-panel,
body[data-theme="aurora"] .conversation-card,
body[data-theme="aurora"] .panel,
body[data-theme="aurora"] .set-group,
body[data-theme="aurora"] .fcard,
body[data-theme="aurora"] .modal-card,
body[data-theme="aurora"] .drawer-card,
body[data-theme="aurora"] .menu-popover {
  background: rgba(255, 255, 255, .86);
}

body[data-theme="aurora"] .bubble {
  background: #eef2f8;
  color: #1b2336;
}

body[data-theme="aurora"] .message-row.is-inbox-message .bubble {
  border-color: rgba(37, 99, 235, .18);
  background:
    linear-gradient(135deg, rgba(219, 234, 254, .92), rgba(255, 255, 255, .96) 74%),
    #fff;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .08);
}

body[data-theme="aurora"] .message-row.is-inbox-message .bubble p {
  color: #1f2a44;
}

body[data-theme="aurora"] .message-row.is-me .bubble {
  color: #fff;
}

body[data-theme="aurora"] .message-row.is-failed .bubble,
body[data-theme="aurora"] .message-row.is-me.is-failed .bubble {
  border: 1px solid rgba(226, 86, 106, .42);
  background: linear-gradient(180deg, rgba(255, 238, 241, .96), rgba(255, 229, 233, .9));
  color: #8f2433;
  box-shadow: 0 14px 34px rgba(226, 86, 106, .10);
}

/* User presence intelligence and 30-day behavior analysis. */
.topbar-behavior-entry {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft), transparent 18%);
  color: var(--ink-2);
}

.topbar-behavior-entry:hover,
.topbar-behavior-entry:focus {
  border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
}

.topbar-behavior-entry svg {
  width: 15px;
  height: 15px;
}

.inline-status[data-status="offline"] {
  color: var(--ink-3);
}

.inline-status[data-status="unknown"] {
  color: var(--muted);
  font-weight: 560;
}

.behavior-intelligence-layer {
  z-index: 82;
  background: color-mix(in srgb, var(--scrim), transparent 30%);
  backdrop-filter: blur(1px);
}

.modal-card.behavior-intelligence-modal {
  width: min(960px, calc(100vw - 48px));
  height: min(790px, calc(100vh - 42px));
  max-height: min(820px, calc(100vh - 42px));
  border-radius: 18px;
  box-shadow: 0 30px 80px color-mix(in srgb, #050914, transparent 45%);
}

.behavior-intelligence-modal .behavior-modal-titlebar {
  align-items: center;
  padding: 16px 20px;
}

.behavior-modal-titlebar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.behavior-modal-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 20px 16px;
  scrollbar-gutter: stable;
}

.behavior-interval-quality {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 8px 12px 0 40px;
  color: var(--ink-3);
  font-size: 11px;
}

.behavior-profile-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-bottom: 14px;
}

.behavior-profile-identity,
.behavior-profile-presence,
.behavior-range-tools,
.behavior-panel-head,
.behavior-modal-footer,
.behavior-modal-footer > div,
.behavior-risk-evidence summary,
.behavior-session-note {
  display: flex;
  align-items: center;
}

.behavior-profile-identity {
  min-width: 0;
  gap: 11px;
}

.avatar.behavior-profile-avatar {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
}

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

.behavior-profile-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.behavior-profile-copy span,
.behavior-panel-head p,
.behavior-session-note,
.behavior-modal-footer p,
.behavior-risk-evidence small {
  color: var(--muted);
  font-size: 11.5px;
}

.behavior-profile-presence {
  min-width: 0;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.behavior-profile-presence > span:not(:last-child)::after {
  content: "·";
  margin-left: 7px;
  color: var(--line-2);
}

.behavior-profile-presence .behavior-ip-lock::after,
.behavior-profile-presence .behavior-risk-pill::after {
  content: none;
}

.behavior-live-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok);
  font-weight: 700;
}

.behavior-live-state > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor, transparent 86%);
}

.behavior-live-state[data-status="offline"] {
  color: var(--ink-3);
}

.behavior-ip-lock {
  display: inline-flex;
  color: var(--ink-3);
}

.behavior-ip-lock svg {
  width: 13px;
  height: 13px;
}

.behavior-risk-pill,
.behavior-settlement,
.behavior-summary-state,
.behavior-merge-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-style: normal;
  font-weight: 680;
}

.behavior-risk-pill {
  padding: 5px 9px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 35%);
  color: var(--ink-2);
}

.behavior-risk-pill[data-risk="medium"] {
  background: color-mix(in srgb, var(--warn), transparent 88%);
  color: var(--warn);
}

.behavior-risk-pill[data-risk="high"] {
  background: color-mix(in srgb, var(--danger), transparent 89%);
  color: var(--danger);
}

.behavior-range-tools {
  position: relative;
  justify-content: flex-end;
  min-width: 0;
}

.behavior-date-range {
  position: relative;
  min-width: 0;
}

.behavior-date-range-trigger {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-soft), transparent 20%);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 620;
}

.behavior-date-range-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.behavior-date-range-trigger svg {
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.behavior-date-range-trigger:hover,
.behavior-date-range-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 54%);
  background: color-mix(in srgb, var(--primary), transparent 92%);
  color: var(--primary);
}

.behavior-date-range-trigger:focus,
.behavior-date-range-popover button:focus {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 25%);
  outline-offset: 2px;
}

.behavior-date-range-popover {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: 0;
  width: min(338px, calc(100vw - 48px));
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 72%);
  border-radius: 13px;
  background: var(--bg-soft);
  color: var(--ink-2);
  box-shadow: 0 18px 46px color-mix(in srgb, #050914, transparent 76%);
}

.behavior-date-range-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.behavior-date-range-quick button,
.behavior-date-range-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft), transparent 12%);
  color: var(--ink-2);
  font-size: 11.5px;
}

.behavior-date-range-quick button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary), transparent 58%);
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
  font-weight: 700;
}

.behavior-date-range-hint,
.behavior-date-range-error {
  min-height: 16px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.behavior-date-range-error {
  color: var(--danger);
}

.behavior-date-range-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 7px;
  align-items: center;
}

.behavior-date-range-actions .primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.behavior-detail-region {
  position: relative;
  min-width: 0;
}

.behavior-detail-region .behavior-range-tools {
  margin-bottom: 12px;
}

.behavior-detail-shield {
  position: absolute;
  z-index: 10;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), transparent 48%);
  backdrop-filter: blur(1px);
}

.behavior-detail-shield > span {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.behavior-detail-shield svg { width: 18px; height: 18px; flex-shrink: 0; }
.behavior-chart-placeholder, .behavior-timeline-placeholder {
  display: grid;
  align-content: space-evenly;
  min-height: 270px;
}
.behavior-chart-placeholder > span, .behavior-timeline-placeholder > span {
  display: block;
  height: 1px;
  background: var(--line);
}
.behavior-timeline-placeholder > span {
  height: 42px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--line), transparent 55%);
}

.behavior-analysis-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, .98fr) minmax(0, 1.05fr);
  gap: 14px;
}

.behavior-overview-panel,
.behavior-timeline-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 32%);
}

.behavior-timeline-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.behavior-panel-head {
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 12px;
}

.behavior-panel-head h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.behavior-panel-head h3 svg {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.behavior-panel-head p {
  margin: 2px 0 0;
}

.behavior-metric-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface), transparent 35%);
}

.behavior-metric-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.behavior-metric-tabs button.is-active {
  background: color-mix(in srgb, var(--primary), transparent 87%);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 82%);
}

.behavior-chart-wrap {
  display: grid;
  --behavior-plot-top: 8px;
  --behavior-plot-bottom: 20px;
  --behavior-plot-mid: calc((100% + var(--behavior-plot-top) - var(--behavior-plot-bottom)) / 2);
  grid-template-rows: auto 246px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 270px;
}

.behavior-chart-scale {
  position: relative;
  height: 246px;
  color: var(--muted);
  font-size: 10.5px;
}

.behavior-chart-scale > span { position: absolute; right: 4px; transform: translateY(-50%); }
.behavior-chart-scale > span:first-child { top: var(--behavior-plot-top); }
.behavior-chart-scale > span:nth-child(2) { top: var(--behavior-plot-mid); }
.behavior-chart-scale > span:last-child { top: calc(100% - var(--behavior-plot-bottom)); }

.behavior-chart-unit {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 18px;
}

.behavior-chart {
  position: relative;
  height: 246px;
  display: grid;
  grid-template-columns: repeat(var(--behavior-day-count, 30), minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  padding-top: 8px;
}

.behavior-chart-guide {
  position: absolute;
  z-index: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: color-mix(in srgb, var(--line), transparent 25%);
  pointer-events: none;
}

.behavior-chart-guide.is-top { top: var(--behavior-plot-top); }
.behavior-chart-guide.is-mid { top: var(--behavior-plot-mid); }
.behavior-chart-guide.is-base { bottom: var(--behavior-plot-bottom); }

.behavior-chart-day {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 238px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 20px;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.behavior-chart-column {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.behavior-chart-column > i {
  width: min(8px, 74%);
  height: var(--behavior-bar-height);
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--primary), #fff 58%);
  transition: height .18s var(--ease-out), background .15s var(--ease-out), box-shadow .15s var(--ease-out);
}

.behavior-chart-day.is-positive .behavior-chart-column > i {
  min-height: 3px;
}

.behavior-chart-day.is-unknown .behavior-chart-column {
  align-items: center;
}

.behavior-chart-unknown {
  width: 1em;
  white-space: normal;
  overflow-wrap: anywhere;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
}

.behavior-chart-day:hover .behavior-chart-column > i,
.behavior-chart-day:focus .behavior-chart-column > i {
  background: color-mix(in srgb, var(--primary), #fff 32%);
}

.behavior-chart-day.is-selected .behavior-chart-column > i {
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary), #fff 24%), 0 7px 16px color-mix(in srgb, var(--primary), transparent 74%);
}

.behavior-chart-column > em {
  position: absolute;
  bottom: calc(var(--behavior-bar-height) + 4px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e3d;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface), transparent 5%);
}

.behavior-chart-day small {
  min-width: 25px;
  justify-self: center;
  padding-top: 5px;
  font-size: 9.5px;
  white-space: nowrap;
}

.behavior-chart-day:focus {
  outline: 2px solid color-mix(in srgb, var(--primary), transparent 25%);
  outline-offset: 2px;
  border-radius: 5px;
}

.behavior-chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 26px;
  padding: 1px 2px 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.behavior-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.behavior-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--primary), #fff 58%);
}

.behavior-chart-legend i.is-risk {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e3d;
}

.behavior-chart-legend i.is-selected {
  border: 2px solid var(--primary);
  background: transparent;
}

.behavior-day-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface), transparent 28%);
}

.behavior-day-summary > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
}

.behavior-day-summary > div:last-child { border-right: 0; }
.behavior-day-summary strong { color: var(--ink); font-size: 12px; }
.behavior-day-summary span,
.behavior-day-summary small { color: var(--muted); font-size: 10px; }
.behavior-day-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.behavior-summary-state {
  width: fit-content;
  padding: 3px 7px;
  background: color-mix(in srgb, var(--ink-3), transparent 88%);
  color: var(--ink-2) !important;
}

.behavior-summary-state.is-live,
.behavior-settlement.is-live {
  background: color-mix(in srgb, var(--ok), transparent 87%);
  color: var(--ok) !important;
}

.behavior-session-note {
  gap: 6px;
  margin: 9px 0 0;
}

.behavior-session-note svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.behavior-settlement {
  padding: 5px 9px;
  background: color-mix(in srgb, var(--ink-3), transparent 88%);
  color: var(--ink-2);
  font-size: 10.5px;
}

.behavior-interval-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
}

.behavior-interval {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface), transparent 24%);
  overflow: hidden;
}

.behavior-interval[open] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 52%);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary), transparent 94%);
}

.behavior-interval summary {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  grid-template-areas: "chevron title badge lock" "chevron network network lock";
  align-items: center;
  gap: 2px 7px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.behavior-interval summary::-webkit-details-marker { display: none; }
.behavior-interval-chevron { grid-area: chevron; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); }
.behavior-interval-chevron svg { width: 14px; height: 14px; transition: transform .15s var(--ease-out); }
.behavior-interval[open] .behavior-interval-chevron svg { transform: rotate(90deg); }
.behavior-interval-title { grid-area: title; min-width: 0; color: var(--ink); font-size: 12.5px; }
.behavior-interval-title small { color: var(--muted); font-size: 11px; }
.behavior-merge-pill { grid-area: badge; padding: 4px 7px; background: color-mix(in srgb, var(--primary), transparent 88%); color: var(--primary); font-size: 9.5px; }
.behavior-interval-lock { grid-area: lock; color: var(--ink-3); }
.behavior-interval-lock svg { width: 14px; height: 14px; }
.behavior-interval-network { grid-area: network; min-width: 0; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

.behavior-event-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 1px 12px 13px 45px;
  list-style: none;
}

.behavior-event-list::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 20px;
  left: 50px;
  width: 1px;
  background: color-mix(in srgb, var(--primary), transparent 58%);
}

.behavior-event-list li {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 9px;
  min-height: 38px;
  align-items: start;
  padding: 5px 0;
}

.behavior-event-list li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid color-mix(in srgb, var(--surface), transparent 4%);
  border-radius: 50%;
  background: var(--primary);
}

.behavior-event-list time {
  padding-left: 16px;
  color: var(--muted);
  font-size: 10.5px;
}

.behavior-event-list li > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: var(--ink-2);
  font-size: 11.5px;
}

.behavior-event-list strong { font-weight: 620; }
.behavior-event-list small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.behavior-risk-evidence {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface), transparent 28%);
}

.behavior-risk-evidence summary {
  min-height: 52px;
  gap: 9px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.behavior-risk-evidence summary::-webkit-details-marker { display: none; }
.behavior-risk-evidence summary > svg:first-child { width: 21px; height: 21px; color: var(--ink-2); }
.behavior-risk-evidence summary > svg:last-child { width: 15px; height: 15px; margin-left: auto; color: var(--ink-3); }
.behavior-risk-evidence summary span { display: grid; gap: 2px; }
.behavior-risk-evidence summary strong { color: var(--ink); font-size: 11.5px; }
.behavior-risk-evidence > div { padding: 0 12px 12px 42px; color: var(--muted); font-size: 10.5px; }
.behavior-risk-evidence ul { margin: 0; padding-left: 16px; }

.behavior-timeline-state,
.behavior-chart-empty,
.behavior-denied {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.behavior-timeline-state strong,
.behavior-chart-empty strong,
.behavior-denied strong { color: var(--ink); }
.behavior-timeline-state p,
.behavior-chart-empty span,
.behavior-denied p { margin: 0; font-size: 11.5px; }
.behavior-timeline-state > svg,
.behavior-denied > svg { width: 28px; height: 28px; color: var(--primary); }
.behavior-denied { min-height: 320px; grid-template-columns: auto minmax(0, 360px); text-align: left; }
.behavior-denied.is-error > svg,
.behavior-timeline-state.is-error > svg { color: var(--danger); }

.behavior-loading-ring {
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--primary), transparent 72%);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: behavior-spin .8s linear infinite;
}

@keyframes behavior-spin {
  to { transform: rotate(360deg); }
}

.behavior-chart-skeleton {
  height: 270px;
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  align-items: end;
  gap: 7px;
  padding: 12px 8px 28px 32px;
}

.behavior-chart-skeleton i {
  height: var(--skeleton-height);
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--primary), transparent 86%);
  animation: pulse 1.2s ease-in-out infinite alternate;
}

.behavior-load-more {
  width: 100%;
  min-height: 36px;
  color: var(--primary);
}

.behavior-intelligence-modal .behavior-modal-footer {
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
}

.behavior-modal-footer p {
  min-width: 0;
  gap: 7px;
  margin: 0;
}

.behavior-modal-footer p svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.behavior-modal-footer > div { gap: 8px; }
.behavior-modal-footer button { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; }
.behavior-modal-footer button svg { width: 14px; height: 14px; }
.behavior-modal-footer .primary-button { min-width: 92px; justify-content: center; }

body[data-theme="aurora"] .behavior-intelligence-modal,
body[data-theme="aurora"] .behavior-overview-panel,
body[data-theme="aurora"] .behavior-timeline-panel,
body[data-theme="aurora"] .behavior-interval,
body[data-theme="aurora"] .behavior-risk-evidence,
body[data-theme="aurora"] .behavior-day-summary {
  box-shadow: 0 12px 34px rgba(40, 70, 150, .055);
}

body[data-theme="aurora"] .behavior-intelligence-layer {
  background: rgba(235, 240, 250, .58);
}

/* The modal body owns scrolling. Keep both panels and their children in
   normal flow so long timelines cannot shrink underneath risk evidence. */
.behavior-modal-scroll > * { flex-shrink: 0; }
.behavior-overview-panel, .behavior-timeline-panel { min-height: 0; }
.behavior-panel-head { flex-wrap: wrap; }
.behavior-panel-head > div { min-width: 0; }
.behavior-chart-day:first-of-type small { justify-self: start; }
.behavior-chart-day:last-of-type small { justify-self: end; }
.behavior-profile-copy, .behavior-profile-presence, .behavior-session-note,
.behavior-day-summary, .behavior-risk-evidence, .behavior-modal-footer { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .modal-card.behavior-intelligence-modal {
    width: min(760px, calc(100vw - 24px));
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  .behavior-profile-strip {
    grid-template-columns: minmax(180px, 1fr) auto;
  }

  .behavior-profile-presence {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .behavior-analysis-grid {
    grid-template-columns: 1fr;
  }

  .behavior-detail-shield { align-items: start; }
  .behavior-detail-shield > span {
    position: sticky;
    top: 20px;
    margin-top: 32px;
  }
}

@media (max-width: 620px) {
  .behavior-intelligence-layer { padding: 6px; }
  .modal-card.behavior-intelligence-modal { width: calc(100vw - 12px); height: calc(100vh - 12px); max-height: calc(100vh - 12px); border-radius: 14px; }
  .behavior-modal-scroll { padding: 12px; }
  .behavior-profile-strip { grid-template-columns: 1fr; gap: 10px; }
  .behavior-profile-presence,
  .behavior-range-tools { grid-column: auto; grid-row: auto; justify-content: flex-start; }
  .behavior-range-tools,
  .behavior-date-range,
  .behavior-date-range-trigger { width: 100%; }
  .behavior-date-range-trigger { justify-content: flex-start; }
  .behavior-date-range-popover { right: auto; left: 0; width: min(338px, calc(100vw - 36px)); }
  .behavior-panel-head { align-items: flex-start; }
  .behavior-chart { gap: 2px; }
  .behavior-chart-legend { gap: 9px; overflow-x: auto; }
  .behavior-day-summary { grid-template-columns: 1fr 1fr; }
  .behavior-day-summary > div:first-child { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .behavior-intelligence-modal .behavior-modal-footer { align-items: stretch; flex-direction: column; }
  .behavior-modal-footer > div { justify-content: flex-end; }
}

@media (max-width: 390px) {
  .behavior-date-range-popover { width: calc(100vw - 36px); padding: 12px; }
  .behavior-date-range-actions { grid-template-columns: auto 1fr auto auto; }
}

body[data-theme="aurora"] .message-row.is-failed .bubble p {
  color: #8f2433;
}

body[data-theme="aurora"] .notice-modal-icon {
  color: #2563eb;
  border-color: rgba(37, 99, 235, .18);
  background: linear-gradient(145deg, #eff6ff, #eef2ff);
}

body[data-theme="aurora"] .notice-modal-body {
  border-color: rgba(148, 163, 184, .26);
  background:
    linear-gradient(180deg, #ffffff, #f9fbff),
    var(--surface);
}

body[data-theme="aurora"] .notice-modal-content {
  color: #172033;
}

body[data-theme="aurora"] .notice-modal-meta {
  border-top-color: rgba(226, 232, 240, .95);
  color: #8391aa;
}

body[data-theme="aurora"] .notice-modal-meta strong {
  color: #64748b;
}

body[data-theme="aurora"] .notice-modal-actions button:not(.primary-button):not(.danger-button) {
  color: #52617a;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-head {
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 165, 250, .12), transparent 34%),
    #ffffff;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-body {
  border-color: rgba(203, 213, 225, .88);
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    #ffffff;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-content {
  color: #172033;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-meta {
  border-top-color: rgba(226, 232, 240, .95);
  background: #f8fbff;
}

body[data-theme="aurora"] .announcement-detail-modal .notice-modal-meta strong {
  color: #2563eb;
  background: #eef5ff;
}

body[data-theme="aurora"] .announcement-top-button {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(203, 213, 225, .9);
  color: #60708d;
}

body[data-theme="aurora"] .announcement-top-button:hover {
  background: #eef5ff;
  border-color: rgba(96, 137, 255, .42);
  color: #315fe9;
}

body[data-theme="aurora"] .message-sound-toggle {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(203, 213, 225, .9);
  color: #60708d;
}

body[data-theme="aurora"] .message-sound-toggle:hover {
  background: #eef5ff;
  border-color: rgba(96, 137, 255, .42);
  color: #315fe9;
}

body[data-theme="aurora"] .message-sound-toggle.is-on {
  background: #eef5ff;
  border-color: rgba(96, 137, 255, .56);
  color: #315fe9;
  box-shadow: 0 10px 22px rgba(96, 137, 255, .16);
}

body[data-theme="aurora"] .announcement-top-button span {
  border-color: #ffffff;
  background: #f0526d;
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(240, 82, 109, .28);
}

body[data-theme="aurora"] .announcement-row {
  border-color: rgba(226, 232, 240, .92);
  background:
    linear-gradient(90deg, rgba(96, 165, 250, .42) 0 3px, transparent 3px),
    #ffffff;
}

body[data-theme="aurora"] .announcement-row:hover {
  border-color: rgba(96, 137, 255, .36);
  background:
    linear-gradient(90deg, rgba(96, 137, 255, .72) 0 3px, transparent 3px),
    #f7faff;
}

body[data-theme="aurora"] .announcement-row.is-unread {
  background:
    linear-gradient(90deg, #ff6b86 0 3px, transparent 3px),
    linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
}

body[data-theme="aurora"] .announcement-row-title-line strong {
  color: #172038;
}

body[data-theme="aurora"] .announcement-row-unread {
  color: #d7385a;
  background: #fff0f4;
}

body[data-theme="aurora"] .announcement-row-side i {
  background: #f1f5ff;
  color: #73819d;
}

body[data-theme="aurora"] .message-state[data-state="failed"],
body[data-theme="aurora"] .message-row.is-me .message-state[data-state="failed"] {
  color: #d33f58;
}

body[data-theme="aurora"] .message-state {
  color: #71809b;
  font-weight: 650;
}

body[data-theme="aurora"] .message-state[data-state="sent"],
body[data-theme="aurora"] .message-state[data-state="delivered"] {
  color: #65748f;
}

body[data-theme="aurora"] .message-row.is-me .message-state,
body[data-theme="aurora"] .message-row.is-me .message-state[data-state="read"] {
  color: #159a70;
}

body[data-theme="aurora"] .message-row.is-me button.message-state {
  text-decoration-color: rgba(21, 154, 112, .56);
}

body[data-theme="aurora"] .message-row.is-me button.message-state::before {
  color: #159a70;
}

body[data-theme="aurora"] .status-strip-stack {
  border-bottom-color: rgba(210, 220, 238, .56);
  background: rgba(250, 252, 255, .88);
}

body[data-theme="aurora"] .status-strip-stack .notice-strip {
  border-color: rgba(124, 140, 255, .16);
  border-left-color: #6a78f0;
  background: #f7f8ff;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip {
  border-color: rgba(79, 140, 255, .16);
  border-left-color: #4f8cff;
  background: #f7fbff;
  box-shadow: none;
}

body[data-theme="aurora"] .status-strip-stack .notice-strip .room-strip-main > span:first-child {
  color: #5968d8;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip .room-strip-main > span:first-child {
  color: #2f76d2;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip .room-strip-main strong {
  color: #1b2336;
  font-weight: 650;
}

body[data-theme="aurora"] .status-strip-stack .pinned-strip .room-strip-main em {
  background: #dce8ff;
  color: #356dbb;
}

body[data-theme="aurora"] .rail-item {
  color: #6b7894;
}

body[data-theme="aurora"] .rail-item:hover {
  color: #24304a;
  background: rgba(79, 140, 255, .08);
}

body[data-theme="aurora"] .rail-item.is-active {
  color: #365dff;
  border-color: rgba(82, 113, 255, .28);
  background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .13));
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .12),
    0 10px 28px rgba(79, 140, 255, .16);
}

body[data-theme="aurora"] .rail-item.is-active svg {
  stroke: currentColor;
}

body[data-theme="aurora"] .filter-tabs {
  background: rgba(255, 255, 255, .62);
  border-color: rgba(24, 34, 48, .12);
}

body[data-theme="aurora"] .filter-tabs button {
  color: #56627d;
}

body[data-theme="aurora"] .filter-tabs button.is-active {
  color: #2242a4;
  background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .12));
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .22),
    0 6px 16px rgba(79, 140, 255, .10);
}

body[data-theme="aurora"] .context-tabs button.is-active {
  color: #2242a4;
  background: linear-gradient(135deg, rgba(79, 140, 255, .17), rgba(124, 107, 255, .11));
  box-shadow: inset 0 0 0 1px rgba(82, 113, 255, .22);
}

body[data-theme="aurora"] .conversation-card.is-active,
body[data-theme="aurora"] .plain-row.is-active,
body[data-theme="aurora"] .file-card.is-active {
  color: #1b2336;
  border-color: rgba(82, 113, 255, .22);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .12), rgba(124, 107, 255, .075)),
    rgba(255, 255, 255, .92);
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .10),
    0 12px 28px rgba(35, 48, 82, .08);
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-title strong,
body[data-theme="aurora"] .plain-row.is-active strong,
body[data-theme="aurora"] .file-card.is-active strong {
  color: #172038;
}

body[data-theme="aurora"] .conversation-card.is-active .line-two,
body[data-theme="aurora"] .conversation-card.is-active .conversation-meta time,
body[data-theme="aurora"] .conversation-card.is-active .file-text small,
body[data-theme="aurora"] .plain-row.is-active small,
body[data-theme="aurora"] .file-card.is-active small {
  color: #66738f;
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-flag.is-pin,
body[data-theme="aurora"] .conversation-title .conversation-flag.is-pin {
  color: #2f9bd8;
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-flag.is-mute,
body[data-theme="aurora"] .conversation-title .conversation-flag.is-mute {
  color: #b77a11;
}

body[data-theme="aurora"] .setting-nav-row:hover {
  background: rgba(79, 140, 255, .055);
}

body[data-theme="aurora"] .setting-nav-row.is-active {
  border-color: rgba(82, 113, 255, .30);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .105), rgba(124, 107, 255, .07)),
    rgba(255, 255, 255, .86);
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .16),
    0 14px 30px rgba(48, 72, 120, .10);
}

body[data-theme="aurora"] .setting-nav-row.is-active .setting-nav-icon {
  color: #315efb;
  background: rgba(82, 113, 255, .10);
  border: 1px solid rgba(82, 113, 255, .20);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(79, 140, 255, .12);
}

body[data-theme="aurora"] .setting-nav-row.is-active strong {
  color: #172038;
}

body[data-theme="aurora"] .setting-nav-row.is-active small {
  color: #5f6f90;
}

button,
input,
textarea {
  border-radius: var(--r-sm);
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

button:hover {
  background: var(--raise);
  border-color: var(--line-2);
}

input,
textarea,
select {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
}

.im-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(300px, var(--side-w)) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 21, 34, .92), rgba(9, 12, 20, .96));
  box-shadow: var(--sh);
}

.im-shell.is-detail-open {
  grid-template-columns: var(--rail-w) minmax(300px, var(--side-w)) minmax(0, 1fr) minmax(286px, var(--detail-w));
}

.im-shell[data-view="files"],
.im-shell[data-view="settings"],
.im-shell[data-view="rtc"]:not(.is-detail-open),
.im-shell[data-view="files"].is-detail-open,
.im-shell[data-view="settings"].is-detail-open {
  grid-template-columns: var(--rail-w) minmax(300px, var(--side-w)) minmax(0, 1fr);
}

.app-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  padding: 20px 0 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 18, .5);
  color: var(--ink-3);
}

.brand-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  margin: 0 0 14px;
  border: 0;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-size: 0;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(79, 140, 255, .45);
}

.brand-button.has-logo {
  background: var(--grad);
}

.brand-button.has-logo img,
.brand-button.has-logo span {
  display: none;
}

.brand-button::after {
  content: "IM";
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.rail-nav,
.rail-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rail-footer {
  margin-top: auto;
}

.rail-item {
  position: relative;
  width: 48px;
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-3);
  transition: .18s ease;
}

.rail-item svg {
  width: 22px;
  height: 22px;
}

.rail-mark,
.rail-label {
  display: none;
}

.rail-item:hover {
  color: var(--ink);
  background: var(--raise);
}

.rail-item.is-active {
  color: #fff;
  background: var(--grad-soft);
  border-color: rgba(124, 140, 255, .35);
}

.rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad);
}

.rail-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg-soft);
  border-radius: 8px;
  background: var(--bad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.rail-user {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b4670, #5b6bb0);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.presence-dot {
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border: 2.5px solid var(--bg-soft);
  background: var(--soft);
}

.side-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(10, 14, 23, .4);
}

.account-block {
  display: none;
}

.side-panel > .panel-head {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 0;
  border: 0;
  background: transparent;
}

.side-panel > .panel-head strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: .2px;
}

.panel-head-acts {
  display: flex;
  gap: 12px;
}

.enterprise-switcher {
  width: calc(100% - 36px);
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 4px;
  padding: 10px 10px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 58%);
  border-radius: 16px;
  background:
    radial-gradient(160px 72px at 0% 0%, color-mix(in srgb, var(--primary), transparent 72%), transparent 72%),
    color-mix(in srgb, var(--surface-soft), transparent 4%);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  transition:
    transform .16s var(--ease-out),
    border-color .16s var(--ease-out),
    background .16s var(--ease-out);
}

.enterprise-switcher:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 48%);
  background:
    radial-gradient(180px 82px at 0% 0%, color-mix(in srgb, var(--primary), transparent 70%), transparent 74%),
    color-mix(in srgb, var(--surface-strong), transparent 12%);
}

.enterprise-switcher.is-readonly {
  cursor: default;
  grid-template-columns: auto minmax(0, 1fr);
}

.enterprise-switcher.is-readonly:hover,
.enterprise-switcher.is-readonly:active {
  transform: none;
}

.enterprise-switcher:active {
  transform: translateY(0);
}

.enterprise-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f8cff, #765dff);
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: .2px;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary), transparent 72%);
}

.enterprise-mark.is-large {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  font-size: 16px;
}

.enterprise-mark .workspace-logo {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.enterprise-mark .workspace-logo img,
.enterprise-mark .workspace-logo-fallback {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.enterprise-mark .workspace-logo img {
  display: block;
  object-fit: cover;
  opacity: 0;
}

.enterprise-mark .workspace-logo img[hidden] {
  display: none;
}

.enterprise-mark .workspace-logo-fallback {
  display: grid;
  place-items: center;
}

.enterprise-mark .workspace-logo.is-logo-loaded:not(.is-logo-broken) img {
  opacity: 1;
}

.enterprise-mark .workspace-logo.is-logo-loaded:not(.is-logo-broken) .workspace-logo-fallback {
  opacity: 0;
}

.enterprise-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 34px;
}

.enterprise-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 820;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enterprise-copy small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enterprise-code {
  color: var(--ink-3);
  font-weight: 620;
}

.enterprise-pill {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 80%);
  color: color-mix(in srgb, var(--primary), #fff 18%);
  font-size: 11px;
  font-weight: 780;
  text-align: center;
}

.icon-action,
.detail-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
}

.icon-action svg,
.detail-action svg {
  width: 16px;
  height: 16px;
}

.icon-action:hover,
.detail-action:hover,
.detail-action.is-active {
  color: var(--ink);
  border-color: var(--line-2);
}

.panel-search {
  padding: 14px 18px 12px;
  border: 0;
  background: transparent;
}

.search-field {
  height: 38px;
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 8%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: var(--ink-2);
  box-sizing: border-box;
  transition:
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    background .16s var(--ease-out);
}

.search-field:focus-within {
  border-color: rgba(91, 157, 255, .78);
  background: rgba(91, 157, 255, .08);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, .18);
}

.search-field span {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 15px;
  height: 15px;
  border-color: var(--ink-2);
  pointer-events: none;
}

.search-field span::after {
  background: var(--ink-2);
}

.search-field input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 36px;
  box-shadow: none;
  caret-color: var(--primary);
  appearance: none;
}

.search-field input:focus {
  outline: 0;
  box-shadow: none;
}

.search-field input::placeholder {
  color: color-mix(in srgb, var(--ink-2), transparent 14%);
}

.filter-tabs {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
}

.filter-tabs button {
  flex: 1;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: color-mix(in srgb, var(--ink-2), #fff 8%);
  font-size: 12.5px;
  font-weight: 560;
}

.filter-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-badge {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--unread-badge-bg);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 820;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow:
    0 6px 16px var(--unread-badge-shadow),
    inset 0 0 0 1px var(--unread-badge-ring);
}

.filter-tabs button.is-active {
  color: #fff;
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .3);
}

.side-content,
.message-scroll,
.page-scroll,
.context-body,
.drawer-body {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

.side-content {
  flex: 1;
  min-height: 0;
  padding: 8px 10px 16px;
}

.side-section-head {
  min-height: auto;
  padding: 12px 10px 6px;
  color: color-mix(in srgb, var(--ink-3), #fff 12%);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.side-section-head strong {
  color: color-mix(in srgb, var(--ink-3), #fff 12%);
}

.side-section-count {
  color: color-mix(in srgb, var(--ink-3), #fff 12%);
  background: transparent;
}

.conversation-stack {
  gap: 6px;
}

.plain-list,
.file-list,
.card-list {
  gap: 2px;
}

.conversation-stack + .side-section-head {
  margin-top: 10px;
}

.group-list-sections {
  display: grid;
  gap: 12px;
}

.group-list-section {
  display: grid;
  gap: 4px;
}

.side-section-head.group-subsection-head {
  padding-top: 10px;
  padding-bottom: 4px;
}

.group-subsection-head .side-section-count {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink-2), var(--muted) 24%);
  font-size: 11px;
  letter-spacing: 0;
}

.side-empty-note {
  margin: 0 4px 2px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--line), transparent 12%);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel), transparent 36%);
  font-size: 12px;
  line-height: 1.45;
}

.side-section-head.is-mentions strong {
  color: color-mix(in srgb, var(--accent), var(--ink-3) 22%);
}

.mention-message-stack {
  display: grid;
  gap: 8px;
}

.mention-message-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition:
    border-color .18s var(--ease-out),
    background .18s var(--ease-out),
    transform .18s var(--ease-out),
    box-shadow .18s var(--ease-out);
}

.mention-message-card:hover {
  background: var(--raise);
  border-color: color-mix(in srgb, var(--primary), var(--line) 72%);
  transform: translateY(-1px);
}

.mention-message-card.is-active {
  border-color: color-mix(in srgb, var(--primary), var(--line) 45%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 82%), color-mix(in srgb, var(--secondary), transparent 88%)),
    var(--surface-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 82%);
}

.mention-message-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff805c, #ff5f7e);
  color: #fff;
  font-size: 14px;
  font-weight: 820;
  box-shadow: 0 10px 24px rgba(255, 95, 126, .18);
}

.mention-message-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mention-message-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mention-message-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-message-head time {
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
}

.mention-message-state {
  margin-left: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.mention-message-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 820;
  line-height: 18px;
  white-space: nowrap;
  letter-spacing: 0;
}

.mention-message-unread {
  background: color-mix(in srgb, var(--primary), transparent 84%);
  color: color-mix(in srgb, var(--primary), var(--ink) 18%);
}

.mention-message-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-message-meta b {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), transparent 84%);
  color: var(--accent);
  font-size: 10px;
  font-weight: 820;
}

.mention-message-card.is-read .mention-message-meta b {
  background: color-mix(in srgb, var(--ink-3), transparent 88%);
  color: var(--ink-3);
}

.mention-message-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mention-message-card.is-read .mention-message-snippet {
  color: var(--ink-3);
}

.side-section-head.is-pinned strong {
  color: color-mix(in srgb, var(--primary), var(--ink-3) 35%);
}

.directory-zone {
  display: grid;
  gap: 6px;
}

.directory-zone + .directory-zone {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.directory-modules {
  padding-bottom: 2px;
}

.directory-module {
  position: relative;
  min-height: 64px;
}

.directory-module-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.directory-entry-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0 6px;
  border: 2px solid color-mix(in srgb, var(--surface), transparent 4%);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7080, #ff4d66);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 77, 102, .28);
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
  line-height: 1;
}

body[data-theme="aurora"] .directory-entry-badge {
  border-color: #fff;
  box-shadow: 0 8px 18px rgba(255, 77, 102, .22);
}

body[data-theme="midnight"] .directory-entry-badge {
  border-color: #121826;
  box-shadow: 0 8px 18px rgba(255, 77, 102, .34);
}

.contact-alpha-list {
  display: grid;
  gap: 10px;
}

.alpha-group {
  display: grid;
  gap: 4px;
}

.alpha-title {
  padding: 6px 10px 2px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0;
}

.contact-row {
  min-height: 62px;
}

.contact-window {
  position: relative;
  min-width: 0;
  overflow-anchor: none;
}

.contact-window-heading {
  padding-bottom: 8px;
}

.contact-window-row-gap {
  padding-bottom: 6px;
}

body[data-display-density="compact"] .contact-window-row-gap {
  padding-bottom: 4px;
}

.contact-window-group-end {
  padding-bottom: 10px;
}

.contact-window-step:not([hidden]) {
  position: absolute;
  z-index: 1;
}

.contact-window-step:not([hidden]):not(:focus) {
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-window-page-step:not([hidden]) {
  margin: 8px 0;
}

.directory-sync {
  margin: 0 10px 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--ink-3);
  font-size: 12px;
}

.directory-sync.is-warn {
  border-color: rgba(255, 204, 107, .28);
  color: var(--warn);
}

.conversation-card,
.plain-row,
.file-card {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: .14s ease;
}

.conversation-card:hover,
.plain-row:hover,
.file-card:hover {
  background: var(--raise);
}

.conversation-card.is-active,
.plain-row.is-active,
.file-card.is-active {
  background: linear-gradient(135deg, rgba(79, 140, 255, .22), rgba(124, 107, 255, .15));
  border-color: rgba(124, 140, 255, .40);
  box-shadow:
    inset 0 0 0 1px rgba(124, 140, 255, .16),
    0 10px 26px rgba(31, 63, 140, .16);
}

.conversation-card.is-active::before {
  display: none;
}

.conversation-card .avatar,
.plain-row .avatar,
.file-card .file-type,
.avatar:not(.avatar-xl) {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3f7bff, #6ad6ff);
  color: #fff;
  font-size: 16px;
  font-weight: 680;
}

.conversation-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
}

.conversation-avatar-wrap .avatar {
  grid-area: 1 / 1;
}

.conversation-kind-badge {
  position: absolute;
  left: -5px;
  top: auto;
  bottom: -5px;
  z-index: 2;
  min-width: 20px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid rgba(250, 204, 21, .46);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255, 244, 187, .94), rgba(242, 190, 74, .90));
  color: #5f4308;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  box-shadow:
    0 0 0 2px var(--surface),
    0 6px 12px rgba(0, 0, 0, .24);
}

body[data-theme="aurora"] .conversation-kind-badge {
  border-color: rgba(234, 179, 8, .34);
  background: linear-gradient(135deg, #fff7d6, #f6d87a);
  color: #6b4b08;
  box-shadow:
    0 0 0 2px var(--surface),
    0 4px 10px rgba(148, 111, 18, .16);
}

.avatar-presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--soft);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .04);
}

.presence-dot[data-status="online"],
.avatar-presence[data-status="online"] {
  background: var(--ok);
}

.presence-dot[data-status="offline"],
.avatar-presence[data-status="offline"] {
  background: var(--soft);
}

.presence-dot[data-status="unknown"],
.avatar-presence[data-status="unknown"] {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--soft);
}

.avatar-soft {
  background: linear-gradient(135deg, #b66bff, #7c6bff);
  color: #fff;
}

.avatar-user,
.avatar.is-system {
  background: linear-gradient(135deg, #3a4670, #566089);
}

.line-one,
.t-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-card .line-one {
  min-width: 0;
  justify-content: space-between;
}

.conversation-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.conversation-title strong,
.conversation-card .line-one strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.conversation-flags {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: max-content;
}

.conversation-flag {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  background: transparent;
  box-shadow: none;
  transition:
    transform .16s var(--ease-out),
    filter .16s var(--ease-out);
}

.conversation-card:hover .conversation-flag {
  filter: saturate(1.08) brightness(1.06);
  transform: translateY(-1px);
}

.conversation-flag.is-pin {
  color: #6ad6ff;
  background: transparent;
}

.conversation-flag.is-mute {
  color: #ffcc6b;
  background: transparent;
}

.conversation-flag svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.35;
}

.conversation-body strong,
.file-text strong,
.plain-row strong {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
}

.line-one time,
.conversation-body span,
.file-text small,
.plain-row small,
.plain-row i,
.setting-nav-row i {
  color: var(--ink-3);
  font-size: 11.5px;
}

.conversation-title .conversation-flag {
  font-size: 0;
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(1px);
}

.conversation-title .conversation-flag.is-pin {
  color: #6ad6ff;
  background: transparent;
}

.conversation-title .conversation-flag.is-mute {
  color: #ffcc6b;
  background: transparent;
}

.conversation-title .conversation-flag svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.35;
}

.conversation-body .line-one {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conversation-body .conversation-title {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--ink);
}

.conversation-body .conversation-title strong {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 720;
}

/* All conversation types share the full first row, so time stays at the same
   right edge regardless of the unread state in the preview row. */
.conversation-card {
  grid-template-rows: 22px 20px;
  row-gap: 4px;
}

.conversation-card > .conversation-avatar-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
}

.conversation-card > .conversation-body {
  display: contents;
}

.conversation-card .line-one {
  grid-column: 2 / 4;
  grid-row: 1;
}

.conversation-card .line-two {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin-top: 0;
}

.conversation-card > .conversation-state {
  grid-column: 3;
  grid-row: 2;
}

/* Keep the group total distinct from unread badges and reserve room for the name. */
.conversation-body .conversation-group-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  min-width: max-content;
  white-space: nowrap;
  gap: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.conversation-body .conversation-group-count-value {
  flex: 0 0 auto;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.conversation-card .conversation-title > strong {
  min-width: 0;
}

.conversation-card .conversation-meta {
  flex: 0 0 auto;
  min-width: max-content;
}

.conversation-card .conversation-meta time {
  white-space: nowrap;
}

/* Keep identity content together while reserving the independent time column. */
.conversation-title > .certification-name-slot {
  flex: 0 1 auto;
  max-width: 100%;
}

.topbar-title h1.identity-name-line {
  width: 100%;
  max-width: 100%;
}

.topbar-title h1 > .identity-display-name-text {
  flex: 0 1 auto;
}

.topbar-title h1 > .certification-name-slot {
  max-width: min(18em, 60%);
}

.topbar-title > div {
  min-width: 0;
}

.topbar-title p {
  overflow-wrap: anywhere;
}

.conversation-body .conversation-title .conversation-flags {
  width: auto;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  overflow: visible;
}

.conversation-body .conversation-title .conversation-flag {
  display: inline-grid;
  place-items: center;
  overflow: visible;
}

.line-two,
.line-three {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13px;
}

.conversation-card .line-two {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card .line-two span,
.conversation-card .line-three,
.conversation-card .line-three span,
.conversation-summary {
  color: var(--ink-2);
}

.conversation-card .line-one time,
.conversation-meta time {
  color: color-mix(in srgb, var(--ink-3), #fff 10%);
  font-weight: 560;
}

.conversation-card.is-active .line-two,
.conversation-card.is-active .line-two span,
.conversation-card.is-active .line-three,
.conversation-card.is-active .line-three span,
.conversation-card.is-active .conversation-summary {
  color: color-mix(in srgb, var(--ink-2), #fff 10%);
}

.conversation-card.is-active .line-one time,
.conversation-card.is-active .conversation-meta time {
  color: color-mix(in srgb, var(--ink-2), #fff 8%);
}

.conversation-summary {
  min-width: 0;
}

.conversation-summary.is-mention {
  color: var(--ink-2);
}

.conversation-mention-mark {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-right: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 95, 126, .14);
  color: #ff637a;
  font-style: normal;
  font-weight: 820;
}

body[data-theme="aurora"] .conversation-summary.is-mention {
  color: #5f6f8f;
}

body[data-theme="aurora"] .conversation-mention-mark {
  background: rgba(226, 72, 96, .11);
  color: #dc3752;
}

.line-three {
  display: none;
}

.conversation-state {
  min-width: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.conversation-state b {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(79, 140, 255, .4);
}

.conversation-state b.is-alert {
  background: var(--unread-badge-bg);
  box-shadow:
    0 5px 14px var(--unread-badge-shadow),
    inset 0 0 0 1px var(--unread-badge-ring);
}

.conversation-state b.is-muted {
  border: 1px solid color-mix(in srgb, #eef3fb, transparent 18%);
  background: linear-gradient(180deg, #eef3fb 0%, #cbd6e6 100%);
  color: #334155;
  box-shadow:
    0 4px 12px rgba(10, 18, 32, .24),
    inset 0 1px 0 rgba(255, 255, 255, .72);
}

.conversation-card.is-active .conversation-state b.is-muted {
  border-color: rgba(255, 255, 255, .72);
  background: linear-gradient(180deg, #f8fbff 0%, #d7e1ef 100%);
  color: #253348;
  box-shadow:
    0 4px 12px rgba(12, 20, 36, .26),
    inset 0 1px 0 rgba(255, 255, 255, .85);
}

body[data-theme="aurora"] .conversation-state b.is-muted {
  border-color: rgba(100, 116, 139, .24);
  background: linear-gradient(180deg, #e7edf6 0%, #bac6d7 100%);
  color: #27364c;
  box-shadow:
    0 3px 9px rgba(64, 78, 104, .16),
    inset 0 1px 0 rgba(255, 255, 255, .72);
}

body[data-theme="aurora"] .conversation-card.is-active .conversation-state b.is-muted {
  border-color: rgba(82, 113, 255, .24);
  background: linear-gradient(180deg, #eef4ff 0%, #cbd8ee 100%);
  color: #24324a;
}

.settings-nav-list {
  gap: 12px;
  padding: 4px 10px 18px;
}

.settings-side-panel {
  background: rgba(10, 14, 23, .42);
}

.settings-side-head {
  flex: 0 0 auto;
  padding: 24px 28px 18px;
}

.settings-side-head h1 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 720;
  letter-spacing: 0;
}

.setting-nav-row {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 76px;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
}

.setting-nav-row:hover {
  background: rgba(255, 255, 255, .035);
}

.setting-nav-row.is-active {
  border-color: rgba(124, 140, 255, .36);
  background: linear-gradient(135deg, rgba(79, 140, 255, .16), rgba(124, 107, 255, .12));
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .12);
}

.setting-nav-icon,
.settings-pane-icon {
  display: inline-grid;
  place-items: center;
  color: var(--ink-2);
}

.setting-nav-icon {
  width: 34px;
  height: 34px;
}

.setting-nav-row.is-active .setting-nav-icon {
  color: #fff;
}

.setting-nav-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.setting-nav-row strong {
  font-size: 17px;
  font-weight: 650;
}

.setting-nav-row small {
  margin-top: 3px;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.workspace-topbar {
  min-height: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 23, .5);
  backdrop-filter: blur(10px);
}

.topbar-title {
  flex: 1;
  min-width: 0;
  gap: 12px;
}

.topbar-title h1 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 660;
}

.topbar-title p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.subtitle-sep {
  color: var(--ink-3);
}

[data-login-ip-region] {
  color: var(--muted);
}

[data-login-ip-region][data-status="online"] {
  color: var(--ok);
}

.inline-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ok);
  font-weight: 650;
}

.inline-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor, transparent 82%);
}

.inline-status[data-status="offline"] {
  color: var(--ink-3);
}

body[data-theme="aurora"] .workspace-topbar .inline-status[data-status="offline"],
body[data-theme="aurora"] .workspace-topbar [data-login-ip-region] {
  color: var(--muted);
  font-weight: 650;
}

body[data-theme="aurora"] .workspace-topbar .inline-status[data-status="online"],
body[data-theme="aurora"] .workspace-topbar [data-login-ip-region][data-status="online"] {
  color: #087f5b;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions > button:not(.icon-action):not(.detail-action) {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
  font-size: 12.5px;
}

.topbar-actions > button[data-action="rtc-audio"] svg {
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -2px;
}

.topbar-actions .primary-button,
.primary-button {
  border: 0;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 140, 255, .35);
}

.chat-entry-button,
.topbar-actions .chat-entry-button,
.directory-card-actions .chat-entry-button {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
}

.chat-entry-button:hover,
.topbar-actions .chat-entry-button:hover,
.directory-card-actions .chat-entry-button:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 55%);
  background: transparent;
  color: var(--ink);
}

.ok-chip,
.alert-chip {
  display: none;
}

.room-strip {
  margin: 14px 22px 0;
  padding: 12px 16px;
  border: 1px solid rgba(124, 140, 255, .22);
  border-radius: 14px;
  background: var(--grad-soft);
}

.room-strip-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.room-strip-main > span:first-child {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 700;
}

.room-strip span,
.room-strip strong {
  color: var(--ink);
  font-size: 12.5px;
}

.room-strip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.room-strip-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
}

.status-strip-stack {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  gap: 3px;
  padding: 3px 16px 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 66%);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  backdrop-filter: blur(10px);
}

.status-strip-stack .room-strip {
  margin: 0;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 2px 6px 2px 8px;
  border-left-width: 2px;
  border-radius: 8px;
  box-shadow: none;
}

.status-strip-stack .room-strip-main {
  min-width: 0;
  min-height: 18px;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.status-strip-stack .room-strip-main:hover {
  transform: none;
  box-shadow: none;
}

.status-strip-stack .room-strip-main > span:first-child {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
}

.status-strip-stack .room-strip-main strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 540;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip-stack .room-strip-main em {
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(91, 157, 255, .14);
  color: #8bb9ff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 760;
}

.notice-strip {
  border-color: rgba(124, 140, 255, .15);
  border-left-color: #7c8cff;
  background: color-mix(in srgb, #7c8cff, var(--surface) 94%);
}

.pinned-strip {
  border-color: rgba(106, 214, 255, .15);
  border-left-color: #6ad6ff;
  background: color-mix(in srgb, #6ad6ff, var(--surface) 94%);
}

.pinned-strip svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.35;
}

.room-strip-close {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
}

.room-strip-close:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: var(--raise);
}

.room-strip-close svg {
  width: 10px;
  height: 10px;
}

.notice-modal {
  width: min(520px, calc(100vw - 36px));
}

/* Compact call notices use content directly, without the announcement body wrapper. */
.rtc-license-notice {
  --rtc-notice-padding: clamp(18px, 4vw, 24px);
  width: min(420px, calc(100vw - 32px));
}

.rtc-license-notice .notice-modal-head {
  padding: 22px var(--rtc-notice-padding) 0;
  border-bottom: 0;
}

.rtc-license-notice .notice-modal-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.rtc-license-notice .notice-modal-content {
  padding: 16px var(--rtc-notice-padding) 22px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.rtc-license-notice .notice-modal-actions {
  padding: 0 var(--rtc-notice-padding) 22px;
  border-top: 0;
  justify-content: flex-end;
}

.rtc-license-notice .notice-modal-actions .primary-button {
  min-width: 88px;
}

.notice-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 18%);
}

.announcement-center-modal .notice-modal-head {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.notice-modal-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.notice-modal-head-actions .soft-button {
  min-height: 34px;
  white-space: nowrap;
}

.notice-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.notice-modal-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 68%);
  border-radius: 15px;
  color: #7dd3fc;
  background:
    radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--primary), white 18%) 0 1px, transparent 2px),
    linear-gradient(145deg, rgba(96, 165, 250, .16), rgba(99, 102, 241, .10));
}

.notice-modal-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.notice-modal-icon.is-danger {
  border-color: rgba(248, 113, 113, .34);
  color: #fecaca;
  background: linear-gradient(145deg, rgba(248, 113, 113, .18), rgba(127, 29, 29, .18));
}

.notice-modal-body {
  display: grid;
  gap: 18px;
  margin: 20px 22px 8px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 20%);
  border-radius: 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 6%), color-mix(in srgb, var(--surface), transparent 0%)),
    var(--surface);
}

.notice-modal-content {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.85;
  letter-spacing: 0;
}

.notice-modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
}

.notice-modal-meta strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-delete-preview {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 55%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.admin-delete-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-delete-preview strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-modal-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 22px 22px;
  border-top: 0;
}

.notice-modal-actions button:not(.primary-button):not(.danger-button) {
  min-height: 40px;
  padding: 0 16px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.notice-modal-actions .primary-button {
  min-width: 92px;
  min-height: 40px;
}

.notice-modal-actions .danger-button {
  min-width: 104px;
  min-height: 40px;
  padding: 0 16px;
  border-color: color-mix(in srgb, var(--danger), transparent 30%);
  color: #1b2336;
  background: var(--danger);
}

.notice-modal-actions .danger-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger), #000 12%);
}

.notice-modal-actions .danger-button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.announcement-detail-modal {
  width: min(540px, calc(100vw - 36px));
}

.announcement-detail-modal .notice-modal-head {
  padding: 22px 22px 17px;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--primary), transparent 88%), transparent 34%),
    var(--surface);
}

.announcement-detail-modal .notice-modal-title {
  gap: 14px;
}

.announcement-detail-modal .notice-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
}

.announcement-detail-modal .notice-modal-title h2 {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-detail-modal .notice-modal-body {
  gap: 0;
  margin: 18px 22px 18px;
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--line-2), transparent 14%);
  border-radius: 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 2%), color-mix(in srgb, var(--surface), transparent 0%)),
    var(--surface);
}

.announcement-detail-modal .notice-modal-content {
  min-height: 88px;
  padding: 22px 24px 20px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.75;
}

.announcement-detail-modal .notice-modal-meta {
  padding: 14px 24px;
  border-top-color: color-mix(in srgb, var(--line), transparent 14%);
  background: color-mix(in srgb, var(--surface-soft), transparent 20%);
}

.announcement-detail-modal .notice-modal-meta strong {
  min-height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.announcement-detail-modal .notice-modal-actions {
  padding: 4px 22px 22px;
}

.announcement-detail-modal .notice-modal-actions .primary-button {
  min-width: 100px;
}

.announcement-center-modal {
  width: min(620px, calc(100vw - 36px));
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(66vh, 600px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 20px 24px;
}

.announcement-row {
  box-sizing: border-box;
  width: 100%;
  display: block;
  min-height: 108px;
  padding: 17px 16px 18px 20px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 12%);
  border-radius: 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 74%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--surface-soft), var(--surface) 34%);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  line-height: normal;
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.announcement-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 50%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--primary-soft), var(--surface) 72%);
}

.announcement-row.is-unread {
  border-color: color-mix(in srgb, var(--primary), transparent 44%);
  background:
    linear-gradient(90deg, #ff6b86 0 3px, transparent 3px),
    color-mix(in srgb, var(--primary-soft), var(--surface) 74%);
}

.announcement-row-copy {
  width: 100%;
  min-height: 72px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  overflow: hidden;
}

.announcement-row-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.announcement-row-title-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.announcement-row-title-line strong {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink), #ffffff 10%);
  font-size: 16px;
  font-weight: 860;
  line-height: 1.42;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-row-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-row-side {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
  min-width: max-content;
  white-space: nowrap;
}

.announcement-row-unread {
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #ff6b86;
  background: color-mix(in srgb, #ff6b86, transparent 88%);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.announcement-row-side time {
  flex: 0 0 auto;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.announcement-row-side i {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), transparent 16%);
  font-style: normal;
  font-size: 17px;
  line-height: 1;
}

.announcement-empty {
  display: grid;
  gap: 6px;
  padding: 38px 18px;
  border: 1px dashed var(--line-2);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.announcement-empty strong {
  color: var(--ink);
  font-size: 16px;
}

@media (max-width: 520px) {
  .notice-modal-head,
  .announcement-center-modal .notice-modal-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 16px 16px 14px;
  }

  .notice-modal-head-actions .soft-button {
    padding: 0 10px;
  }

  .announcement-list {
    max-height: min(64vh, 520px);
    gap: 12px;
    padding: 18px 14px 20px;
  }

  .announcement-row {
    min-height: 106px;
    padding: 16px 15px 17px 18px;
  }

  .announcement-row-copy {
    min-height: 68px;
  }

  .announcement-row-side {
    justify-content: flex-end;
    width: auto;
    min-width: max-content;
  }

  .announcement-row-side time,
  .announcement-row-side i,
  .announcement-row-unread {
    flex: 0 0 auto;
  }

  .notice-modal-body {
    margin: 14px 16px 4px;
    padding: 16px;
  }

  .notice-modal-actions {
    padding: 14px 16px 16px;
  }
}

.announcement-empty p {
  margin: 0;
  font-size: 13px;
}

.pinned-message-list {
  display: grid;
  gap: 8px;
}

.pinned-message-card {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.pinned-message-card:hover {
  border-color: rgba(106, 214, 255, .28);
  background: var(--raise);
}

.pin-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(106, 214, 255, .12);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 780;
}

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

.pin-copy strong,
.pin-copy small,
.pin-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-copy strong {
  color: var(--ink);
  font-size: 12.5px;
}

.pin-copy small {
  color: var(--ink-2);
  font-size: 12px;
}

.pin-copy em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
}

.message-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 18px 22px 8px;
  background: transparent;
  overflow-x: hidden;
}

.message-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.message-recovery-feedback {
  position: absolute;
  top: 0;
  right: 12px;
  bottom: 0;
  left: 12px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
}

.message-recovery-feedback[hidden] { display: none; }
.message-recovery-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 8px 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--layer-surface, var(--bg));
  color: var(--ink);
  overflow-wrap: anywhere;
  pointer-events: auto;
}
/* Only the explanation scrolls in short message panes; retry stays reachable
   beside it and the card never paints over the composer below the stage. */
.message-recovery-copy { min-width: 0; min-height: 0; max-height: 100%; overflow-y: auto; }
.message-recovery-card p { margin: 4px 0 0; color: var(--muted); }

.message-stage .message-scroll {
  flex: 1 1 auto;
}

.message-flow {
  max-width: none;
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.scroll-to-latest-button {
  position: absolute;
  right: 28px;
  bottom: 18px;
  z-index: 12;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line), transparent 18%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface), transparent 6%);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(5, 10, 24, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.94);
  transition:
    opacity .16s var(--ease-out),
    transform .16s var(--ease-out),
    border-color .16s var(--ease-out),
    background .16s var(--ease-out);
}

.scroll-to-latest-button[hidden] {
  display: none;
}

.scroll-to-latest-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-to-latest-button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  background: color-mix(in srgb, var(--primary), var(--surface) 74%);
  color: #fff;
}

.scroll-to-latest-button svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 720px) {
  .scroll-to-latest-button {
    right: 16px;
    bottom: 14px;
  }
}

.chat-history-state {
  align-self: center;
  width: min(460px, 92%);
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: auto 0;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel), transparent 14%);
}

.chat-history-state strong {
  color: var(--ink);
}

.chat-history-state p {
  max-width: 34em;
  color: var(--muted);
}

.chat-history-state > span {
  width: min(260px, 72%);
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary), transparent 46%), transparent);
  animation: pulse 1.2s ease-in-out infinite;
}

.history-limit-notice {
  align-self: center;
  max-width: min(620px, 92%);
  padding: 7px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 62%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 92%);
}

button.history-limit-notice {
  font: inherit;
  cursor: pointer;
}

.history-limit-notice.is-loading {
  border-color: color-mix(in srgb, var(--primary), transparent 66%);
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.history-limit-notice.is-action {
  color: color-mix(in srgb, var(--warn), var(--ink) 18%);
}

.timeline-marker,
.system-line,
.unread-boundary {
  align-self: center;
  color: var(--ink-3);
  font-size: 11px;
}

.timeline-marker {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
}

.system-line span {
  background: transparent;
}

.message-row.is-jump-highlight .bubble,
.system-line.is-jump-highlight span {
  animation: messageJumpPulse 1.35s ease both;
}

@keyframes messageJumpPulse {
  0% {
    outline: 1px solid rgba(255, 198, 92, 0);
    box-shadow: 0 0 0 0 rgba(255, 198, 92, 0);
  }
  18% {
    outline: 1px solid rgba(255, 198, 92, .72);
    box-shadow: 0 0 0 5px rgba(255, 198, 92, .16), 0 12px 30px rgba(255, 198, 92, .12);
  }
  100% {
    outline: 1px solid rgba(255, 198, 92, 0);
    box-shadow: 0 0 0 0 rgba(255, 198, 92, 0);
  }
}

.unread-boundary {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px auto;
  color: var(--warn);
}

.unread-boundary::before,
.unread-boundary::after {
  content: "";
  height: 1px;
  flex: 1;
  background: color-mix(in srgb, var(--warn), transparent 64%);
}

.unread-boundary span {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 62%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 90%);
  white-space: nowrap;
}

.message-row {
  box-sizing: border-box;
  width: min(100%, 680px);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  max-width: min(74%, 680px);
  min-width: 0;
  margin: 0;
}

.message-row.is-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row > .avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  font-size: 13px;
}

.message-stack {
  flex: 0 1 auto;
  width: fit-content;
  display: grid;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
}

.message-row.is-me .message-stack {
  justify-items: end;
}

.message-meta {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
}

.message-meta > .message-sender-name {
  display: contents;
}

.message-meta > .message-sender-name > .identity-display-name-text {
  order: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta > .message-sender-role {
  display: contents;
}

.message-meta > .message-sender-role > .message-sender-role {
  order: 1;
}

.message-meta > .message-sender-name > .certification-name-slot {
  order: 2;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(112px, 30vw);
  overflow: hidden;
}

.message-meta > .message-sender-name > .certification-name-slot .verification-badge {
  max-width: 100%;
}

.message-sender-role {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(124, 140, 255, .18);
  border-radius: 999px;
  line-height: 1;
  transform: translateY(-.5px);
}

.message-sender-role svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.message-sender-role.is-owner {
  border-color: rgba(255, 213, 128, .55);
  background: linear-gradient(135deg, #ffd66f, #ff8c42);
  color: #3d2300;
  box-shadow: 0 7px 16px rgba(255, 154, 66, .24);
}

.message-sender-role.is-admin {
  width: 19px;
  height: 19px;
  min-width: 19px;
  min-height: 19px;
  border-color: rgba(106, 214, 255, .36);
  background: linear-gradient(135deg, rgba(91, 157, 255, .95), rgba(106, 214, 255, .86));
  color: #061529;
  box-shadow: 0 7px 16px rgba(91, 157, 255, .24);
}

.message-sender-role.is-admin svg {
  width: 10.5px;
  height: 10.5px;
}

.message-row.is-me .message-meta {
  justify-content: flex-end;
}

.bubble {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: none;
}

.message-row.is-me .bubble {
  border: 0;
  border-radius: 16px 16px 5px 16px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(79, 140, 255, .32);
}

.message-mention-inline {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 1px 7px 2px;
  border: 1px solid var(--mention-user-ring);
  border-radius: 999px;
  background: var(--mention-user-bg);
  color: var(--mention-user-ink);
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.message-mention-inline.is-all {
  border-color: var(--mention-all-ring);
  background: var(--mention-all-bg);
  color: var(--mention-all-ink);
}

button.message-mention-inline {
  cursor: pointer;
}

button.message-mention-inline:hover,
button.message-mention-inline:focus {
  background: var(--mention-user-hover-bg);
  outline: 2px solid color-mix(in srgb, var(--mention-user-ring), transparent 35%);
  outline-offset: 1px;
}

button.message-mention-inline.is-all:hover,
button.message-mention-inline.is-all:focus {
  background: var(--mention-all-hover-bg);
  outline-color: color-mix(in srgb, var(--mention-all-ring), transparent 35%);
}

.message-row.is-me .message-mention-inline {
  --mention-user-bg: rgba(255, 255, 255, .92);
  --mention-user-ink: #2f63c7;
  --mention-user-ring: rgba(255, 255, 255, .68);
  --mention-user-hover-bg: #fff;
  --mention-all-bg: rgba(255, 246, 214, .96);
  --mention-all-ink: #9a5b00;
  --mention-all-ring: rgba(180, 112, 0, .38);
  --mention-all-hover-bg: #fff0c2;
}

.message-row.is-system-notice {
  max-width: min(74%, 760px);
}

.message-row.is-system-notice .message-avatar {
  width: 38px;
  height: 38px;
}

.message-row.is-inbox-message .message-meta strong {
  color: var(--ink);
  font-weight: 800;
}

.message-row.is-inbox-message .bubble {
  border-color: color-mix(in srgb, var(--primary), var(--line) 70%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), transparent 64%), transparent 72%),
    color-mix(in srgb, var(--surface-strong), var(--surface) 58%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary), transparent 92%);
}

.message-row.is-inbox-message .bubble p {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.65;
}

.message-row.is-failed .bubble {
  border: 1px solid rgba(255, 111, 125, .4);
  background: rgba(255, 111, 125, .12);
  color: #ffd9dd;
}

.bubble blockquote {
  margin: 0 0 8px;
  border-left: 2.5px solid var(--brand);
  border-radius: 6px;
  background: rgba(79, 140, 255, .08);
  color: var(--ink-2);
}

.message-quote {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 9px 11px 9px 12px;
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 14%);
  border-left: 3px solid color-mix(in srgb, var(--primary), var(--line) 18%);
  border-radius: 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 88%), transparent 38%),
    color-mix(in srgb, var(--surface-strong), var(--surface) 62%);
  color: var(--muted);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.message-quote:hover,
.message-quote:focus {
  border-color: color-mix(in srgb, var(--primary), var(--line) 38%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 74%);
  outline: none;
}

.message-quote-author {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink), var(--muted) 22%);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-quote-author span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 650;
}

.message-quote-author b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
}

.message-quote-text {
  display: -webkit-box;
  overflow: hidden;
  color: color-mix(in srgb, var(--muted), var(--ink) 16%);
  font-size: 12px;
  font-weight: 520;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.message-row.is-me .message-quote {
  border-color: rgba(255, 255, 255, .22);
  border-left-color: rgba(255, 255, 255, .72);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .16), transparent 42%),
    rgba(255, 255, 255, .13);
  color: rgba(255, 255, 255, .78);
}

.message-row.is-me .message-quote:hover,
.message-row.is-me .message-quote:focus {
  background: rgba(255, 255, 255, .2);
}

.message-row.is-me .message-quote-author {
  color: rgba(255, 255, 255, .86);
}

.message-row.is-me .message-quote-author span,
.message-row.is-me .message-quote-text {
  color: rgba(255, 255, 255, .74);
}

.message-row.is-me .message-quote-author b {
  color: rgba(255, 255, 255, .96);
}

.attachment-card {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .04);
}

.attachment-card .file-type,
.file-type {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--grad-soft);
  color: var(--brand);
}

.attachment-image-card,
.attachment-video-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.attachment-image-card.has-media {
  width: min(180px, 100%);
  aspect-ratio: var(--media-ratio, 4 / 3);
  min-height: 84px;
  display: grid;
  place-items: center;
}

.attachment-video-card {
  width: min(190px, 100%);
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  overflow: visible;
}

.attachment-image-card.is-placeholder,
.attachment-video-card.is-placeholder {
  width: min(120px, 100%);
  aspect-ratio: var(--media-ratio, 4 / 3);
  min-height: 84px;
  display: grid;
  place-items: center;
}

.attachment-image-card:hover,
.attachment-video-card:hover {
  background: transparent;
}

.attachment-image-card img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 140px;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: color-mix(in srgb, var(--surface-soft), #000 3%);
}

.attachment-video-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: var(--media-ratio, 16 / 9);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 80px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #060a12;
}

.attachment-video-thumb img,
.attachment-video-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.attachment-video-thumb > i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 10, 22, .66);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
  backdrop-filter: blur(8px);
}

.media-play-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.attachment-video-info {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 3px;
  padding: 0 2px;
  text-align: left;
}

.attachment-video-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.attachment-thumbnail-status {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: auto;
  left: auto;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 10, 22, .68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  z-index: 5;
}

.attachment-thumbnail-status.is-ready {
  background: rgba(22, 101, 52, .76);
}

.attachment-thumbnail-status.is-pending {
  background: rgba(146, 64, 14, .76);
}

.attachment-thumbnail-status.is-failed {
  background: rgba(153, 27, 27, .78);
}

.attachment-media-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #fff;
  background: rgba(9, 14, 26, .72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 6;
}

.attachment-media-progress i {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7da2ff, #7b5cff);
}

.attachment-media-progress em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.attachment-media-progress.is-failed {
  background: rgba(186, 40, 57, .82);
}

.attachment-media-placeholder {
  min-height: 82px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--brand), #fff 22%);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .13), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #000 18%), color-mix(in srgb, var(--primary-2), #000 24%));
}

.attachment-media-placeholder svg {
  width: 32px;
  height: 32px;
  color: #fff;
  opacity: .92;
}

.attachment-image-card .attachment-media-placeholder {
  width: min(120px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.attachment-image-card.is-preview-error,
.attachment-video-card.is-preview-error {
  display: block;
  width: min(140px, 70vw);
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 35%);
  background: color-mix(in srgb, var(--surface-soft), var(--danger) 8%);
}

.attachment-card.is-preview-error.is-preview-unavailable {
  border-color: var(--line);
  background: var(--surface-soft);
}

.attachment-media-error {
  display: grid;
  gap: 8px;
  padding: 12px;
  text-align: left;
}

.attachment-media-error .attachment-media-placeholder {
  min-height: 63px;
  border-radius: 12px;
}

.attachment-media-error strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.attachment-media-error small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.attachment-media-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-media-error-actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--surface), var(--brand) 8%);
  font-size: 12px;
  font-weight: 700;
}

.attachment-file-card {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  width: min(420px, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  color: #1b2336;
  background: #f8fbff;
  border-color: rgba(79, 140, 255, .22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .74),
    0 10px 24px rgba(23, 35, 60, .08);
}

.attachment-file-card .file-type {
  width: 44px;
  min-width: 44px;
  height: 44px;
  color: #4f7df0;
  background: linear-gradient(135deg, #edf4ff, #e5ebff);
}

.attachment-file-copy {
  min-width: 0;
  overflow: hidden;
}

.attachment-file-copy strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  color: #172038;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-copy small {
  display: block;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: #5f6f8f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-action {
  align-self: center;
  padding: 5px 10px;
  border: 1px solid rgba(79, 140, 255, .22);
  border-radius: 999px;
  background: #eaf2ff;
  color: #2f63c7;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.message-row.is-me .attachment-file-card {
  background: #ffffff;
  border-color: rgba(255, 255, 255, .72);
  box-shadow:
    inset 0 0 0 1px rgba(88, 126, 236, .08),
    0 12px 28px rgba(14, 30, 74, .18);
}

.message-row.is-me .attachment-file-card .file-type {
  color: #4f7df0;
  background: linear-gradient(135deg, #edf4ff, #e8ecff);
}

.message-row.is-me .attachment-file-copy strong {
  color: #172038;
}

.message-row.is-me .attachment-file-copy small {
  color: #66738f;
}

.message-row.is-me .attachment-file-action {
  border-color: rgba(79, 140, 255, .22);
  background: #eaf2ff;
  color: #2f63c7;
}

.message-row.is-me .bubble.is-attachment-bubble {
  width: fit-content;
  inline-size: fit-content;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: end;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(124, 154, 220, .34);
  background: linear-gradient(180deg, #eef4ff 0%, #e7efff 100%);
  color: #172038;
  box-shadow: 0 12px 28px rgba(59, 96, 164, .16);
}

.bubble.is-attachment-bubble {
  width: fit-content;
  inline-size: fit-content;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: start;
  display: block;
  overflow: hidden;
}

.bubble.is-attachment-bubble .attachment-card {
  width: fit-content;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: start;
  margin-top: 0;
}

.bubble.is-attachment-bubble .attachment-image-card.has-media {
  width: 130px;
  inline-size: 130px;
  aspect-ratio: var(--media-ratio, 16 / 9);
  max-width: 100%;
  max-inline-size: 100%;
  contain: inline-size;
}

.bubble.is-attachment-bubble .attachment-image-card img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  object-fit: cover;
}

.bubble.is-attachment-bubble .attachment-video-card {
  width: 168px;
  inline-size: 168px;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  contain: inline-size;
  overflow: hidden;
}

.bubble.is-attachment-bubble .attachment-video-thumb {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
}

.bubble.is-attachment-bubble .media-play-dot {
  width: 24px;
  height: 24px;
}

.bubble.is-attachment-bubble .media-play-dot svg {
  width: 13px;
  height: 13px;
}

.bubble.is-attachment-bubble .attachment-thumbnail-status {
  top: 6px;
  right: 6px;
  bottom: auto;
  left: auto;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  font-size: 10px;
}

.bubble.is-attachment-bubble .attachment-image-card .attachment-media-placeholder {
  width: 130px;
  max-width: 100%;
  min-height: 70px;
}

.bubble.is-attachment-bubble .attachment-image-card.is-placeholder {
  width: 130px;
  inline-size: 130px;
  max-width: 100%;
  max-inline-size: 100%;
}

.bubble.is-attachment-bubble .attachment-video-info strong,
.bubble.is-attachment-bubble .attachment-video-meta {
  min-width: 0;
  max-width: 100%;
}

.bubble.is-attachment-bubble .attachment-file-card {
  width: 280px;
  inline-size: 280px;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  contain: inline-size;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, auto);
}

.bubble.is-attachment-bubble .attachment-file-action {
  max-width: 86px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.message-row.is-me .bubble.is-attachment-bubble p,
.message-row.is-me .bubble.is-attachment-bubble a,
.message-row.is-me .bubble.is-attachment-bubble .attachment-video-info strong {
  color: #172038;
}

.message-row.is-me .bubble.is-attachment-bubble .attachment-video-meta {
  color: #657490;
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-card {
  color: #e8edf9;
  background: rgba(17, 24, 39, .96);
  border-color: rgba(148, 163, 184, .24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .03),
    0 12px 28px rgba(0, 0, 0, .22);
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-card .file-type {
  color: #9cc9ff;
  background: rgba(91, 157, 255, .18);
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-copy strong {
  color: #f8fafc;
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-copy small {
  color: #b8c4dc;
}

body:not([data-theme="aurora"]) .message-row:not(.is-me) .attachment-file-action {
  border-color: rgba(91, 157, 255, .25);
  background: rgba(91, 157, 255, .18);
  color: #d9e8ff;
}

body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble {
  border-color: rgba(124, 154, 220, .24);
  background: linear-gradient(180deg, rgba(17, 24, 39, .95) 0%, rgba(10, 15, 28, .97) 100%);
  color: #e8edf9;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-card {
  color: #e8edf9;
  background: rgba(15, 23, 42, .94);
  border-color: rgba(148, 163, 184, .24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .035),
    0 12px 28px rgba(0, 0, 0, .22);
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-card .file-type {
  color: #9cc9ff;
  background: linear-gradient(135deg, rgba(91, 157, 255, .20), rgba(139, 123, 255, .18));
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-copy strong,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble p,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble a,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble .attachment-video-info strong {
  color: #f8fafc;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-copy small,
body:not([data-theme="aurora"]) .message-row.is-me .bubble.is-attachment-bubble .attachment-video-meta {
  color: #b8c4dc;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-file-action {
  border-color: rgba(91, 157, 255, .28);
  background: rgba(91, 157, 255, .18);
  color: #d9e8ff;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-image-card img,
body:not([data-theme="aurora"]) .message-row.is-me .attachment-video-thumb {
  border-color: rgba(148, 163, 184, .22);
  background: #060a12;
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-media-placeholder {
  color: #9cc9ff;
  background:
    radial-gradient(circle at 50% 42%, rgba(148, 163, 184, .14), transparent 38%),
    linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(30, 41, 59, .96));
}

body:not([data-theme="aurora"]) .message-row.is-me .attachment-image-card .attachment-media-placeholder {
  border-color: rgba(148, 163, 184, .22);
}

.bubble.is-sticker-bubble,
.message-row.is-me .bubble.is-sticker-bubble {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.bubble.is-sticker-bubble .message-quote {
  max-width: min(240px, 100%);
  margin-bottom: 8px;
}

.message-row.is-failed .bubble.is-sticker-bubble {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.message-row.is-failed .bubble.is-sticker-bubble .sticker-message-stage {
  outline: 1px solid rgba(255, 111, 125, .45);
  outline-offset: 2px;
}

.message-quote-body,
.reply-copy.has-thumb {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.message-quote-thumb,
.reply-thumb {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.message-quote-thumb img,
.reply-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sticker-message {
  width: min(var(--sticker-w, 160px), 228px, 54vw);
  max-width: 100%;
  display: grid;
  gap: 6px;
}

.sticker-message-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--sticker-ratio, 1);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
}

.sticker-media-static,
.sticker-media-animated {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.sticker-message.has-animated .sticker-media-static {
  display: none;
}

.sticker-play-button {
  display: none;
}

.sticker-message-fallback {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

[data-reduced-chat-motion] .message-row, [data-workspace-idle] .message-row, [data-reduced-chat-motion] .emoji-popover, [data-workspace-idle] .emoji-popover, [data-reduced-chat-motion] .emoji-panel-body, [data-workspace-idle] .emoji-panel-body {
  animation: none;
}

[data-reduced-chat-motion] .sticker-message.has-animated .sticker-media-static, [data-workspace-idle] .sticker-message.has-animated .sticker-media-static {
  display: block;
}

[data-reduced-chat-motion] .sticker-message.has-animated .sticker-media-animated, [data-workspace-idle] .sticker-message.has-animated .sticker-media-animated {
  display: none;
}

[data-reduced-chat-motion]:not([data-workspace-idle]) .sticker-message.has-animated.is-playing .sticker-media-static {
  display: none;
}

[data-reduced-chat-motion]:not([data-workspace-idle]) .sticker-message.has-animated.is-playing .sticker-media-animated {
  display: block;
}

[data-reduced-chat-motion] .sticker-message.has-animated .sticker-play-button, [data-workspace-idle] .sticker-message.has-animated .sticker-play-button {
  position: absolute;
  top: auto;
  right: 8px;
  bottom: 8px;
  left: 8px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

[data-reduced-chat-motion]:not([data-workspace-idle]) .sticker-message.has-animated.is-playing .sticker-play-button {
  display: none;
}

@media (max-width: 820px) {
  .sticker-message {
    width: min(var(--sticker-w, 148px), 188px, 58vw);
  }
}

/* GIF attachments share sticker bubble decoration without changing message semantics. */
body .message-row .bubble.is-attachment-bubble:has(.attachment-image-card > img[data-gif-src]),
.message-row.is-sticker-message .bubble.is-sticker-bubble,
body:not([data-theme="aurora"]) .message-row.is-sticker-message .bubble.is-sticker-bubble,
body:not([data-theme="aurora"]) .message-row.is-me.is-sticker-message .bubble.is-sticker-bubble,
body[data-theme="aurora"] .message-row.is-sticker-message .bubble.is-sticker-bubble,
body[data-theme="aurora"] .message-row.is-me.is-sticker-message .bubble.is-sticker-bubble {
  width: fit-content;
  inline-size: fit-content;
  max-width: min(228px, 54vw);
  max-inline-size: min(228px, 54vw);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  overflow: visible;
}

.message-row.is-sticker-message .sticker-message-stage {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.message-row.is-sticker-message .sticker-media-static,
.message-row.is-sticker-message .sticker-media-animated {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Preserve the original GIF pixels and transparent regions inside its existing size. */
body .message-row .bubble.is-attachment-bubble .attachment-image-card:has(> img[data-gif-src]),
body .message-row .bubble.is-attachment-bubble .attachment-image-card > img[data-gif-src] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .message-row .bubble.is-attachment-bubble .attachment-image-card > img[data-gif-src] {
  object-fit: contain;
}

.message-foot {
  min-height: 22px;
  gap: 7px;
  margin: 0 4px;
  color: var(--ink-3);
  font-size: 11px;
}

.message-row.is-me .message-foot {
  justify-content: flex-end;
}

.message-state {
  padding: 0;
  background: transparent;
  color: var(--ink-3);
}

.message-state[data-state="failed"] {
  color: var(--bad);
  background: transparent;
}

.message-actions button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
}

.composer-panel {
  flex: 0 0 auto;
  margin: 8px 18px 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
  box-shadow: var(--sh-sm);
}

.composer-shell {
  max-width: none;
  gap: 0;
}

.reply-bar {
  margin: 9px 12px 0;
  border-color: var(--line);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 82%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--surface-strong), var(--surface) 54%);
}

.reply-copy {
  min-height: 34px;
  display: grid;
  gap: 2px;
  padding-left: 9px;
}

.reply-copy b {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-copy em {
  max-width: 100%;
  color: var(--muted);
  line-height: 1.35;
}

.reply-clear-button {
  min-width: 54px;
  height: 30px;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 72%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 54%);
  color: var(--primary);
  font-weight: 760;
}

.reply-clear-button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 45%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 30%);
  color: var(--primary);
}

.composer-panel.is-editing {
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--primary), transparent 86%);
}

.composer-edit-bar {
  min-height: 48px;
  margin: 9px 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 70%);
  border-radius: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 78%) 0 3px, transparent 3px),
    color-mix(in srgb, var(--surface-strong), var(--surface) 48%);
}

.composer-edit-mark {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  flex: 0 0 30px;
  height: 30px;
  max-height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 22%);
  color: var(--primary);
}

.composer-edit-mark svg {
  width: 16px !important;
  min-width: 16px;
  max-width: 16px;
  height: 16px !important;
  min-height: 16px;
  max-height: 16px;
  display: block;
  flex: 0 0 16px;
}

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

.composer-edit-copy b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.composer-edit-copy em {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-edit-cancel {
  width: auto;
  min-width: 54px;
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 720;
}

.composer-edit-cancel:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
  color: var(--primary);
}

.composer-edit-bar svg,
.message-action-popover svg {
  width: 16px !important;
  max-width: 16px;
  height: 16px !important;
  max-height: 16px;
  display: block;
  flex: 0 0 16px;
}

.composer-input {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0;
  cursor: text;
}

.composer-input textarea {
  min-height: 32px;
  max-height: 110px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.composer-input textarea::placeholder {
  color: var(--ink-3);
}

.composer-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.composer-toolbar {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 13px 14px 8px;
}

.composer-tool {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
}

.composer-tool:hover {
  color: var(--ink);
  background: var(--raise);
}

.composer-tool svg {
  width: 18px;
  height: 18px;
}

.composer-tool.is-pending::after {
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  background: var(--warn);
}

.send-button { flex: 0 0 auto; height: 40px; min-height: 40px; min-width: 78px; padding: 0 20px; border-radius: 12px; font-size: 14px; font-weight: 640; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1; white-space: nowrap; transform: none; transition: box-shadow .16s var(--ease-out), filter .16s var(--ease-out), opacity .16s var(--ease-out); }

.send-button:hover,
.send-button:focus { background: var(--grad); color: #fff; transform: none; filter: brightness(1.04); box-shadow: 0 10px 24px rgba(79, 140, 255, .38); }

.send-button:active { opacity: .92; transform: none; filter: brightness(.98); }

.send-button svg { width: 16px; height: 16px; display: block; flex: 0 0 16px; }

.composer-hint {
  padding: 0 14px 11px;
  color: var(--ink-3);
  font-size: 11px;
}

.context-scrim {
  display: none;
}

.context-panel {
  position: static;
  z-index: auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: rgba(10, 14, 23, .42);
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: none;
}

.im-shell:not(.is-detail-open) .context-panel {
  display: none;
}

.context-head {
  min-height: 60px;
  padding: 18px 18px 10px;
  border-bottom: 0;
}

.context-head h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 660;
}

.context-head p {
  color: var(--ink-2);
}

.context-tabs {
  display: flex;
  gap: 4px;
  padding: 0 18px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.context-tabs button {
  flex: 1;
  min-height: 30px;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
}

.context-tabs button.is-active {
  color: #fff;
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .3);
}

.context-panel.context-tab-overview.context-kind-group .context-tabs,
.context-panel.context-tab-overview.context-kind-single .context-tabs {
  display: none;
}

.context-panel.context-kind-rtc .context-tabs {
  display: none;
}

.context-panel.context-kind-rtc .context-body {
  background: var(--surface);
}

.rtc-detail-context {
  min-height: 100%;
  align-content: start;
}

.rtc-detail-context .rtc-detail-profile-card {
  overflow: visible;
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background:
    radial-gradient(220px 150px at 50% 0%, color-mix(in srgb, var(--primary), transparent 84%), transparent 70%),
    color-mix(in srgb, var(--surface-soft), var(--surface) 44%);
  box-shadow: none;
}

.rtc-detail-context .rtc-detail-profile-card .avatar {
  margin-top: 0;
}

.rtc-detail-context .info-list {
  grid-template-columns: 1fr;
}

.rtc-detail-context .info-list > span {
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 36%);
}

.rtc-detail-actions {
  margin-top: auto;
}

.rtc-detail-actions .primary-button,
.rtc-detail-actions .rtc-detail-dial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  max-height: 44px;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary), transparent 74%);
}

.rtc-detail-actions .primary-button svg,
.rtc-detail-actions .rtc-detail-dial-button svg {
  display: block;
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
}

.im-shell[data-view="rtc"].is-detail-open .context-scrim {
  display: none;
}

.context-body {
  flex: 1;
  min-height: 0;
  padding: 18px;
}

.context-section {
  gap: 18px;
}

.profile-large,
.context-section > .profile-large.compact {
  justify-items: center;
  grid-template-columns: 1fr;
  text-align: center;
  padding: 6px 0 0;
}

.context-section .profile-large .avatar,
.profile-large .avatar-xl {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  font-size: 26px;
}

.profile-large h3,
.profile-large h2 {
  color: var(--ink);
  font-size: 17px;
}

.group-profile-hero .detail-title-row h2,
.group-profile-hero .detail-title-row h2 > span,
.group-detail-hero .detail-title-row h3,
.group-detail-hero .detail-title-row h3 > span {
  max-width: min(100%, 560px);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.group-profile-hero .detail-title-row h2,
.group-detail-hero .detail-title-row h3 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-large p {
  color: var(--ink-2);
  font-size: 12.5px;
}

.notice-box,
.ctx-card,
.info-list > span,
.info-grid > span,
.panel,
.feature-panel,
.file-focus,
.rtc-stage,
.empty-state,
.error-state {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .02);
}

.notice-box {
  background: var(--grad-soft);
}

body[data-theme="midnight"] .group-members-panel {
  border-color: var(--line);
  background: rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .group-member-row {
  border-color: rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .group-member-row:hover {
  border-color: rgba(96, 165, 250, .32);
  background: rgba(96, 165, 250, .08);
}

body[data-theme="midnight"] .group-members-head button {
  background: rgba(96, 165, 250, .12);
  color: #93c5fd;
}

.notice-box strong,
.panel-head h3,
.info-list strong,
.info-grid strong {
  color: var(--ink);
}

.notice-box p,
.info-list small,
.info-grid small,
.panel-head span,
.muted {
  color: var(--ink-2);
}

.member-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.member-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.member-filter-field {
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line-2), transparent 8%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: var(--ink-2);
  box-sizing: border-box;
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out);
}

.member-filter-field:focus-within {
  border-color: rgba(91, 157, 255, .78);
  background: rgba(91, 157, 255, .08);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, .16);
}

.member-filter-field svg {
  width: 15px;
  height: 15px;
  color: var(--ink-2);
}

.member-filter-field input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  caret-color: var(--primary);
}

.member-filter-field input::placeholder {
  color: color-mix(in srgb, var(--ink-2), transparent 14%);
}

.member-filter-clear {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
}

.member-filter-count {
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}

.member-filter-scope {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.member-filter-empty {
  display: grid;
  gap: 5px;
  padding: 18px 14px;
  border: 1px dashed color-mix(in srgb, var(--line-2), transparent 10%);
  border-radius: 13px;
  color: var(--ink-2);
  text-align: center;
}

.member-filter-empty strong {
  color: var(--ink);
}

.reaction-unread-badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, #facc15, transparent 50%);
  border-radius: 7px;
  background: color-mix(in srgb, #facc15, transparent 86%);
  color: color-mix(in srgb, #facc15, var(--ink) 24%);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  line-height: 17px;
  white-space: nowrap;
  letter-spacing: 0;
}

.reaction-unread-badge.is-muted {
  border-color: color-mix(in srgb, #d8b84a, transparent 60%);
  background: color-mix(in srgb, #d8b84a, transparent 91%);
  color: color-mix(in srgb, #d8b84a, var(--ink-2) 35%);
}

.member-card {
  min-height: 86px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
}

.member-card:hover {
  border-color: var(--line);
  background: var(--raise);
}

.switch {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, .1);
}

.switch::before {
  width: 18px;
  height: 18px;
  margin: 2px;
}

.switch.is-on {
  background: var(--grad);
}

.switch.is-on::before {
  margin-left: 18px;
}

.switch.is-pending {
  cursor: progress;
  opacity: .72;
}

.switch.is-pending::after {
  content: "";
  position: absolute;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(255, 255, 255, .72);
  border-top-color: transparent;
  border-radius: 999px;
  animation: switch-spin .8s linear infinite;
}

.switch-loading-text {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

@keyframes switch-spin {
  to { transform: rotate(360deg); }
}

.locked-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: color-mix(in srgb, var(--ok), var(--ink) 22%);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.locked-toggle em {
  font-style: normal;
}

.locked-toggle .switch {
  display: block;
}

.switch.is-readonly {
  cursor: default;
  opacity: .88;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok), transparent 58%);
}

.switch-row.is-policy > span {
  color: var(--ink);
}

.context-kind-single .context-tabs,
.context-kind-system .context-tabs {
  grid-auto-flow: initial;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.context-kind-system .context-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.context-profile-card,
.context-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.context-profile-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 14px;
  overflow: hidden;
  text-align: center;
}

.context-profile-card .profile-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  height: 96px;
  background:
    radial-gradient(140px 90px at 18% 24%, rgba(255, 255, 255, .24), transparent 62%),
    radial-gradient(160px 130px at 86% 78%, rgba(124, 107, 255, .58), transparent 62%),
    linear-gradient(135deg, rgba(79, 140, 255, .95), rgba(124, 107, 255, .92));
  opacity: .95;
}

.context-profile-card .profile-cover::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: repeating-linear-gradient(118deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 24px);
}

.context-profile-card .avatar {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  margin-top: 28px;
  border-radius: 22px;
  font-size: 26px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

.context-profile-card.group-profile .avatar,
.context-profile-card.system-profile .avatar {
  margin-top: 0;
  background: var(--grad);
}

.context-profile-card h3,
.context-card h3 {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 16px;
  font-weight: 680;
}

.context-profile-card p,
.context-card p {
  position: relative;
  z-index: 1;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.context-badges,
.context-action-grid {
  position: relative;
  z-index: 1;
}

.context-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.context-badges .chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-action-grid {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 8px;
}

.context-action-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.context-action-grid button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
}

.context-action-grid svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.context-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.context-card.accent-card {
  background: var(--grad-soft);
  border-color: rgba(124, 140, 255, .24);
}

.context-card.compact-card {
  padding: 12px 14px;
}

.safety-card {
  gap: 14px;
}

.safety-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.safety-card-head h3 {
  margin: 0;
}

.safety-card-head span {
  color: var(--ink-3);
  font-size: 12px;
}

.safety-action-grid {
  display: grid;
  gap: 10px;
}

.safety-action-button {
  width: 100%;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line), var(--surface) 18%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 16%);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  transition: transform .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out);
}

.safety-action-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), var(--line) 48%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 58%);
}

.safety-action-title {
  color: inherit;
  font-size: 14px;
  font-weight: 760;
}

.safety-action-note {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.35;
}

.safety-action-button.is-danger {
  border-color: color-mix(in srgb, var(--danger), var(--line) 70%);
  background: color-mix(in srgb, var(--danger), var(--surface) 94%);
  color: var(--danger);
}

.safety-action-button.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), var(--line) 34%);
  background: color-mix(in srgb, var(--danger), var(--surface) 88%);
}

.safety-action-button.is-warning {
  border-color: color-mix(in srgb, var(--warn), var(--line) 70%);
  background: color-mix(in srgb, var(--warn), var(--surface) 94%);
  color: var(--warn);
}

.safety-action-button.is-warning:hover {
  border-color: color-mix(in srgb, var(--warn), var(--line) 34%);
  background: color-mix(in srgb, var(--warn), var(--surface) 88%);
}

.safety-action-button.is-danger .safety-action-note,
.safety-action-button.is-warning .safety-action-note {
  color: color-mix(in srgb, currentColor, var(--ink-3) 46%);
}

.context-section-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.context-section-head h3,
.context-section-head span {
  min-width: 0;
}

.context-section-head span {
  color: var(--ink-3);
  font-size: 12px;
}

.context-section-head button {
  flex: none;
  color: var(--primary);
  font-size: 12px;
}

.context-kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.context-kv:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.context-kv span {
  color: var(--ink-3);
}

.context-kv strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 620;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-file-list,
.context-member-strip {
  display: grid;
  gap: 9px;
}

.context-file-mini {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  color: var(--ink);
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.context-file-mini:hover {
  border-color: rgba(124, 140, 255, .3);
  background: var(--raise);
  transform: translateY(-1px);
}

.context-file-mini .file-type,
.context-file-mini .avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.context-file-mini .file-type {
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  overflow: hidden;
  color: var(--primary);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.context-file-mini > span:last-child {
  min-width: 0;
  overflow: hidden;
}

.context-file-mini strong,
.context-file-mini small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-file-mini strong {
  font-size: 12.5px;
}

.context-file-mini small {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.context-member-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.context-member-pill {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--ink);
  transition: background .16s ease;
}

.context-member-pill:hover {
  background: var(--raise);
}

.context-member-pill .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 13px;
}

.context-member-pill strong,
.context-member-pill small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-member-pill strong {
  font-size: 11.5px;
}

.context-member-pill small {
  color: var(--ink-3);
  font-size: 10.5px;
}

.context-kind-single .tag-row {
  justify-content: center;
}

.page-workspace {
  background: transparent;
}

.page-scroll {
  flex: 1;
  min-height: 0;
  padding: 22px 24px;
}

.content-grid,
.content-grid.three {
  grid-template-columns: minmax(0, 1fr);
}

.file-focus {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
}

.preview-canvas {
  min-height: 360px;
  border-color: rgba(124, 140, 255, .22);
  border-radius: 16px;
  background: var(--grad-soft);
}

.preview-canvas span,
.modal-preview span,
.preview-mini span {
  border-radius: 14px;
  background: var(--grad);
}

.file-focus-foot {
  color: var(--ink);
}

.theme-cards button,
.set-item {
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
}

.theme-cards button.is-active,
.set-item.on,
.theme-cards button:hover {
  background: var(--grad-soft);
  color: #fff;
  border-color: rgba(124, 140, 255, .28);
}

.video-grid {
  min-height: 520px;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.video-grid div {
  border-color: var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(40, 50, 80, .5), rgba(20, 26, 44, .7));
}

.video-grid span {
  border-radius: 30px;
  background: var(--grad);
}

.call-controls {
  justify-content: center;
  padding-top: 14px;
}

.modal-card,
.drawer-card,
.menu-popover,
.emoji-popover,
.toast {
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(13, 17, 28, .99));
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.modal-card header,
.drawer-card header,
.modal-card footer {
  border-color: var(--line);
}

.tool-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, .03);
}

.toast {
  border-left-color: var(--ok);
}

.emoji-popover {
  bottom: 136px;
  padding: 12px;
  border-radius: 18px;
}

.emoji-head {
  align-items: center;
  margin-bottom: 10px;
}

.emoji-head span {
  flex: 1;
}

.emoji-close {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  color: var(--ink-3);
  font-weight: 800;
}

.emoji-close:hover {
  color: var(--ink);
  background: var(--raise);
}

.mention-popover {
  position: fixed;
  z-index: 62;
  left: calc(var(--rail-w) + var(--side-w) + 28px);
  bottom: 150px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(360px, calc(100vh - 180px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(13, 17, 28, .99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  animation: pop-in .14s var(--ease-out);
}

.mention-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.mention-head strong {
  color: var(--ink);
}

.mention-head span,
.mention-empty {
  color: var(--ink-3);
  font-size: 12px;
}

.mention-list {
  display: grid;
  gap: 4px;
  padding: 8px;
  overflow: auto;
}

.mention-item {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.mention-item:hover {
  border-color: var(--line);
  background: var(--raise);
}

.mention-item.is-all {
  border-color: rgba(255, 205, 86, .28);
  background: rgba(255, 205, 86, .08);
}

.mention-item.is-all:hover {
  border-color: rgba(255, 205, 86, .46);
  background: rgba(255, 205, 86, .13);
}

.mention-all-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 205, 86, .18);
  color: #ffd166;
  font-weight: 850;
}

.mention-item .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 13px;
}

.mention-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.mention-empty {
  padding: 18px 12px;
  text-align: center;
}

.member-popover {
  position: absolute;
  z-index: 18;
  left: 0;
  top: 0;
  width: 244px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(13, 17, 28, .99));
  box-shadow: 0 22px 50px rgba(0, 0, 0, .48);
  animation: pop-in .14s var(--ease-out);
}

.member-popover-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.member-popover-head .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.member-popover-head strong,
.member-popover-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-popover-head small {
  color: var(--ink-3);
  font-size: 12px;
}

.member-popover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.member-popover-actions button {
  min-height: 32px;
  border-radius: 10px;
  background: var(--raise);
  color: var(--ink-2);
}

.member-profile-modal {
  width: min(420px, calc(100vw - 32px));
}

.member-profile-management { padding: 12px 18px; border-top: 1px solid var(--line); min-width: 0; }
.member-profile-management-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.member-profile-management-actions button,
.member-profile-confirm-actions button { min-width: 0; min-height: 40px; padding: 8px; white-space: normal; overflow-wrap: anywhere; }
.member-profile-removal-confirm,
.member-profile-mute-confirm { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); }
.member-profile-removal-confirm p,
.member-profile-mute-confirm p { margin: 0 0 10px; overflow-wrap: anywhere; }
.member-profile-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.member-profile-confirm-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.member-profile-confirm-actions button > span[aria-hidden] { display: inline-flex; flex: 0 0 auto; }
.member-profile-confirm-actions .member-profile-danger-button { border-color: var(--danger); background: var(--danger); color: #fff; }
.member-profile-confirm-actions .member-profile-danger-button:hover:not(:disabled) { background: color-mix(in srgb, var(--danger), #000 10%); }
.member-profile-mute-error { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--danger); }
.member-profile-mute-error > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.member-profile-mute-error > button { flex: 0 0 auto; min-height: 36px; }
@media (max-width: 420px) {
  .member-profile-management { padding-inline: 12px; }
  .member-profile-management-actions { gap: 6px; }
  .member-profile-management-actions button { padding-inline: 4px; font-size: 12px; }
  .member-profile-confirm-actions button { gap: 4px; padding-inline: 6px; }
}

.member-profile-hero {
  padding: 18px 18px 6px;
}

.user-profile-avatar-preview {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.user-profile-avatar-preview:focus {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 34%);
  outline-offset: 3px;
}

.member-info-list {
  padding: 12px 18px 18px;
}

.composer-panel {
  margin: 8px 18px 14px;
}

.composer-footer {
  padding: 8px 12px 7px;
}

.composer-input-row {
  align-items: flex-end;
  gap: 14px;
  padding: 10px 14px 8px;
}

.composer-input {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
}

.composer-input textarea {
  height: auto;
  min-height: 40px;
  max-height: calc(1.55em * 4 + 14px);
  padding: 7px 0;
  line-height: 1.55;
  resize: none;
  overflow-y: hidden;
  outline: none;
  box-shadow: none;
  transition: height 0.12s var(--ease-out);
}

.composer-input textarea:focus {
  outline: none;
  box-shadow: none;
}

.composer-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 12px;
}

.composer-hint > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-limit {
  flex: 0 0 auto;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.16s var(--ease-out);
}

.composer-limit b {
  font-weight: 700;
}

.composer-limit.is-warn {
  color: var(--warn);
}

.composer-limit.is-limit {
  color: var(--bad);
}

.app-rail {
  background: rgba(7, 10, 18, .78);
}

.rail-item {
  color: var(--ink-3);
}

.rail-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
}

.rail-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 140, 255, .18), rgba(124, 107, 255, .14));
  border-color: rgba(124, 140, 255, .35);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .12);
}

.rail-badge {
  background: var(--bad);
  border-color: var(--bg-soft);
  box-shadow: 0 3px 10px rgba(255, 111, 125, .28);
}

.message-row {
  white-space: normal;
  position: relative;
}

.message-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.message-avatar:hover {
  transform: none;
  box-shadow: 0 10px 22px rgba(124, 107, 255, .24);
}

.message-foot {
  width: fit-content;
  position: static;
}

.message-row.is-me .message-foot {
  justify-self: end;
  justify-items: end;
  text-align: right;
}

.message-row.is-me .message-state {
  color: var(--ok);
}

.message-row.is-me button.message-state {
  text-decoration: underline dotted rgba(55, 224, 166, .5);
  text-underline-offset: 3px;
}

.message-row.is-me button.message-state::before {
  content: "✓";
  margin-right: 4px;
  color: var(--ok);
  letter-spacing: 0;
}

.message-actions {
  position: static;
  z-index: auto;
  width: auto;
  border-radius: 12px;
  background: rgba(14, 19, 32, .72);
  backdrop-filter: blur(12px);
}

.message-row.is-me .message-actions {
  justify-content: flex-end;
}

.message-actions button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--ink-2);
}

.message-actions button:hover {
  color: var(--ink);
  background: var(--raise);
}

.message-actions .danger-button,
.message-row.is-failed .message-actions .danger-button {
  color: var(--bad);
  border-color: rgba(255, 111, 125, .32);
  background: rgba(255, 111, 125, .08);
}

.message-click-target {
  cursor: pointer;
  transition:
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    transform .16s var(--ease-out);
}

.message-click-target:hover {
  border-color: rgba(124, 140, 255, .32);
  box-shadow: 0 0 0 1px rgba(124, 140, 255, .10);
}

.message-bubble-line{position:relative;display:block;width:fit-content;max-width:100%;min-width:0}

.message-bubble-line > .bubble{min-width:0;max-width:100%}

.message-row.is-me .message-bubble-line,
.message-row.is-outgoing .message-bubble-line{justify-self:end}

.message-hover-time{position:absolute;z-index:4;top:50%;display:inline-flex;align-items:center;max-width:min(112px,32vw);min-height:24px;padding:0 8px;overflow:hidden;border:1px solid rgba(148,163,184,.24);border-radius:999px;background:rgba(15,23,42,.76);color:rgba(226,232,240,.92);font-size:11px;font-variant-numeric:tabular-nums;line-height:1;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-50%);transition:opacity .14s var(--ease-out),visibility .14s var(--ease-out);box-shadow:0 8px 20px rgba(15,23,42,.16);backdrop-filter:blur(10px)}

.message-row:not(.is-me):not(.is-outgoing) .message-hover-time{left:calc(100% + 8px)}

.message-row.is-me .message-hover-time,
.message-row.is-outgoing .message-hover-time{right:calc(100% + 8px)}

.message-row:hover .message-hover-time,
.message-row:focus-within .message-hover-time{opacity:1;visibility:visible}

body[data-theme="aurora"] .message-hover-time {
  border-color: rgba(127, 151, 191, .22);
  background: rgba(255, 255, 255, .86);
  color: #53627f;
  box-shadow: 0 8px 20px rgba(80, 103, 150, .14);
}

.message-row.is-readonly-notice .bubble,
.message-row.is-readonly-notice .message-avatar {
  cursor: default;
}

.message-row.is-readonly-notice .bubble:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 70%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary), transparent 92%);
  transform: none;
}

.message-row.is-menu-open {
  z-index: 90;
}

.message-row.is-member-menu-open {
  z-index: 95;
}

.message-row.is-menu-open .message-stack {
  z-index: 91;
}

.message-row.is-menu-open .message-click-target {
  border-color: rgba(124, 140, 255, .52);
  box-shadow: 0 0 0 2px rgba(91, 157, 255, .18), 0 16px 42px rgba(0, 0, 0, .22);
}

.message-action-popover {
  position: absolute;
  z-index: 120;
  top: 0;
  left: 0;
  width: min(260px, calc(100vw - 48px));
  max-height: min(360px, calc(100vh - 220px));
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(14, 18, 30, .99));
  color: var(--ink);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .52);
  backdrop-filter: blur(16px);
  animation: message-menu-in .14s var(--ease-out);
}

.message-action-popover[data-placement="above"] {
  animation-name: message-menu-up;
}

.message-interaction-overlay-host {
  position: fixed;
  z-index: 220;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
  contain: layout style;
}

.message-interaction-overlay-host:empty,
.message-interaction-overlay-host[data-anchor-visible="false"] {
  visibility: hidden;
}

.message-interaction-overlay-host > .message-action-popover,
.message-interaction-overlay-host > .member-popover {
  position: absolute;
  right: auto;
  bottom: auto;
  margin: 0;
  pointer-events: auto;
  animation: message-overlay-fade .12s var(--ease-out);
}

.message-interaction-overlay-host > .member-popover {
  z-index: 130;
}

@keyframes message-overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.message-reaction-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px 5px;
  border-bottom: 1px solid var(--line);
}

.message-reaction-row button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font);
  font-size: 18px;
  transition: background .14s var(--ease-out), transform .14s var(--ease-out);
}

.message-reaction-row button:hover {
  background: var(--raise);
  transform: translateY(-1px) scale(1.06);
}

.message-reaction-row .reaction-more {
  margin-left: auto;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--font);
}

.message-reaction-row .reaction-more svg {
  width: 15px;
  height: 15px;
}

.message-stack > .reaction-strip {
  box-sizing: border-box;
  width: fit-content;
  inline-size: fit-content;
  max-width: 100%;
  max-inline-size: 100%;
  justify-self: start;
  align-self: start;
  justify-content: flex-start;
}

.message-row:not(.is-me) .message-stack > .reaction-strip {
  justify-self: start;
  justify-content: flex-start;
}

.message-row.is-me .message-stack > .reaction-strip {
  justify-self: end;
  justify-content: flex-end;
}

.message-stack>.reaction-strip{gap:6px;margin-top:5px;padding:0 2px;align-items:center}
.message-row:not(.is-me) .message-stack>.reaction-strip{margin-left:2px}
.message-row.is-me .message-stack>.reaction-strip{margin-right:2px}
.reaction-strip button{height:22px;min-height:22px;gap:3px;padding:0 7px 0 6px;border:1px solid color-mix(in srgb,var(--primary),var(--line) 80%);background:color-mix(in srgb,var(--surface),var(--primary-soft) 38%);color:color-mix(in srgb,var(--ink),var(--primary) 22%);line-height:1;justify-content:center}
.reaction-strip button span{display:inline-flex;align-items:center;justify-content:center;width:15px;height:16px;font-size:14px;line-height:16px;transform:none}
.reaction-strip button strong{display:inline-flex;align-items:center;justify-content:center;min-width:7px;height:16px;font:750 12px/16px var(--font);color:color-mix(in srgb,var(--muted),var(--primary) 36%);font-variant-numeric:tabular-nums}
.reaction-strip button:hover,.reaction-strip button:focus{border-color:color-mix(in srgb,var(--primary),var(--line) 32%);background:color-mix(in srgb,var(--surface),var(--primary-soft) 68%);transform:translateY(-1px)}
.reaction-strip button.is-mine{color:var(--primary);border-color:color-mix(in srgb,var(--primary),transparent 34%);background:linear-gradient(135deg,color-mix(in srgb,var(--primary),transparent 84%),color-mix(in srgb,var(--secondary),transparent 88%))}
.reaction-strip button.is-mine strong{color:color-mix(in srgb,var(--primary),var(--ink) 10%)}

.message-action-list,
.message-action-danger {
  display: grid;
  gap: 1px;
}

.message-action-list button,
.message-action-danger button {
  min-height: 32px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
}

.message-action-list button:hover,
.message-action-danger button:hover {
  background: var(--raise);
}

.message-action-list svg,
.message-action-danger svg {
  width: 15px;
  height: 15px;
  color: var(--ink-2);
}

.message-action-list span,
.message-action-danger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-action-list em {
  color: var(--ink-3);
  font-size: 12px;
  font-style: normal;
}

.message-action-danger em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.message-action-danger {
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.message-action-danger button {
  color: var(--bad);
}

.message-action-danger button.message-report-action {
  order: 99;
}

.message-action-danger svg {
  color: var(--bad);
}

.message-action-danger button.is-disabled {
  color: var(--ink-3);
}

.message-action-danger button.is-disabled svg {
  color: var(--ink-3);
}

.message-action-danger button.is-disabled:hover {
  background: var(--surface-soft);
}

@keyframes message-menu-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes message-menu-up {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.read-modal.seen-modal {
  width: min(360px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 40px));
  grid-template-rows: auto auto minmax(0, 1fr);
  border-radius: 18px;
}

.seen-modal .seen-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 16px 12px;
}

.seen-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.seen-ok {
  color: var(--ok);
  letter-spacing: 0;
}

.mini-bubble {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.seen-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.seen-tabs button {
  flex: none;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
}

.seen-tabs button.is-active,
.seen-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--grad-soft);
}

.seen-list.seen-body {
  gap: 0;
  padding: 6px;
}

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

.seen-glabel {
  padding: 8px 10px 4px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.seen-modal .seen-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
}

.seen-modal .seen-row:hover {
  background: var(--raise);
}

.seen-modal .avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 13px;
}

.seen-avatar-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.seen-avatar-button:hover,
.seen-avatar-button:focus {
  outline: 0;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary), transparent 86%),
    0 8px 18px rgba(124, 107, 255, .16);
  transform: none;
}

.seen-person {
  flex: 1;
  min-width: 0;
}

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

.seen-result {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.seen-result i {
  color: var(--ok);
  font-style: normal;
  letter-spacing: 0;
}

.react-tag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 16px;
}

.seen-row.is-unread {
  opacity: .72;
}

.seen-reactions-body {
  border-top: 1px solid var(--line);
}

.seen-reaction-row .seen-result {
  gap: 7px;
}

.seen-reaction-row .seen-result time {
  color: var(--ink-3);
  font-size: 11px;
}

.seen-reaction-row.is-removed {
  opacity: .62;
}

.seen-empty,
.seen-reactions-empty {
  margin: 6px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-soft), transparent 28%);
}

.seen-empty strong,
.seen-reactions-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
}

.seen-empty p,
.seen-reactions-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.panel-search.is-simple {
  padding-bottom: 6px;
}

.panel-search.is-simple .search-field {
  margin-bottom: 2px;
}

.file-category-list {
  display: grid;
  gap: 8px;
  padding: 0 8px 14px;
}

.file-category-row {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  transition:
    border-color .16s var(--ease-out),
    background .16s var(--ease-out),
    color .16s var(--ease-out),
    transform .16s var(--ease-out);
}

.file-category-row:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .035);
  transform: translateY(-1px);
}

.file-category-row.is-active {
  color: var(--ink);
  border-color: rgba(124, 140, 255, .34);
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .12);
}

.file-category-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.file-category-row.is-active .file-category-icon {
  color: var(--primary);
}

.file-category-icon svg {
  width: 17px;
  height: 17px;
}

.file-category-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-category-row small {
  color: var(--ink-3);
  font-size: 11.5px;
}

.context-overview {
  gap: 16px;
}

.detail-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 6px 0 16px;
  text-align: center;
}

.detail-avatar {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  font-size: 26px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

.group-detail-hero .detail-avatar,
.single-detail-hero .detail-avatar {
  background: linear-gradient(135deg, #4f8cff, #62d2ff);
}

.single-detail-hero .detail-avatar {
  background: linear-gradient(135deg, #8f57ff, #58c7ff);
}

.single-detail-hero {
  position: relative;
  padding: 8px 0 16px;
}

.single-detail-hero .detail-cover {
  width: 100%;
  height: 108px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(140px 90px at 20% 28%, rgba(255, 255, 255, .28), transparent 62%),
    radial-gradient(180px 140px at 86% 84%, rgba(124, 107, 255, .58), transparent 60%),
    radial-gradient(160px 120px at 60% 0%, rgba(106, 214, 255, .28), transparent 60%),
    linear-gradient(135deg, #4f8cff, #7c6bff);
  box-shadow: var(--sh-sm);
}

.single-detail-hero .detail-avatar {
  margin-top: -46px;
  border: 4px solid var(--bg-soft);
}

.detail-hero h3 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: 0;
}

.detail-hero p {
  max-width: 100%;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}

.detail-actions {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.detail-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-actions.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-actions button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 650;
}

.detail-actions svg {
  width: 16px;
  height: 16px;
}

.context-kind-group .context-overview {
  gap: 14px;
}

.context-kind-group .context-overview .detail-actions {
  gap: 10px;
  margin-top: 4px;
}

.context-kind-group .context-overview .detail-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1;
  box-shadow: none;
}

.context-kind-group .context-overview .detail-actions button svg {
  width: 15px;
  height: 15px;
}

.context-kind-group .context-overview .detail-actions .primary-button {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary), transparent 80%);
}

.context-kind-group .context-overview .detail-actions .primary-button svg {
  color: #fff;
}

.context-kind-group .context-overview .detail-actions button:not(.primary-button) {
  border-color: color-mix(in srgb, var(--line), transparent 12%);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 38%);
  color: var(--ink);
}

.context-kind-group .context-overview .detail-actions button:not(.primary-button) svg {
  color: var(--primary);
}

.user-action-panel {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.user-action-panel.is-compact {
  margin-top: 0;
}

.user-action-grid {
  display: grid;
  gap: 8px;
}

.user-action-grid.is-profile-primary {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .82fr);
}

.user-action-grid.is-primary {
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, .78fr));
}

.user-action-grid.is-contact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-action-grid.is-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-action-grid.is-profile-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-action-grid.is-profile-danger {
  grid-template-columns: minmax(0, 1fr);
}

.user-action-grid.is-relation-only {
  grid-template-columns: minmax(0, 1fr);
}

.user-action {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 11px;
  border-color: color-mix(in srgb, var(--line), var(--primary) 10%);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 45%);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.user-action.is-disabled,
.user-action:disabled {
  cursor: not-allowed;
  opacity: .68;
  box-shadow: none;
}

.user-action-panel.is-relation-only {
  gap: 6px;
}

.relation-action-note {
  margin: 0;
  text-align: center;
}

.direct-not-friend-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning), var(--line) 45%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning), var(--surface) 88%);
}

.direct-not-friend-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.direct-not-friend-copy strong {
  font-size: 12.5px;
  color: var(--ink);
}

.direct-not-friend-copy span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}

.direct-not-friend-banner .user-action {
  min-height: 34px;
  border-radius: 9px;
}

.user-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), var(--line) 40%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 34%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary), transparent 88%);
}

.user-action.is-main {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary), transparent 74%);
}

.user-action.is-main:hover {
  color: #fff;
  box-shadow: 0 18px 38px color-mix(in srgb, var(--primary), transparent 68%);
}

.user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 58%);
  background: color-mix(in srgb, var(--danger), transparent 91%);
  color: var(--danger);
}

.user-action.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), transparent 34%);
  background: color-mix(in srgb, var(--danger), transparent 86%);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--danger), transparent 88%);
}

.user-action.is-warning {
  border-color: color-mix(in srgb, var(--warn), transparent 54%);
  background: color-mix(in srgb, var(--warn), transparent 89%);
  color: var(--warn);
}

.user-action svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.user-action span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .022);
}

.detail-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-card-head span:first-child {
  min-width: 0;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 640;
  letter-spacing: .4px;
}

.detail-card-head span:last-child {
  color: var(--ink-3);
  font-size: 12px;
}

.detail-card-head button {
  flex: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 640;
}

.detail-card p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.context-kind-group .context-overview .detail-card {
  gap: 12px;
  padding: 14px 14px 15px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface), transparent 8%);
}

.context-kind-group .context-overview .detail-card-head {
  min-height: 18px;
  align-items: baseline;
}

.context-kind-group .context-overview .detail-card-head span:first-child {
  font-size: 12px;
  font-weight: 640;
  letter-spacing: .4px;
}

.context-kind-group .context-overview .detail-card-head button:not(.group-edit-icon-button) {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 640;
  line-height: 1.2;
  box-shadow: none;
}

.context-kind-group .context-overview .detail-card-head button:not(.group-edit-icon-button):hover {
  background: transparent;
  color: color-mix(in srgb, var(--primary), var(--ink) 14%);
  transform: none;
}

.context-kind-group .context-overview .detail-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.chat-key-account-bar {
  position: relative;
  z-index: 4;
  min-width: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--warn), transparent 76%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--warn), var(--surface) 94%), color-mix(in srgb, var(--surface), transparent 4%));
}

.chat-key-account-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.chat-key-account-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.chat-key-account-head {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 9px;
  /* Keep the collapse chevron clear of the absolutely positioned close hit area. */
  padding: 8px 48px 8px 18px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.chat-key-account-head:hover {
  background: color-mix(in srgb, var(--warn), transparent 92%);
}

.chat-key-account-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn), transparent 84%);
  color: var(--warn);
}

.chat-key-account-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.chat-key-account-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

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

.chat-key-account-title strong {
  color: color-mix(in srgb, var(--warn), var(--ink) 26%);
  font-size: 12px;
  font-weight: 820;
}

.chat-key-account-title small {
  color: var(--ink-3);
  font-size: 11px;
}

.chat-key-account-count {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn), transparent 86%);
  color: color-mix(in srgb, var(--warn), var(--ink) 18%);
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}

.chat-key-account-chevron {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: transform .16s var(--ease-out);
}

.chat-key-account-chevron svg {
  width: 14px;
  height: 14px;
}

.chat-key-account-bar:not(.is-open) .chat-key-account-chevron {
  transform: rotate(-90deg);
}

.chat-key-account-list {
  position: absolute;
  top: 100%;
  right: 12px;
  left: 12px;
  min-width: 0;
  max-height: min(44vh, 360px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 10px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 70%);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: color-mix(in srgb, var(--surface), var(--warn) 3%);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--ink), transparent 84%);
  overscroll-behavior: contain;
}

.chat-key-account-bar:not(.is-open) .chat-key-account-list {
  display: none;
}

.chat-key-account-item {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 76%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--raise), var(--warn) 5%);
  color: var(--ink);
  text-align: left;
}

.chat-key-account-item:hover {
  border-color: color-mix(in srgb, var(--warn), transparent 48%);
  background: color-mix(in srgb, var(--raise), var(--warn) 10%);
}

.chat-key-account-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn);
}

.chat-key-account-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-key-account-main strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
}

.chat-key-account-main small {
  color: var(--ink-3);
  font-size: 11px;
}

.chat-key-account-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: color-mix(in srgb, var(--warn), var(--ink) 20%);
  font-size: 10.5px;
  font-weight: 780;
  white-space: nowrap;
}

.chat-key-account-meta em {
  font-style: normal;
}

.chat-key-account-state {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--warn), transparent 72%);
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.chat-key-account-state button {
  min-width: 64px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--warn), transparent 55%);
  border-radius: 9px;
  background: color-mix(in srgb, var(--raise), var(--warn) 7%);
  color: var(--ink);
}

.chat-key-account-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--warn), transparent 70%);
  border-top-color: var(--warn);
  border-radius: 50%;
  animation: behavior-spin .8s linear infinite;
}

.chat-key-account-head:focus,
.chat-key-account-item:focus,
.chat-key-account-state button:focus {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 48%);
  outline-offset: -3px;
}

@media (max-width: 390px) {
  .chat-key-account-head {
    grid-template-columns: 20px minmax(0, 1fr) auto 18px;
    gap: 7px;
    padding-inline: 12px;
  }

  .chat-key-account-icon {
    width: 20px;
    height: 20px;
    border-radius: 7px;
  }

  .chat-key-account-title small {
    display: none;
  }

  .chat-key-account-count {
    padding-inline: 6px;
  }

  .chat-key-account-list {
    right: 6px;
    left: 6px;
    max-height: min(52vh, 320px);
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }
}

.chat-key-account-empty {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, var(--warn), transparent 70%);
  border-radius: 10px;
  color: var(--ink-3);
}

.chat-key-account-empty strong,
.chat-key-account-empty small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.chat-key-account-empty strong {
  color: var(--ink);
  font-weight: 760;
}

.detail-member-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.detail-member,
.detail-member-more {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  color: var(--ink);
  text-align: center;
}

.detail-member .avatar,
.detail-member-more {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.detail-member .avatar {
  font-size: 13px;
}

.detail-member strong,
.detail-member small,
.detail-member-more strong,
.detail-member-more small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-member strong,
.detail-member-more strong {
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 650;
}

.detail-member small,
.detail-member-more small {
  color: var(--ink-3);
  font-size: 10.5px;
}

.detail-member-more {
  align-content: center;
  border: 1px dashed rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .025);
}

.owner-crown {
  position: absolute;
  top: -4px;
  right: calc(50% - 32px);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb75f, #ff815f);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  box-shadow: 0 6px 16px rgba(255, 129, 95, .26);
}

.detail-setting-row,
.detail-kv {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}

.detail-setting-row:first-of-type,
.detail-kv:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.detail-kv strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 620;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-card.drawer-group-managers,
.drawer-card.drawer-group-blacklist {
  width: min(520px, calc(100vw - 28px));
  background:
    radial-gradient(420px 220px at 70% 0%, rgba(91, 157, 255, .12), transparent 62%),
    linear-gradient(180deg, rgba(22, 28, 44, .98), rgba(12, 16, 27, .995));
}

.drawer-card.drawer-group-managers header,
.drawer-card.drawer-group-blacklist header {
  padding: 20px 22px 16px;
}

.drawer-card.drawer-group-managers .drawer-body,
.drawer-card.drawer-group-blacklist .drawer-body {
  padding: 18px 22px 24px;
}

.governance-drawer {
  display: grid;
  gap: 14px;
}

.governance-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(106, 214, 255, .18);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(91, 157, 255, .12), rgba(124, 107, 255, .08));
}

.governance-summary.is-danger {
  border-color: rgba(255, 111, 125, .22);
  background: linear-gradient(135deg, rgba(255, 111, 125, .10), rgba(255, 181, 95, .06));
}

.governance-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(91, 157, 255, .16);
  color: var(--primary);
}

.governance-summary.is-danger .governance-mark {
  background: rgba(255, 111, 125, .14);
  color: var(--bad);
}

.governance-mark svg {
  width: 19px;
  height: 19px;
}

.governance-summary strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.governance-summary p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}

.governance-list {
  display: grid;
  gap: 10px;
}

.governance-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .025);
  transition:
    border-color .16s var(--ease-out),
    background .16s var(--ease-out),
    transform .16s var(--ease-out);
}

.governance-row:hover {
  border-color: rgba(124, 140, 255, .28);
  background: rgba(255, 255, 255, .045);
  transform: translateY(-1px);
}

.governance-row.is-danger:hover {
  border-color: rgba(255, 111, 125, .28);
}

.governance-row .avatar {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 16px;
}

.governance-copy {
  min-width: 0;
}

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

.governance-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 690;
}

.governance-copy small {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.governance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.governance-chips i {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(124, 140, 255, .20);
  border-radius: 999px;
  background: rgba(124, 140, 255, .08);
  color: var(--ink-2);
  font-size: 10.5px;
  font-style: normal;
}

.governance-row.is-danger .governance-chips i {
  border-color: rgba(255, 111, 125, .20);
  background: rgba(255, 111, 125, .08);
}

.governance-action {
  min-width: 58px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  color: var(--ink);
  font-size: 12px;
  font-weight: 640;
}

.governance-action:hover {
  border-color: rgba(124, 140, 255, .32);
  background: var(--raise);
}

@media (max-width: 1180px) {
  .im-shell.is-detail-open {
    grid-template-columns: var(--rail-w) minmax(288px, 320px) minmax(0, 1fr);
  }

  .context-panel {
    position: fixed;
    z-index: 55;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, calc(100vw - var(--rail-w)));
    transform: translateX(104%);
    opacity: 0;
    pointer-events: none;
    transition: transform .24s var(--ease-out), opacity .18s var(--ease-out);
  }

  .im-shell.is-detail-open .context-panel {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .context-scrim {
    display: block;
    left: calc(var(--rail-w) + 320px);
  }
}

@media (max-width: 760px) {
  :root {
    --rail-w: 64px;
    --mobile-side-w: min(300px, calc(100vw - var(--rail-w) - 36px));
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"] {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .brand-button,
  .rail-user {
    width: 42px;
  }

  .rail-item {
    width: 48px;
  }

  .side-panel {
    width: var(--mobile-side-w);
    background: rgba(10, 14, 23, .96);
  }

  .context-scrim {
    left: var(--rail-w);
  }

  .workspace-topbar {
    height: 64px;
    min-height: 64px;
    padding: 0 12px;
  }

  .topbar-actions > button:not(.primary-button):not(.detail-action):not(.icon-action) {
    display: none;
  }

  .room-strip {
    margin: 10px 12px 0;
    padding: 9px 10px;
  }

  .rtc-idle-workspace .page-scroll {
    padding: 14px 12px;
  }

  .rtc-empty-panel {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    min-height: auto;
    padding: 20px;
  }

  .rtc-empty-visual {
    width: 82px;
    height: 82px;
    border-radius: 24px;
  }

  .rtc-empty-icon svg {
    width: 34px;
    height: 34px;
  }

  .rtc-empty-copy h2 {
    font-size: 22px;
  }

  .rtc-empty-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rtc-empty-actions button {
    justify-content: center;
    padding: 0 10px;
  }

  .rtc-record-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .rtc-record-card button {
    grid-column: 2 / -1;
  }

  .message-scroll,
  .page-scroll {
    padding-left: 12px;
    padding-right: 12px;
  }

  .message-row,
  .message-row.is-me {
    max-width: 94%;
  }

  .message-hover-time {
    display: none;
  }

  .message-row > .avatar {
    display: grid;
  }

  .composer-panel {
    margin: 8px 10px 12px;
  }

  .reply-bar {
    margin: 8px 10px 0;
    gap: 8px;
  }

  .reply-copy b {
    max-width: 96px;
  }

  .reply-clear-button {
    min-width: 48px;
    padding: 0 8px;
  }

  .composer-hint {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .mention-popover {
    left: calc(var(--rail-w) + 12px);
    right: 12px;
    width: auto;
    bottom: 158px;
  }

  .member-popover {
    left: 0;
    top: 42px;
    width: min(244px, calc(100vw - var(--rail-w) - 34px));
  }

  .composer-actions button:not(.primary-button) {
    display: none;
  }

  .account-profile-card,
  .account-info-list {
    grid-template-columns: 1fr;
  }

  .account-profile-card {
    justify-items: center;
    text-align: center;
  }

.context-panel {
  width: min(360px, calc(100vw - var(--rail-w)));
}
}

.directory-detail-shell {
  width: min(1120px, 100%);
  display: grid;
  gap: 18px;
  margin: 0 auto;
}

.directory-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(124, 140, 255, .24);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .14), rgba(124, 107, 255, .08)),
    rgba(255, 255, 255, .025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.directory-summary-mark,
.directory-avatar {
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.directory-summary-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f8cff, #6ad6ff);
  box-shadow: 0 16px 32px rgba(79, 140, 255, .18);
}

.directory-summary.is-requests .directory-summary-mark {
  background: linear-gradient(135deg, #ff9a3d, #ff4f6d);
  box-shadow: 0 16px 32px rgba(255, 111, 78, .18);
}

.directory-summary.is-blacklist .directory-summary-mark {
  background: linear-gradient(135deg, #ff6464, #a855f7);
  box-shadow: 0 16px 32px rgba(255, 100, 100, .16);
}

.directory-summary-copy {
  min-width: 0;
}

.directory-summary-copy small,
.directory-section-title span,
.directory-card-foot,
.request-copy small,
.directory-group-title small,
.directory-notice,
.blacklist-copy small,
.blacklist-copy em {
  color: var(--ink-3);
}

.directory-summary-copy small {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 750;
}

.directory-summary-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.18;
}

.directory-summary-copy p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.directory-summary-stats {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  gap: 8px;
}

.directory-summary-stats span,
.directory-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
}

.directory-summary-stats strong,
.directory-metrics strong {
  color: var(--ink);
  font-size: 15px;
}

.directory-summary-stats small,
.directory-metrics small {
  color: var(--ink-3);
  font-size: 11px;
}

.directory-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.directory-section-title strong {
  color: var(--ink);
  font-size: 15px;
}

.friend-request-list,
.blacklist-record-list {
  display: grid;
  gap: 12px;
}

.friend-request-card,
.directory-group-card,
.blacklist-record-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), transform .16s var(--ease-out);
}

.friend-request-card:hover,
.directory-group-card:hover,
.blacklist-record-card:hover {
  border-color: rgba(124, 140, 255, .35);
  background: rgba(255, 255, 255, .04);
  transform: translateY(-1px);
}

.friend-request-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.request-person,
.directory-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.directory-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #4f8cff, #6ad6ff);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  user-select: none;
}

.directory-avatar.is-request {
  background: linear-gradient(135deg, #ff9a3d, #ff4f6d);
}

.directory-avatar.is-group i {
  position: absolute;
  left: -6px;
  top: auto;
  bottom: -6px;
  min-width: 21px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(255, 221, 126, .72);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1a8, #ffd66d);
  color: #754600;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(245, 188, 54, .22), 0 0 0 2px var(--surface);
}

.directory-avatar.is-blocked {
  background: linear-gradient(135deg, #ff6464, #a855f7);
}

.request-copy,
.directory-group-title,
.blacklist-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.request-copy strong,
.directory-group-title strong,
.blacklist-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-status {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .035);
  font-size: 11px;
  font-weight: 700;
}

.directory-status.is-pending {
  border-color: rgba(255, 204, 107, .30);
  color: #ffcc6b;
  background: rgba(255, 204, 107, .08);
}

.directory-status.is-done,
.directory-status.is-live {
  border-color: rgba(42, 224, 169, .28);
  color: var(--ok);
  background: rgba(42, 224, 169, .08);
}

.directory-status.is-rejected {
  border-color: rgba(255, 111, 111, .30);
  color: var(--danger);
  background: rgba(255, 111, 111, .08);
}

.request-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .026);
  line-height: 1.55;
}

.directory-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.directory-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.directory-card-actions button,
.soft-button {
  min-height: 36px;
  padding: 0 14px;
}

.soft-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .035);
}

.soft-button:hover {
  border-color: rgba(124, 140, 255, .34);
  background: rgba(124, 140, 255, .10);
}

.directory-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.directory-group-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.directory-group-card.is-api {
  border-style: dashed;
}

.directory-notice {
  min-height: 42px;
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(106, 214, 255, .07);
  line-height: 1.55;
}

.directory-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.blacklist-record-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
}

.blacklist-copy em {
  font-style: normal;
  font-size: 11px;
}

body[data-theme="aurora"] .directory-summary {
  border-color: rgba(82, 113, 255, .22);
  background:
    linear-gradient(135deg, rgba(79, 140, 255, .13), rgba(124, 107, 255, .09)),
    rgba(255, 255, 255, .92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .72),
    0 14px 34px rgba(35, 48, 82, .08);
}

body[data-theme="aurora"] .directory-summary-copy small {
  color: #6f7d99;
}

body[data-theme="aurora"] .directory-summary-copy h2 {
  color: #172038;
}

body[data-theme="aurora"] .directory-summary-copy p {
  color: #4f5f7c;
}

body[data-theme="aurora"] .directory-summary-stats span,
body[data-theme="aurora"] .directory-metrics span {
  border-color: rgba(24, 34, 48, .13);
  background: rgba(255, 255, 255, .62);
}

body[data-theme="aurora"] .directory-summary-stats strong,
body[data-theme="aurora"] .directory-metrics strong {
  color: #172038;
}

body[data-theme="aurora"] .directory-summary-stats small,
body[data-theme="aurora"] .directory-metrics small {
  color: #75839f;
}

body[data-theme="aurora"] .directory-section-title strong {
  color: #172038;
}

body[data-theme="aurora"] .directory-section-title span,
body[data-theme="aurora"] .directory-card-foot,
body[data-theme="aurora"] .directory-group-title small,
body[data-theme="aurora"] .request-copy small,
body[data-theme="aurora"] .blacklist-copy small,
body[data-theme="aurora"] .blacklist-copy em {
  color: #66738f;
}

body[data-theme="aurora"] .directory-group-card,
body[data-theme="aurora"] .friend-request-card,
body[data-theme="aurora"] .blacklist-record-card {
  border-color: rgba(24, 34, 48, .14);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 26px rgba(35, 48, 82, .06);
}

body[data-theme="aurora"] .directory-group-card:hover,
body[data-theme="aurora"] .friend-request-card:hover,
body[data-theme="aurora"] .blacklist-record-card:hover {
  border-color: rgba(82, 113, 255, .28);
  background: rgba(255, 255, 255, .96);
}

body[data-theme="aurora"] .directory-group-card.is-api {
  border-color: rgba(115, 127, 150, .24);
}

body[data-theme="aurora"] .directory-group-title strong,
body[data-theme="aurora"] .request-copy strong,
body[data-theme="aurora"] .blacklist-copy strong {
  color: #172038;
}

body[data-theme="aurora"] .directory-notice,
body[data-theme="aurora"] .request-message {
  color: #5c6b86;
  background: rgba(79, 140, 255, .075);
  border: 1px solid rgba(79, 140, 255, .06);
}

body[data-theme="aurora"] .directory-status {
  border-color: rgba(24, 34, 48, .13);
  color: #56627d;
  background: rgba(255, 255, 255, .72);
}

body[data-theme="aurora"] .directory-status.is-pending {
  border-color: rgba(214, 146, 37, .28);
  color: #a76516;
  background: rgba(255, 184, 77, .12);
}

body[data-theme="aurora"] .directory-status.is-done,
body[data-theme="aurora"] .directory-status.is-live {
  border-color: rgba(26, 169, 122, .28);
  color: #158768;
  background: rgba(26, 169, 122, .10);
}

body[data-theme="aurora"] .directory-status.is-rejected {
  border-color: rgba(220, 72, 72, .26);
  color: #b63232;
  background: rgba(220, 72, 72, .10);
}

body[data-theme="aurora"] .soft-button {
  color: #24304a;
  border-color: rgba(24, 34, 48, .14);
  background: rgba(255, 255, 255, .72);
}

@media (max-width: 920px) {
  .directory-summary,
  .blacklist-record-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .directory-summary-stats,
  .blacklist-record-card .directory-card-actions {
    grid-column: 1 / -1;
  }

  .directory-summary-stats,
  .directory-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blacklist-record-card .directory-card-actions {
    justify-content: flex-start;
  }
}

:root,
body[data-theme="midnight"] {
  --layer-surface: #111827;
  --layer-surface-2: #0d1220;
  --layer-border: rgba(148, 163, 184, .18);
  --layer-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

body[data-theme="aurora"] {
  --layer-surface: #ffffff;
  --layer-surface-2: #f7f9fd;
  --layer-border: #dfe6f2;
  --layer-shadow: 0 24px 64px rgba(35, 48, 82, .22);
}

.modal-card,
.modal-card.enterprise-modal,
.drawer-card,
.drawer-card.drawer-group-managers,
.drawer-card.drawer-group-blacklist,
.menu-popover,
.emoji-popover,
.mention-popover,
.member-popover,
.message-action-popover,
.toast {
  border-color: var(--layer-border) !important;
  background: linear-gradient(180deg, var(--layer-surface), var(--layer-surface-2)) !important;
  box-shadow: var(--layer-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.toast {
  border-left-color: var(--ok) !important;
}

.toast[data-tone="success"],
.toast[data-tone="ok"] {
  border-left-color: var(--ok) !important;
}

.toast[data-tone="warn"],
.toast[data-tone="warning"] {
  border-left-color: var(--warn) !important;
}

.toast[data-tone="danger"],
.toast[data-tone="error"] {
  border-left-color: var(--danger) !important;
}

body[data-theme="aurora"] .toast-close:hover {
  background: rgba(15, 23, 42, .06);
}

@media (max-width: 520px) {
  .toast-stack {
    top: 12px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 24px));
  }

  .toast-stack:hover .toast,
  .toast-stack:focus-within .toast {
    transform: translate3d(0, calc(var(--toast-depth) * 86px), 0) scale(1);
  }
}

body[data-theme="aurora"] .seen-tabs {
  background: #fff;
}

body[data-theme="aurora"] .seen-tabs button {
  color: #52617a;
}

body[data-theme="aurora"] .seen-tabs button.is-active {
  color: #21449a;
  background: linear-gradient(135deg, #e8efff 0%, #f0edff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(82, 113, 255, .22),
    0 8px 18px rgba(79, 140, 255, .10);
}

body[data-theme="aurora"] .seen-tabs button.is-active span {
  color: #20b982;
}

.brand-button:focus,
.rail-user:focus,
.enterprise-switcher:focus {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary), transparent 82%),
    0 10px 28px color-mix(in srgb, var(--primary), transparent 76%);
}

.brand-button:active,
.rail-user:active,
.enterprise-switcher:active {
  opacity: 1;
  transform: scale(.98);
}

body[data-theme="aurora"] .brand-button:focus,
body[data-theme="aurora"] .rail-user:focus {
  box-shadow:
    0 0 0 3px rgba(79, 140, 255, .18),
    0 10px 28px rgba(79, 140, 255, .20);
}

body[data-theme="aurora"] .rail-user {
  background: linear-gradient(135deg, #4b5b93, #6676ba);
  box-shadow: 0 10px 24px rgba(64, 76, 122, .20);
}

body[data-theme="aurora"] .rail-user:hover {
  background: linear-gradient(135deg, #4659a1, #6a6ff0);
}

body[data-theme="aurora"] .enterprise-switcher {
  border-color: rgba(24, 34, 48, .13);
  background:
    radial-gradient(150px 70px at 0% 0%, rgba(79, 140, 255, .10), transparent 72%),
    rgba(255, 255, 255, .72);
  box-shadow: 0 12px 30px rgba(35, 48, 82, .07);
}

body[data-theme="aurora"] .enterprise-switcher:hover,
body[data-theme="aurora"] .enterprise-switcher:focus {
  border-color: rgba(82, 113, 255, .34);
  background:
    radial-gradient(170px 78px at 0% 0%, rgba(79, 140, 255, .15), transparent 74%),
    #fff;
}

body[data-theme="aurora"] .enterprise-switcher.is-readonly:hover,
body[data-theme="aurora"] .enterprise-switcher.is-readonly:focus {
  border-color: rgba(24, 34, 48, .13);
  background:
    radial-gradient(150px 70px at 0% 0%, rgba(79, 140, 255, .10), transparent 72%),
    rgba(255, 255, 255, .72);
}

.member-avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.member-avatar-wrap.is-large {
  align-self: center;
}

.owner-crown{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;width:20px;height:20px;border:1px solid rgba(255,213,128,.55);border-radius:999px;background:linear-gradient(135deg,#ffd66f,#ff8c42);color:#3d2300;box-shadow:0 7px 16px rgba(255,154,66,.24);}
.owner-crown svg{width:11px;height:11px;stroke-width:2.2;}
.admin-shield{position:absolute;right:-6px;bottom:-5px;display:grid;place-items:center;width:19px;height:19px;border:1px solid rgba(106,214,255,.36);border-radius:999px;background:linear-gradient(135deg,rgba(91,157,255,.95),rgba(106,214,255,.86));color:#061529;box-shadow:0 7px 16px rgba(91,157,255,.24);}
.admin-shield svg{width:10.5px;height:10.5px;stroke-width:2.2;}
.role-badge{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:19px;padding:0 7px;border:1px solid rgba(124,140,255,.18);border-radius:7px;background:rgba(124,140,255,.08);color:var(--ink-2);font-size:10.5px;font-weight:650;line-height:1;white-space:nowrap;}
.role-badge svg{width:11px;height:11px;}
.role-badge.is-owner{border-color:rgba(255,190,92,.34);background:linear-gradient(135deg,rgba(255,205,112,.20),rgba(255,140,66,.12));color:#ffbd63;}
.role-badge.is-admin{border-color:rgba(106,214,255,.28);background:rgba(106,214,255,.10);color:var(--primary);}
.owner-inline{display:inline-flex;align-items:center;gap:6px;vertical-align:middle;}
.owner-inline b{color:var(--ink);font-weight:680;}
.owner-inline .role-badge{min-height:19px;padding-inline:6px;font-size:10px;}
.role-member-card{position:relative;transition:transform .16s var(--ease-out),border-color .16s var(--ease-out),background .16s var(--ease-out);}
.role-member-card:hover{transform:translateY(-1px);}
.role-member-card.is-owner{border-color:rgba(255,190,92,.22);background:radial-gradient(90px 50px at 50% 0%,rgba(255,190,92,.14),transparent 72%),var(--raise);}
.role-detail-member .role-badge{margin-top:0;}

.member-role-modal{width:min(560px,calc(100vw - 32px));border-radius:22px;}
.member-role-modal header{align-items:flex-start;padding:22px 24px 18px;}
.member-role-modal header h2{margin:0;font-size:22px;font-weight:780;letter-spacing:0;}
.member-role-modal header p{margin-top:6px;font-size:13px;}
.member-role-body{min-height:0;display:grid;gap:16px;padding:20px 24px 18px;overflow:auto;}
.member-role-hero{display:grid;grid-template-columns:78px minmax(0,1fr);align-items:center;gap:20px;padding:20px;border:1px solid var(--line);border-radius:18px;background:radial-gradient(220px 110px at 0% 0%,rgba(91,157,255,.14),transparent 72%),var(--surface);}
.member-role-hero h3{margin:0 0 6px;color:var(--ink);font-size:21px;font-weight:780;line-height:1.12;}
.member-role-hero p{margin:0 0 12px;color:var(--ink-2);font-size:14px;line-height:1.35;}
.member-role-info{display:grid;gap:0;margin:0;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.025);}
.member-role-info>span{display:grid;grid-template-columns:118px minmax(0,1fr);align-items:center;gap:16px;min-height:58px;padding:14px 18px;border-bottom:1px solid var(--line);}
.member-role-info>span:last-child{border-bottom:0;}
.member-role-info>span>small{color:var(--ink-3);font-size:13px;line-height:1.2;}
.member-role-info>span>strong{min-width:0;color:var(--ink);font-size:14px;font-weight:680;line-height:1.35;}
.member-role-info .member-role-user-id{grid-template-columns:118px minmax(0,1fr);}
.member-role-user-id strong{width:100%;overflow:hidden;text-align:left;white-space:nowrap;}
.member-role-user-id .copy-user-id-button{width:fit-content;max-width:100%;overflow:hidden;}
.member-role-user-id .copy-user-id-button span{overflow:hidden;text-overflow:ellipsis;}
.member-role-modal footer{align-items:center;padding:16px 24px 22px;gap:10px;}
.member-role-modal footer button{min-height:42px;padding-inline:18px;border-radius:14px;font-weight:700;}
.member-role-modal .is-permission-blocked{color:var(--ink-2);background:rgba(255,255,255,.04);cursor:not-allowed;}
.member-role-modal .is-permission-blocked:hover{border-color:var(--line);background:rgba(255,255,255,.04);transform:none;}

.governance-mark.is-owner,
.governance-row.is-owner .avatar {
  background: linear-gradient(135deg, rgba(255, 213, 111, .22), rgba(255, 140, 66, .16));
  color: #ffbd63;
}

.governance-row.is-owner {
  border-color: rgba(255, 190, 92, .22);
}

.governance-row .role-badge {
  justify-self: end;
}

body[data-theme="aurora"] .owner-crown{border-color:rgba(209,128,25,.22);color:#653800;box-shadow:0 9px 18px rgba(218,130,24,.16)}
body[data-theme="aurora"] .role-badge.is-owner{color:#a56300;background:#fff6df}
body[data-theme="aurora"] .role-badge.is-admin{color:#1662bd;background:#e9f5ff}
body[data-theme="aurora"] .admin-shield{border-color:rgba(40,116,206,.22);background:linear-gradient(135deg,#dff0ff,#89c9ff);color:#123f75;box-shadow:0 7px 15px rgba(40,116,206,.15)}
body[data-theme="aurora"] .member-role-hero{background:radial-gradient(240px 120px at 0% 0%,rgba(79,140,255,.11),transparent 72%),#fff}
body[data-theme="aurora"] .member-role-modal{background:#fff!important}
body[data-theme="aurora"] .member-role-info{background:#fff}
body[data-theme="aurora"] .member-role-info>span>small{color:#71809a}
body[data-theme="aurora"] .member-role-modal .is-permission-blocked{color:#66738b;background:#f6f8fc}
body[data-theme="aurora"] .member-role-modal .is-permission-blocked:hover{border-color:rgba(24,34,48,.14);background:#f6f8fc}

@media (max-width: 560px) {
  .member-role-modal header,.member-role-body,.member-role-modal footer{padding-inline:16px}
  .member-role-hero{grid-template-columns:62px minmax(0,1fr);gap:14px;padding:16px}
  .member-role-info>span{grid-template-columns:88px minmax(0,1fr);gap:10px;padding-inline:14px}
}

body[data-theme="aurora"] .switch{background:#e8edf6;box-shadow:inset 0 0 0 1px rgba(20,30,55,.08)}
body[data-theme="aurora"] .switch.is-on{background:var(--grad);box-shadow:none}

.mute-strip{border-color:rgba(255,184,77,.28);background:linear-gradient(135deg,rgba(255,184,77,.12),rgba(255,111,97,.08)),var(--surface)}
.mute-strip.is-scheduled{border-color:rgba(91,157,255,.26);background:linear-gradient(135deg,rgba(91,157,255,.12),rgba(124,111,255,.08)),var(--surface)}
.mute-strip .room-strip-main>span:first-child{color:var(--warn)}
.mute-strip.is-scheduled .room-strip-main>span:first-child{color:var(--primary)}
.group-governance-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:4px}
.group-governance-action-grid .group-mute-control{grid-column:1/-1}
.group-settings-section{display:grid;gap:10px;margin-top:12px}
.group-settings-section:first-of-type{margin-top:0}
.group-settings-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.group-settings-section-head strong{color:var(--ink);font-size:13px;font-weight:780}
.group-settings-section-head small{max-width:190px;color:var(--ink-3);font-size:11px;line-height:1.45;text-align:right}
.group-settings-section.is-danger .group-settings-section-head strong{color:var(--bad)}
.group-mute-control,.group-mute-list-entry{display:grid;gap:12px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--raise)}
.group-manage-setting-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}
.group-setting-tile{min-height:56px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--raise),var(--surface) 24%)}
.group-setting-tile.is-wide{grid-column:1/-1}
.group-setting-tile:last-child{border-bottom:1px solid var(--line)}
.group-mute-control.is-active{border-color:rgba(255,184,77,.28);background:radial-gradient(160px 80px at 0% 0%,rgba(255,184,77,.12),transparent 72%),var(--raise)}
.group-mute-control.is-scheduled{border-color:rgba(91,157,255,.24)}
.group-mute-control.is-readonly,.group-mute-list-entry.is-readonly{border-style:dashed;opacity:.82}
.group-mute-copy{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:10px}
.group-mute-copy b,.group-mute-inline b{display:block;color:var(--ink);font-size:13px;font-weight:720}
.group-mute-copy b{display:flex;align-items:center;gap:6px}
.group-mute-copy small,.group-mute-inline small{display:block;margin-top:3px;color:var(--ink-3);font-size:11px;line-height:1.45}
.group-mute-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:12px;color:var(--warn);background:rgba(255,184,77,.11)}
.group-mute-icon.is-danger{color:var(--bad);background:rgba(255,99,132,.12)}
.group-mute-icon svg{width:18px;height:18px}
.group-control-state{display:inline-flex;align-items:center;min-height:20px;padding:0 8px;border-radius:999px;background:color-mix(in srgb,var(--primary),transparent 88%);color:var(--primary);font-size:11px;font-style:normal;font-weight:760}
.group-mute-actions{display:flex;flex-wrap:wrap;gap:8px}
.group-mute-actions button,.danger-soft-button{min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink-2)}
.group-mute-actions button:hover{border-color:rgba(91,157,255,.34);color:var(--ink)}
.group-mute-actions button.is-permission-blocked,.group-mute-inline button.is-permission-blocked,.governance-action.is-permission-blocked,button.is-permission-blocked,[role="button"].is-permission-blocked{cursor:not-allowed;opacity:.62}
.group-mute-actions button.is-permission-blocked:hover,.group-mute-inline button.is-permission-blocked:hover,.governance-action.is-permission-blocked:hover,button.is-permission-blocked:hover,[role="button"].is-permission-blocked:hover{transform:none;box-shadow:none}

.group-mute-list-body{min-width:0;min-height:0;display:flex;flex-direction:column;gap:12px;padding:14px 20px 18px;overflow:hidden}
.group-mute-list-body>.group-mute-list-error{flex:0 0 auto;max-height:56px;overflow:auto}
.group-mute-list-error,.group-mute-list-empty{margin:0;padding:10px 12px;border-radius:12px;background:color-mix(in srgb,var(--warn),transparent 88%);color:var(--ink-2);font-size:12px;line-height:1.55}
.group-mute-list-add,.group-mute-list-section,.group-mute-list-candidates,.group-mute-list-rows{display:grid;min-width:0}
.group-mute-list-add,.group-mute-list-section{min-height:0;gap:8px;grid-template-rows:auto minmax(0,1fr)}
.group-mute-list-add{flex:1.6 1 0}
.group-mute-list-section{flex:1 1 0}
.group-mute-list-candidates,.group-mute-list-rows{min-height:0;gap:8px;align-content:start;grid-auto-rows:max-content;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:2px}
.group-mute-list-candidates{grid-template-columns:repeat(2,minmax(0,1fr))}
.group-mute-list-candidates>.muted-note{grid-column:1/-1}
.group-mute-list-add label,.group-mute-list-footer label{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:7px;color:var(--ink-2);font-size:12px;font-weight:720}
.group-mute-list-add input,.group-mute-list-footer input{width:100%;min-height:38px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px}
.group-mute-list-candidate,.group-mute-list-row{width:100%;min-width:0;display:grid;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:14px;background:color-mix(in srgb,var(--raise),var(--surface) 26%)}
.group-mute-list-candidate{min-height:56px;grid-template-columns:34px minmax(0,1fr) auto;text-align:left;color:var(--ink);cursor:pointer;transition:border-color .16s var(--ease-out),background .16s var(--ease-out),transform .16s var(--ease-out)}
.group-mute-list-candidate:hover{border-color:rgba(91,157,255,.34);transform:translateY(-1px)}
.group-mute-list-candidate.is-selected{border-color:rgba(91,157,255,.45);background:color-mix(in srgb,var(--primary),transparent 88%)}
.group-mute-list-selection{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;max-height:48px;overflow:auto;padding:6px 10px;border:1px solid rgba(91,157,255,.28);border-radius:12px;background:color-mix(in srgb,var(--primary),transparent 90%)}
.group-mute-list-selection span,.group-mute-list-selection small{color:var(--ink-3);font-size:11px;line-height:1.35}
.group-mute-list-selection strong{min-width:0;color:var(--ink);font-size:13px;font-weight:760}
.group-mute-list-row{grid-template-columns:40px minmax(0,1fr) auto}
.group-mute-list-row.is-confirming{border-color:rgba(255,99,132,.32);background:color-mix(in srgb,var(--bad),transparent 91%)}
.group-mute-list-candidate>span:not(.avatar),.group-mute-list-row>div:not(.group-mute-list-row-actions){min-width:0;display:grid;gap:3px}
.group-mute-list-candidate b,.group-mute-list-row strong,.group-mute-list-toolbar strong{overflow:hidden;color:var(--ink);font-size:13px;font-weight:760;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-candidate small,.group-mute-list-row small{overflow:hidden;color:var(--ink-3);font-size:11px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-candidate i{display:inline-flex;align-items:center;justify-content:center;min-width:42px;min-height:28px;padding:0 9px;border:1px solid var(--line);border-radius:999px;color:var(--primary);font-size:11px;font-style:normal;font-weight:760;background:var(--surface)}
.group-mute-list-candidate.is-selected i{border-color:transparent;color:#fff;background:var(--grad)}
.group-mute-list-row em{color:var(--bad);font-size:11px;font-style:normal;line-height:1.45}
.group-mute-list-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.group-mute-list-row-actions button{min-height:32px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink-2);font-weight:720}
.group-mute-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px}
.group-mute-list-toolbar button,.group-mute-list-footer-actions button{min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--primary);font-weight:720}
.group-mute-list-footer .primary-button{min-height:40px;border:0;color:#fff;background:var(--grad)}

.danger-soft-button {
  border-color: rgba(255, 99, 132, .26);
  color: var(--bad);
}

.group-lifecycle-entry{min-height:58px;border-color:var(--line);border-radius:16px;background:var(--raise)}
.group-lifecycle-entry small{display:block;margin-top:3px;color:var(--ink-3);font-size:11px;line-height:1.45}
.group-lifecycle-entry button{min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--primary);font-weight:720}
.group-lifecycle-entry.is-owner-danger button{color:var(--ink-2)}
.group-lifecycle-entry.is-owner-danger:hover{border-color:rgba(255,99,132,.22)}
.group-lifecycle-actions{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid rgba(255,99,132,.28);border-radius:14px;background:color-mix(in srgb,var(--bad),transparent 92%)}
.group-lifecycle-actions small{display:block;margin-top:4px;color:var(--ink-3);font-size:12px}
.group-lifecycle-preview{display:grid;gap:8px;margin-top:12px}
.group-lifecycle-preview span{display:flex;gap:8px;padding:8px;border:1px solid var(--line);font-size:13px}

.group-owner-transfer-entry{cursor:pointer}
.group-owner-transfer-candidates{display:grid;gap:8px}
.group-owner-transfer-candidate{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer}
.group-owner-transfer-candidate:hover{border-color:color-mix(in srgb,var(--primary),var(--line) 60%)}
.group-owner-transfer-candidate:has(input:checked){border-color:var(--primary);background:color-mix(in srgb,var(--primary),transparent 90%)}
.group-owner-transfer-candidate input[type="radio"]{width:18px;height:18px;min-height:0;margin:0;padding:0;accent-color:var(--primary)}
.group-owner-transfer-candidate span{min-width:0;display:grid;gap:2px}
.group-owner-transfer-candidate strong{overflow:hidden;color:var(--ink);font-size:14px;text-overflow:ellipsis;white-space:nowrap}
.group-owner-transfer-candidate small{overflow:hidden;color:var(--ink-3);font-size:12px;text-overflow:ellipsis;white-space:nowrap}

.group-mute-inline{min-width:0;display:inline-flex;align-items:center;justify-content:flex-end;gap:10px}
.group-mute-inline>span{min-width:0;text-align:right}
.group-mute-inline button{flex:0 0 auto;min-height:30px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--primary)}
.group-mute-inline.is-readonly{opacity:.82}

@media (max-width: 720px) {
  .group-governance-action-grid,
  .group-manage-setting-grid {
    grid-template-columns: 1fr;
  }
  .group-settings-section-head,.group-lifecycle-actions {
    display:grid;
    grid-template-columns:1fr;
    align-items:start;
  }
  .group-settings-section-head small {
    max-width:none;
    text-align:left;
  }
}

.group-nickname-entry small{display:block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-nickname-modal{width:min(460px,calc(100vw - 28px))}
.group-nickname-editor{display:grid;gap:10px;padding:20px}
.group-nickname-editor label{display:grid;gap:8px;color:var(--ink-2);font-size:12px;font-weight:700}
.group-nickname-editor input{width:100%;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);padding:11px 12px;font:inherit;outline:none}
.group-nickname-editor input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent)}
.group-nickname-editor-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;color:var(--ink-3);font-size:11px}
.group-nickname-editor-meta span{flex:0 0 auto;font-variant-numeric:tabular-nums}

.group-mute-modal{width:min(430px,calc(100vw - 32px));border-radius:24px;box-shadow:0 28px 78px rgba(0,0,0,.32)}
.group-mute-list-layer{padding:16px}
.modal-card.group-mute-list-modal{width:min(720px,100%);min-width:0;grid-template-columns:minmax(0,1fr);height:min(800px,calc(100vh - 32px));height:min(800px,calc(100dvh - 32px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
.group-mute-list-modal>header>div{min-width:0;overflow:hidden}
.group-mute-list-modal>header p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-modal>header>.icon-action{flex-shrink:0}
.group-mute-list-footer{flex:none;min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding-top:10px;border-top:1px solid var(--line)}
.group-mute-list-footer-actions{display:flex;justify-content:flex-end;gap:8px}
.group-mute-list-footer-actions button{min-width:64px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-mute-list-footer-actions .primary-button{min-width:0;flex:1}
.group-mute-list-candidate>.avatar{width:34px;height:34px;min-width:34px}
.group-mute-list-row>.avatar{width:40px;height:40px;min-width:40px}
.group-mute-list-modal .identity-display-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:540px){
  .group-mute-list-candidates{grid-template-columns:minmax(0,1fr)}
  .group-mute-list-body{padding:10px 12px 12px;gap:8px}
}
@media (max-height:600px){
  .group-mute-list-layer{padding:8px}
  .modal-card.group-mute-list-modal{height:calc(100vh - 16px);height:calc(100dvh - 16px);max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
  .group-mute-list-modal>header{padding:10px 14px}
  .group-mute-list-body{padding:8px 12px;gap:6px}
  .group-mute-list-add,.group-mute-list-section,.group-mute-list-footer{gap:5px}
  .group-mute-list-footer{padding-top:6px}
  .group-mute-list-selection{padding:3px 8px}
  .group-mute-list-add input,.group-mute-list-footer input{min-height:32px}
  .group-mute-list-footer .primary-button{min-height:34px}
}

@media (max-height:480px){
  .group-mute-list-modal>header{padding:6px 12px}
  .group-mute-list-add label,.group-mute-list-footer label{grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px}
}
@media (max-height:480px) and (min-width:541px){
  .group-mute-list-footer{grid-template-columns:minmax(0,1fr) minmax(180px,.8fr);align-items:center}
  .group-mute-list-selection{grid-column:1/-1}
}
@media (max-width:480px){
  .group-mute-list-row{grid-template-columns:40px minmax(0,1fr)}
  .group-mute-list-row>.group-mute-list-row-actions,.group-mute-list-row>.danger-soft-button{grid-column:2/-1;justify-self:end}
}
.group-mute-modal .group-mute-head{align-items:flex-start;padding:20px 22px 14px;border-bottom:0}
.group-mute-title{min-width:0;display:flex;align-items:center;gap:12px}
.group-mute-title-icon{width:42px;height:42px;flex:none;display:grid;place-items:center;border-radius:15px;color:#fff;background:var(--grad);box-shadow:0 14px 28px color-mix(in srgb,var(--primary),transparent 72%)}
.group-mute-title-icon svg{width:20px;height:20px}
.group-mute-title h2{color:var(--ink);font-size:18px;font-weight:760;letter-spacing:0}
.group-mute-title p{color:var(--ink-2);font-size:12px;line-height:1.45}
.group-mute-form{display:grid;gap:12px;padding:0 22px 14px}
.group-mute-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.group-mute-mode-card{min-width:0;min-height:112px;display:grid;grid-template-columns:32px minmax(0,1fr);align-content:start;gap:10px;padding:14px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface-soft),var(--surface) 55%);color:var(--ink);text-align:left;transition:border-color .16s var(--ease-out),background .16s var(--ease-out),transform .16s var(--ease-out)}
.group-mute-mode-card:hover{border-color:color-mix(in srgb,var(--primary),transparent 54%);transform:translateY(-1px)}
.group-mute-mode-card:focus{outline:2px solid color-mix(in srgb,var(--primary),transparent 42%);outline-offset:2px}
.group-mute-mode-card.is-selected{border-color:color-mix(in srgb,var(--primary),transparent 30%);background:color-mix(in srgb,var(--primary),transparent 90%);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary),transparent 72%)}
.group-mute-mode-card:disabled{cursor:wait;opacity:.7;transform:none}
.group-mute-mode-card>span:last-child{min-width:0}
.group-mute-mode-card b{display:block;color:var(--ink);font-size:13px;font-weight:780}
.group-mute-mode-card small{display:block;margin-top:5px;color:var(--ink-3);font-size:11px;line-height:1.5}
.group-mute-mode-mark{width:32px;height:32px;display:grid;place-items:center;border-radius:11px;background:color-mix(in srgb,var(--primary),transparent 88%);color:var(--primary)}
.group-mute-mode-mark svg{width:16px;height:16px}
.group-mute-card{overflow:hidden;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--surface-soft),var(--surface) 55%)}
.group-mute-toggle-row,.group-mute-time-row{min-height:56px;display:grid;align-items:center;gap:12px;padding:0 14px;border-bottom:1px solid var(--line)}
.group-mute-toggle-row{grid-template-columns:minmax(0,1fr) auto}
.group-mute-time-row{grid-template-columns:minmax(0,1fr) auto auto;color:var(--ink);font-size:13px;font-weight:720}
.group-mute-time-row:last-child{border-bottom:0}
.group-mute-toggle-row b{display:block;color:var(--ink);font-size:13px;font-weight:760}
.group-mute-toggle-row small{display:block;margin-top:3px;color:var(--ink-3);font-size:11px;line-height:1.45}
.group-mute-time-row input{width:82px;min-height:34px;padding:0 10px;border:0;border-radius:999px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;font-weight:720;text-align:center;color-scheme:dark}
.group-mute-time-row input:focus{outline:2px solid color-mix(in srgb,var(--primary),transparent 58%);outline-offset:2px}
.group-mute-timezone{margin:0;display:grid;gap:2px;color:var(--ink-3);font-size:11px;line-height:1.55}
.group-mute-timezone b{color:var(--ink-2);font-size:12px;font-variant-numeric:tabular-nums}
.next-day-pill{min-width:34px;display:inline-flex;align-items:center;justify-content:center;padding:4px 7px;border-radius:999px;background:color-mix(in srgb,var(--warn),transparent 86%);color:var(--warn);font-size:11px;font-weight:760}
.next-day-pill.is-hidden{display:none}
.group-mute-note{display:grid;gap:7px;padding:10px 12px;border-radius:14px;background:color-mix(in srgb,var(--surface-soft),var(--surface) 58%)}
.group-mute-note p{margin:0;display:grid;grid-template-columns:16px minmax(0,1fr);align-items:start;gap:7px;color:var(--ink-3);font-size:11px;line-height:1.55}
.group-mute-note svg{width:14px;height:14px;margin-top:1px;color:var(--ink-3)}
.group-mute-warning,.group-mute-error{margin:0;padding:10px 12px;border-radius:12px;font-size:12px;line-height:1.55}
.group-mute-warning{display:grid;grid-template-columns:16px minmax(0,1fr);gap:7px;background:color-mix(in srgb,var(--warn),transparent 88%);color:var(--warn)}
.group-mute-warning svg{width:14px;height:14px;margin-top:2px}
.group-mute-error{background:color-mix(in srgb,var(--bad),transparent 90%);color:var(--bad)}
.group-mute-confirm-copy{display:grid;gap:6px;padding:14px;border:1px solid color-mix(in srgb,var(--bad),transparent 72%);border-radius:15px;background:color-mix(in srgb,var(--bad),transparent 92%)}
.group-mute-confirm-copy strong{color:var(--ink);font-size:14px}
.group-mute-confirm-copy p{margin:0;color:var(--ink-2);font-size:12px;line-height:1.6}
.group-mute-title-icon.is-danger{background:linear-gradient(135deg,var(--bad),color-mix(in srgb,var(--bad),#7828ff 34%))}
.group-mute-modal footer{display:block;padding:0 22px 22px;border-top:0}
.group-mute-modal footer .primary-button{width:100%;min-height:44px;border-radius:14px;font-size:14px;font-weight:760}
.group-mute-modal footer.group-mute-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.group-mute-confirm-actions button{min-height:44px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink-2);font-weight:760}
.group-mute-confirm-actions .danger-button{border-color:color-mix(in srgb,var(--bad),transparent 60%);background:color-mix(in srgb,var(--bad),transparent 88%);color:var(--bad)}
.composer-panel.is-muted-blocked{border-color:rgba(255,184,77,.32);background:linear-gradient(180deg,rgba(255,184,77,.055),rgba(255,255,255,.02)),var(--surface)}
.composer-panel.is-muted-allowed{border-color:rgba(62,210,166,.22)}
.mute-locked-banner{display:flex;align-items:flex-start;gap:10px;margin:10px 12px 0;padding:10px 12px;border:1px solid rgba(255,184,77,.24);border-radius:14px;color:var(--ink);background:rgba(255,184,77,.075);font-size:12px;font-weight:650}
.mute-locked-banner svg{width:16px;height:16px;flex:0 0 auto;margin-top:2px;color:var(--warn)}
.mute-locked-banner span{display:flex;flex-direction:column;flex:1;min-width:0;gap:2px}
.mute-locked-banner b{color:var(--ink);font-size:13px;line-height:1.35}
.mute-locked-banner small{color:var(--ink-3);font-size:12px;font-weight:600;line-height:1.45}
.mute-locked-banner button{min-height:30px;padding:0 11px;border:1px solid rgba(255,184,77,.24);border-radius:999px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700}
.composer-panel.is-muted-blocked .composer-input-row{background:rgba(255,184,77,.035)}
.composer-panel.is-muted-blocked .composer-input textarea:disabled{color:var(--ink-3);-webkit-text-fill-color:var(--ink-3)}
.composer-panel.is-muted-blocked .send-button:disabled{opacity:.62;filter:saturate(.78)}
.composer-panel.is-muted-allowed .composer-hint>span:first-child{color:var(--good)}
.composer-tool.is-disabled,.composer-tool:disabled,.send-button:disabled,.composer-input textarea:disabled{cursor:not-allowed;opacity:.54}
body[data-theme="aurora"] .mute-strip,body[data-theme="aurora"] .group-mute-control.is-active{border-color:rgba(193,112,0,.22);background:linear-gradient(135deg,rgba(255,219,159,.64),rgba(255,238,221,.72)),#fff}
body[data-theme="aurora"] .group-mute-form input{color-scheme:light}
body[data-theme="aurora"] .group-mute-modal{box-shadow:0 26px 68px rgba(95,111,146,.22)}
body[data-theme="aurora"] .group-mute-card{background:#fff;border-color:rgba(20,30,55,.08)}
body[data-theme="aurora"] .group-mute-time-row input{background:#f4f6fb;color:#172033}
body[data-theme="aurora"] .group-mute-note{background:#f5f7f2}
body[data-theme="aurora"] .group-mute-mode-card{background:#fff}
body[data-theme="aurora"] .group-mute-mode-card.is-selected{background:#f0f5ff}

@media (max-width:560px){
  .group-mute-modal{width:min(100vw - 20px,430px)}
  .group-mute-mode-grid{grid-template-columns:1fr}
  .group-mute-mode-card{min-height:88px}
  .group-mute-modal .group-mute-head{padding:18px 16px 12px}
  .group-mute-form{padding:0 16px 12px}
  .group-mute-modal footer{padding:0 16px 18px}
}
body[data-theme="aurora"] .next-day-pill{background:#fff1d9;color:#d58a0a}
body[data-theme="aurora"] .mute-locked-banner{border-color:rgba(193,112,0,.18);background:rgba(255,236,200,.78);color:#172033}
body[data-theme="aurora"] .composer-panel.is-muted-blocked{border-color:rgba(193,112,0,.22);background:linear-gradient(180deg,rgba(255,218,154,.28),rgba(255,255,255,.78)),var(--surface)}
body[data-theme="aurora"] .composer-panel.is-muted-blocked .composer-input-row{background:rgba(255,247,232,.92)}
body[data-theme="aurora"] .group-mute-icon{background:#fff8ea}
.muted-note{margin:0;color:var(--ink-3);font-size:12px;line-height:1.7}

.join-request-card{gap:12px}
.join-request-list{display:grid;gap:10px}
.join-request-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--surface-soft)}
.join-request-row strong,.join-request-row small,.join-request-row em{display:block}
.join-request-row small,.join-request-row em{color:var(--ink-3);font-size:12px;font-style:normal;line-height:1.5}
.join-request-row>div{display:flex;gap:8px}
.frow .is-disabled-like{opacity:.66}
body[data-theme="aurora"] .join-request-row{background:#fff}

.contact-profile-workspace .page-scroll{padding:clamp(22px,3.2vw,42px);background:linear-gradient(180deg,color-mix(in srgb,var(--surface),transparent 80%),transparent 48%),transparent}
.contact-profile-stack{width:min(1080px,100%);margin:0 auto}
.contact-profile-card{position:relative;display:grid;grid-template-columns:minmax(260px,.72fr) minmax(420px,1fr);gap:0;padding:0;overflow:hidden;border-radius:18px;background:linear-gradient(180deg,color-mix(in srgb,var(--surface),transparent 4%),color-mix(in srgb,var(--surface),var(--bg) 10%));box-shadow:0 18px 54px color-mix(in srgb,#000,transparent 88%),inset 0 1px 0 color-mix(in srgb,#fff,transparent 92%)}

.contact-profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--ok));
}

.contact-profile-identity {
  min-width: 0;
  padding: clamp(24px, 3vw, 34px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(220px 150px at 18% 10%, color-mix(in srgb, var(--primary), transparent 84%), transparent 72%),
    color-mix(in srgb, var(--surface-soft), transparent 18%);
}

.contact-profile-large {
  grid-template-columns: 68px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  text-align: left;
  gap: 14px 16px;
  padding: 0;
}

.contact-profile-large .avatar-xl {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  font-size: 25px;
  box-shadow:
    0 14px 32px color-mix(in srgb, var(--primary), transparent 78%),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}

.contact-profile-large h2 {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.12;
  font-weight: 780;
}

.contact-profile-large p {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 13px;
}

.contact-profile-large .status-pill {
  grid-column: 2;
  justify-self: start;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  background: color-mix(in srgb, var(--ok), transparent 88%);
  box-shadow: none;
}

.contact-profile-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: clamp(24px, 3vw, 34px);
}

.contact-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), transparent 30%);
}

.contact-info-grid > span {
  min-height: 74px;
  padding: 14px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.contact-info-grid > span:nth-child(2n) {
  border-right: 0;
}

.contact-info-grid > span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.contact-info-grid small {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 760;
}

.contact-info-grid strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
}

.contact-profile-card .user-action-panel {
  margin-top: 0;
  gap: 10px;
}

.contact-profile-card .user-action-grid {
  gap: 10px;
}

.contact-profile-card .user-action-grid.is-profile-primary,
.contact-profile-card .user-action-grid.is-primary {
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(112px, .72fr));
}

.contact-profile-card .user-action-grid.is-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-profile-card .user-action {
  min-height: 42px;
  border-radius: 12px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface), var(--bg) 8%);
  box-shadow: none;
  color: var(--ink);
}

.contact-profile-card .user-action:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--primary), transparent 88%);
}

.contact-profile-card .user-action.is-main {
  border-color: color-mix(in srgb, var(--primary), transparent 35%);
  background: color-mix(in srgb, var(--primary), #213255 12%);
  color: #fff;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary), transparent 78%);
}

.contact-profile-card .user-action.is-danger {
  background: color-mix(in srgb, var(--danger), transparent 94%);
}

.contact-profile-workspace .workspace-topbar {
  box-shadow: inset 0 -1px 0 var(--line);
}

.side-panel .plain-row.is-active {
  border-color: color-mix(in srgb, var(--primary), transparent 62%);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary), transparent 82%), transparent 72%),
    color-mix(in srgb, var(--surface), transparent 12%);
  box-shadow:
    inset 3px 0 0 var(--primary),
    0 10px 28px color-mix(in srgb, var(--primary), transparent 90%);
}

body[data-theme="aurora"] .contact-profile-workspace .page-scroll {
  background: linear-gradient(180deg, #f8faff 0%, #f3f6fb 100%);
}

body[data-theme="aurora"] .contact-profile-card {
  border-color: #dfe6f2;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow:
    0 24px 70px rgba(40, 52, 86, .12),
    inset 0 1px 0 rgba(255, 255, 255, .85);
}

body[data-theme="aurora"] .contact-profile-identity {
  background:
    radial-gradient(240px 150px at 20% 0%, rgba(79, 140, 255, .13), transparent 74%),
    #f8fbff;
}

body[data-theme="aurora"] .contact-info-grid {
  background: #fff;
}

body[data-theme="aurora"] .contact-profile-card .user-action {
  background: #f8faff;
}

body[data-theme="aurora"] .contact-profile-card .user-action.is-main {
  border-color: transparent;
  background: #315fd6;
  color: #fff;
}

body[data-theme="aurora"] .contact-profile-card .user-action.is-danger {
  background: #fff4f6;
}

body[data-theme="aurora"] .side-panel .plain-row.is-active {
  background:
    linear-gradient(90deg, rgba(79, 140, 255, .14), rgba(79, 140, 255, .02) 72%),
    #fff;
  border-color: rgba(79, 140, 255, .32);
  box-shadow:
    inset 3px 0 0 #4f8cff,
    0 12px 30px rgba(35, 48, 82, .08);
}

body[data-theme="midnight"] .contact-profile-card {
  border-color: rgba(148, 163, 184, .14);
  background: linear-gradient(180deg, rgba(17, 24, 39, .96), rgba(11, 16, 28, .98));
  box-shadow:
    0 26px 72px rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

body[data-theme="midnight"] .contact-profile-identity {
  background:
    radial-gradient(240px 150px at 20% 0%, rgba(91, 157, 255, .15), transparent 74%),
    rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .contact-info-grid {
  background: rgba(255, 255, 255, .025);
}

body[data-theme="midnight"] .contact-profile-card .user-action {
  background: rgba(255, 255, 255, .035);
}

@media (max-width: 1180px) {
  .contact-profile-card {
    grid-template-columns: 1fr;
  }

  .contact-profile-identity {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .contact-profile-workspace .page-scroll {
    padding: 14px;
  }

  .contact-profile-identity,
  .contact-profile-body {
    padding: 18px;
  }

  .contact-info-grid {
    grid-template-columns: 1fr;
  }

  .contact-info-grid > span,
  .contact-info-grid > span:nth-child(2n),
  .contact-info-grid > span:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .contact-info-grid > span:last-child {
    border-bottom: 0;
  }

  .contact-profile-card .user-action-grid.is-profile-primary,
  .contact-profile-card .user-action-grid.is-primary,
  .contact-profile-card .user-action-grid.is-secondary {
    grid-template-columns: 1fr;
  }

  .contact-profile-card .user-action,
  .contact-profile-card .user-action:hover,
  .contact-profile-card .user-action.is-main {
    box-shadow: none;
  }
}

.contact-profile-workspace .page-scroll {
  padding: clamp(24px, 3.4vw, 46px);
}

.contact-profile-stack {
  width: min(1120px, 100%);
}

.contact-profile-card {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
  align-items: stretch;
  padding: clamp(20px, 2.5vw, 28px);
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 10%);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(420px 280px at 8% 6%, color-mix(in srgb, var(--primary), transparent 88%), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface), transparent 2%), color-mix(in srgb, var(--surface), var(--bg) 8%));
  box-shadow:
    0 22px 60px color-mix(in srgb, #000, transparent 88%),
    inset 0 1px 0 color-mix(in srgb, #fff, transparent 92%);
}

.contact-profile-card::before {
  width: 3px;
  top: 24px;
  right: auto;
  bottom: 24px;
  left: 0;
  border-radius: 999px;
  opacity: .9;
}

.contact-profile-hero {
  min-width: 0;
  min-height: 300px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid color-mix(in srgb, var(--line), transparent 10%);
  border-radius: 24px;
  background:
    radial-gradient(220px 150px at 50% 8%, color-mix(in srgb, var(--primary), transparent 80%), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), transparent 8%), color-mix(in srgb, var(--surface-soft), transparent 36%));
  text-align: center;
}

.contact-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

.contact-avatar-wrap .avatar-xl {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  font-size: 34px;
  box-shadow:
    0 18px 38px color-mix(in srgb, var(--primary), transparent 76%),
    inset 0 1px 0 rgba(255, 255, 255, .30);
}

.contact-presence {
  position: absolute;
  z-index: 2;
  /* Inset from the square bounds so the dot straddles the circular avatar. */
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border: 3px solid color-mix(in srgb, var(--surface-soft), var(--bg) 18%);
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .18);
}

.contact-presence[data-status="online"] {
  background: var(--ok);
}

.contact-profile-copy {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.contact-profile-kicker {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
}

.contact-profile-copy h2 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-profile-copy p {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-profile-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.contact-profile-chips .status-pill {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--ok), transparent 64%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok), transparent 88%);
  color: var(--ok);
  font-size: 12px;
  font-weight: 760;
}

.contact-profile-chips .status-pill[data-status="offline"] {
  border-color: color-mix(in srgb, var(--muted), transparent 58%);
  background: color-mix(in srgb, var(--muted), transparent 88%);
  color: var(--muted);
}

.contact-profile-chips .status-pill.is-soft {
  border-color: color-mix(in srgb, var(--primary), transparent 72%);
  background: color-mix(in srgb, var(--primary), transparent 90%);
  color: var(--primary);
}

.contact-profile-chips .status-pill.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 90%);
  color: var(--danger);
}

.contact-profile-body {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 0;
}

.contact-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-section-title strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
}

.contact-section-title button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--primary), transparent 90%);
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.contact-info-grid > span,
.contact-info-grid > span:nth-child(2n),
.contact-info-grid > span:nth-last-child(-n + 2) {
  min-height: 82px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 4%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft), transparent 24%);
}

.contact-info-grid small {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 760;
}

.contact-info-grid strong{overflow:visible;color:var(--ink);font-size:15px;font-weight:760;line-height:1.45;overflow-wrap:anywhere;text-overflow:clip;white-space:normal}
.contact-profile-card .user-action-panel{gap:12px;padding:14px;border:1px solid color-mix(in srgb,var(--line),transparent 10%);border-radius:20px;background:color-mix(in srgb,var(--surface-soft),transparent 30%)}
.contact-profile-card .user-action-grid{gap:10px}
.contact-profile-card .user-action-grid.is-primary{grid-template-columns:minmax(0,1.25fr) repeat(2,minmax(118px,.72fr));border:0;background:transparent;box-shadow:none;color:inherit}
.contact-profile-card .user-action-grid.is-contact-actions{grid-template-columns:repeat(2,minmax(0,1fr));border:0;background:transparent;box-shadow:none;color:inherit}
.contact-profile-card .user-action-grid.is-secondary{grid-template-columns:repeat(3,minmax(0,1fr))}

.contact-profile-card .user-action {
  min-height: 46px;
  border-radius: 15px;
  border-color: color-mix(in srgb, var(--line), var(--primary) 8%);
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 45%);
  color: var(--ink);
  font-size: 13px;
  box-shadow: none;
}

.contact-profile-card .user-action.is-main {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary), transparent 86%);
}

.contact-profile-card .user-action-grid.is-contact-actions .user-action {
  width: 100%;
}

.contact-profile-card .user-action-grid.is-contact-actions .user-action.is-main,
.contact-profile-card .user-action-grid.is-contact-actions .user-action[data-action="delete-friend"] {
  grid-column: auto;
}

.contact-profile-card .user-action-grid.is-primary .user-action:not(.is-main) {
  position: relative;
  z-index: 1;
}

.contact-profile-card .user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 72%);
  background: color-mix(in srgb, var(--danger), transparent 92%);
  color: var(--danger);
}

body[data-theme="aurora"] .contact-profile-card {
  border-color: #dce4f1;
  background:
    radial-gradient(420px 280px at 8% 6%, rgba(79, 140, 255, .12), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 24px 70px rgba(31, 45, 77, .10),
    inset 0 1px 0 rgba(255, 255, 255, .90);
}

body[data-theme="aurora"] .contact-profile-hero {
  border-color: #dfe7f4;
  background:
    radial-gradient(240px 160px at 50% 4%, rgba(79, 140, 255, .18), transparent 72%),
    linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%);
}

body[data-theme="aurora"] .contact-profile-kicker,
body[data-theme="aurora"] .contact-info-grid small {
  color: #8190ad;
}

body[data-theme="aurora"] .contact-info-grid > span,
body[data-theme="aurora"] .contact-info-grid > span:nth-child(2n),
body[data-theme="aurora"] .contact-info-grid > span:nth-last-child(-n + 2),
body[data-theme="aurora"] .contact-profile-card .user-action-panel {
  border-color: #e1e7f0;
  background: #fff;
}

body[data-theme="aurora"] .contact-profile-card .user-action {
  border-color: #e0e6f0;
  background: #f8faff;
}

body[data-theme="aurora"] .contact-profile-card .user-action.is-main {
  background: linear-gradient(135deg, #4f8cff, #7567ff);
}

body[data-theme="midnight"] .contact-profile-card {
  border-color: rgba(148, 163, 184, .16);
  background:
    radial-gradient(420px 280px at 8% 6%, rgba(91, 157, 255, .12), transparent 70%),
    linear-gradient(180deg, rgba(17, 24, 39, .97), rgba(10, 15, 27, .98));
  box-shadow:
    0 28px 72px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

body[data-theme="midnight"] .contact-profile-hero,
body[data-theme="midnight"] .contact-info-grid > span,
body[data-theme="midnight"] .contact-info-grid > span:nth-child(2n),
body[data-theme="midnight"] .contact-info-grid > span:nth-last-child(-n + 2),
body[data-theme="midnight"] .contact-profile-card .user-action-panel {
  border-color: rgba(148, 163, 184, .13);
  background: rgba(255, 255, 255, .035);
}

body[data-theme="midnight"] .contact-profile-card .user-action {
  border-color: rgba(148, 163, 184, .12);
  background: rgba(255, 255, 255, .045);
}

@media (max-width: 1180px) {
  .contact-profile-card {
    grid-template-columns: 1fr;
  }

  .contact-profile-hero{min-height:auto;grid-template-columns:auto minmax(0,1fr);justify-items:start;text-align:left}
  .contact-profile-copy{justify-items:start}
  .contact-profile-chips{justify-content:flex-start}
}

@media (max-width: 760px) {
  .contact-profile-card{padding:14px;border-radius:22px}
  .contact-profile-hero{grid-template-columns:1fr;justify-items:center;text-align:center}
  .contact-profile-copy{justify-items:center}
  .contact-profile-chips{justify-content:center}

  .contact-info-grid,
  .contact-profile-card .user-action-grid.is-contact-actions,
  .contact-profile-card .user-action-grid.is-primary,
  .contact-profile-card .user-action-grid.is-secondary {
    grid-template-columns: 1fr;
  }

  .contact-section-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

.composer-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.composer-tool.is-unavailable,
.composer-tool.is-disabled,
.composer-tool:disabled {
  color: var(--ink-3);
  opacity: .42;
  cursor: not-allowed;
}

.composer-tool.is-unavailable:hover,
.composer-tool.is-disabled:hover,
.composer-tool:disabled:hover {
  color: var(--ink-3);
  background: transparent;
  transform: none;
}

.composer-tool.is-pending::after,
.composer-tool.is-unavailable::after,
.tool-button.is-pending::after {
  display: none;
  content: none;
}

.attachment-thumb {
  width: 42px;
  min-width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.modal-preview.is-image-preview {
  padding: 14px;
  border-style: solid;
}

.modal-preview.is-original-preview img {
  max-width: min(78vw, 960px);
  max-height: 68vh;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(var(--media-zoom, 1));
  transform-origin: center;
}

.modal-preview.is-video-preview video {
  width: min(78vw, 860px);
  max-height: 62vh;
  display: block;
  border-radius: 12px;
  background: #000;
}

.modal-preview.is-document-preview {
  width: min(82vw, 920px);
  height: min(68vh, 720px);
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #101522;
}

.modal-preview.is-document-preview iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.modal-preview.is-audio-preview {
  width: min(520px, 82vw);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px;
}

.modal-preview.is-audio-preview audio {
  width: 100%;
}

.media-viewer-layer {
  background: rgba(4, 7, 14, .82);
  backdrop-filter: blur(14px);
}

.media-viewer-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(11, 15, 26, .76);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .38);
  color: #fff;
}

.media-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-viewer-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.media-viewer-head strong {
  font-size: 13px;
}

.media-viewer-head span {
  max-width: min(560px, 58vw);
  overflow: hidden;
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-close,
.media-viewer-tools button,
.media-viewer-nav {
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.media-viewer-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.media-viewer-stage {
  position: relative;
  min-height: min(62vh, 560px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    #050812;
  background-size: 18px 18px;
}

.media-viewer-frame {
  max-width: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
}

.media-viewer-frame img {
  max-width: min(92vw, 980px);
  max-height: 70vh;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  transform: scale(var(--media-zoom, 1));
  transform-origin: center;
}

.user-avatar-preview-modal {
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  padding-top: max(14px, env(safe-area-inset-top));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  padding-left: max(14px, env(safe-area-inset-left));
}

.user-avatar-preview-stage {
  min-height: min(68vh, 680px);
}

.user-avatar-preview-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: min(68vh, 680px);
}

.user-avatar-preview-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.user-avatar-preview-frame img:not(.is-avatar-broken) + .user-avatar-preview-fallback {
  display: none;
}

.user-avatar-preview-fallback {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  min-width: 0;
  min-height: 0;
}

.media-viewer-frame video {
  width: min(92vw, 960px);
  max-height: 70vh;
  display: block;
  border-radius: 12px;
  background: #000;
}

.media-viewer-placeholder {
  min-width: min(420px, 72vw);
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 14px;
  color: rgba(255, 255, 255, .72);
}

.media-viewer-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
}

.media-viewer-nav svg {
  width: 24px;
  height: 24px;
}

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

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

.media-viewer-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.media-viewer-tools button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .media-viewer-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 10px;
    border-radius: 14px;
  }

  .media-viewer-stage {
    min-height: 54vh;
  }

  .media-viewer-nav {
    width: 38px;
    height: 38px;
  }

  .user-avatar-preview-stage,
  .user-avatar-preview-frame {
    min-height: 58vh;
  }
}

.file-transfer-progress.is-modal {
  width: min(420px, 72vw);
}

.composer-transfer-list {
  display: grid;
  gap: 8px;
  padding: 8px 12px 0;
}

.composer-transfer-item {
  display: grid;
  grid-template-columns: minmax(96px, 160px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.composer-transfer-item strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-transfer-item.is-failed .file-transfer-progress i {
  width: 100% !important;
  background: color-mix(in srgb, var(--danger), transparent 88%);
}

.composer-transfer-item.is-failed {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 44%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger), var(--surface) 90%);
}

.composer-transfer-item.is-failed strong {
  line-height: 26px;
}

.composer-transfer-item.is-failed .file-transfer-progress {
  grid-column: 1 / -1;
  height: auto;
  min-height: 30px;
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--danger), transparent 72%);
  background: color-mix(in srgb, var(--surface), var(--danger) 9%);
}

.composer-transfer-item.is-failed .file-transfer-progress em {
  padding: 6px 10px;
  color: color-mix(in srgb, var(--danger), var(--ink) 28%);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.45;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.file-transfer-actions {
  display: inline-flex;
  gap: 6px;
}

.file-transfer-actions button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
}

.attachment-confirm-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 8px 16px 4px;
}

.attachment-confirm-body.is-multiple {
  gap: 12px;
}

.attachment-confirm-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-confirm-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.attachment-confirm-list {
  max-height: min(48vh, 420px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.attachment-confirm-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 22%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 45%);
}

.attachment-confirm-row-preview {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
}

.attachment-confirm-row-preview img,
.attachment-confirm-row-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.attachment-confirm-row .attachment-confirm-placeholder {
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  font-size: 12px;
}

.attachment-confirm-row .attachment-confirm-meta {
  padding: 0;
}

.attachment-confirm-preview {
  position: relative;
  min-height: 280px;
  max-height: min(52vh, 480px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 12%);
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft), transparent 8%), color-mix(in srgb, var(--surface), transparent 2%)),
    var(--surface-soft);
}

.attachment-confirm-preview img,
.attachment-confirm-preview video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 480px);
  display: block;
  object-fit: contain;
}

.attachment-confirm-preview.is-image img {
  width: 100%;
  height: 100%;
}

.attachment-confirm-preview.is-video video {
  object-fit: contain;
  background: #050914;
}

.attachment-confirm-placeholder {
  min-width: 72px;
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: var(--brand);
  background: color-mix(in srgb, var(--primary), transparent 82%);
  font-weight: 800;
}

.attachment-confirm-placeholder svg {
  width: 32px;
  height: 32px;
}

.attachment-confirm-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.attachment-confirm-meta span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.attachment-confirm-meta strong {
  min-width: min(220px, 100%);
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-confirm-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: color-mix(in srgb, var(--muted), transparent 35%);
}

.attachment-confirm-modal footer {
  padding: 16px 18px 16px;
}

.chat-workspace.is-dragging-attachment .message-scroll {
  outline: 2px dashed color-mix(in srgb, var(--primary), transparent 28%);
  outline-offset: -14px;
  background: color-mix(in srgb, var(--primary), transparent 94%);
}

@media (max-width: 720px) {
  .attachment-confirm-body {
    padding: 8px 10px 4px;
  }

  .attachment-confirm-preview {
    min-height: 210px;
    max-height: 42vh;
  }

  .composer-transfer-item {
    grid-template-columns: 1fr;
  }
}

.modal-preview.is-image-preview img {
  width: min(100%, 620px);
  max-height: 420px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--surface-soft);
}

.bubble.is-contact-card-bubble,
.message-row.is-me .bubble.is-contact-card-bubble {
  width: min(336px, 100%);
  max-width: min(336px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.contact-card-attachment {
  width: 100%;
  min-width: min(286px, 100%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line), var(--primary) 18%);
  border-radius: 18px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface-soft), var(--primary) 8%),
      color-mix(in srgb, var(--surface), var(--primary) 4%));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.contact-card-attachment:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface-soft), var(--primary) 14%),
      color-mix(in srgb, var(--surface), var(--primary) 8%));
}

.contact-card-attachment .avatar,
.contact-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

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

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

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

.contact-card-attachment strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
}

.contact-card-attachment em {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft), transparent 12%);
  color: var(--brand);
  font-size: 11px;
  line-height: 1.4;
  font-style: normal;
  font-weight: 760;
}

.contact-card-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft), transparent 20%);
  font-size: 20px;
  line-height: 1;
}

.contact-card-modal {
  width: min(480px, calc(100vw - 28px));
}

.contact-card-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 14px 16px 10px;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink-3);
}

.contact-card-search svg {
  width: 18px;
  height: 18px;
}

.contact-card-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.contact-card-picker {
  max-height: min(420px, 56vh);
  overflow: auto;
  padding: 0 10px 14px;
}

.contact-card-option {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  border-radius: 14px;
}

.contact-card-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.forward-modal {
  width: min(500px, calc(100vw - 28px));
}

.forward-source {
  margin: 14px 16px 0;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), var(--accent) 6%);
}

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

.forward-source strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forward-target-search {
  margin-top: 10px;
}

.forward-target-list {
  max-height: min(420px, 48vh);
}

.forward-modal-error {
  margin: 0 16px 8px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.message-report-modal {
  width: min(520px, calc(100vw - 28px));
}

.message-report-sender {
  margin: 14px 16px 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.message-report-sender span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

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

.message-report-sender small {
  color: var(--muted);
  font-size: 12px;
}

.message-report-source strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.message-report-form {
  padding: 12px 16px 0;
  display: grid;
  gap: 12px;
}

.message-report-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.message-report-reasons button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  background: var(--surface-soft);
}

.message-report-reasons button.is-active {
  border-color: color-mix(in srgb, var(--danger), transparent 35%);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 90%);
}

.message-report-description {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.message-report-description textarea {
  min-height: 104px;
  resize: vertical;
  border-radius: 12px;
}

.tool-card.is-disabled {
  opacity: .58;
}

.tool-card button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

body[data-theme="aurora"] .composer-tool.is-unavailable,
body[data-theme="aurora"] .composer-tool.is-disabled,
body[data-theme="aurora"] .composer-tool:disabled {
  color: #9aa7bd;
  opacity: .55;
}

body[data-theme="aurora"] .attachment-thumb,
body[data-theme="aurora"] .contact-card-search {
  border-color: rgba(20, 30, 55, .1);
  background: #f7f9fd;
}

body[data-theme="aurora"] .bubble.is-contact-card-bubble {
  background: transparent;
  box-shadow: none;
}

body[data-theme="aurora"] .contact-card-attachment {
  border-color: rgba(85, 126, 214, .24);
  background: linear-gradient(135deg, #ffffff, #f5f8ff);
}

body[data-theme="aurora"] .contact-card-attachment:hover {
  border-color: rgba(73, 117, 238, .44);
  background: linear-gradient(135deg, #f7faff, #eef4ff);
}

body[data-theme="aurora"] .contact-card-arrow {
  background: rgba(87, 124, 235, .08);
  color: #64708a;
}

.signed-out-workspace {
  min-width: 0;
}

.signed-out-main {
  min-height: 0;
  height: 100%;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(520px 320px at 50% 16%, color-mix(in srgb, var(--primary), transparent 84%), transparent 70%),
    var(--bg);
}

.signed-out-card {
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface), transparent 3%);
  box-shadow: var(--shadow);
  text-align: center;
}

.signed-out-card-icon,
.signed-out-mini-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
}

.signed-out-card-icon {
  width: 62px;
  height: 62px;
}

.signed-out-card-icon svg {
  width: 30px;
  height: 30px;
}

.signed-out-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.signed-out-card h2,
.signed-out-side-body h2 {
  margin: 0;
  color: var(--ink);
}

.signed-out-card p,
.signed-out-side-body p,
.signed-out-modal-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.signed-out-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.signed-out-actions button,
.signed-out-side-body button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 760;
}

.signed-out-facts {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.signed-out-facts span {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.signed-out-facts b,
.signed-out-facts em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.signed-out-facts b {
  color: var(--ink);
  font-size: 12px;
}

.signed-out-facts em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.signed-out-side-panel {
  padding: 14px;
  gap: 14px;
}

.signed-out-summary,
.signed-out-side-body {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.signed-out-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.signed-out-summary small,
.signed-out-summary p {
  display: block;
  margin: 0;
  color: var(--muted);
}

.signed-out-summary strong {
  display: block;
  margin: 2px 0;
  color: var(--ink);
}

.signed-out-avatar {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #58c4ff);
  color: #fff;
  font-weight: 900;
}

.signed-out-side-body {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 18px;
}

.signed-out-mini-icon {
  width: 44px;
  height: 44px;
}

.signed-out-mini-icon svg {
  width: 22px;
  height: 22px;
}

.signed-out-side-body .primary-button {
  width: 100%;
}

.signed-out-side-body button:not(.primary-button) {
  width: 100%;
}

.account-profile-card.is-signed-out {
  border-color: color-mix(in srgb, var(--warning, #f59e0b), var(--line) 58%);
  background: color-mix(in srgb, var(--warning, #f59e0b), transparent 92%);
}

.signed-out-modal-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.signed-out-modal-note span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

.signed-out-modal-note svg {
  width: 20px;
  height: 20px;
}

body[data-theme="midnight"] .signed-out-card,
body[data-theme="midnight"] .signed-out-summary,
body[data-theme="midnight"] .signed-out-side-body,
body[data-theme="midnight"] .signed-out-modal-note {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(148, 163, 184, .14);
}

body[data-theme="midnight"] .signed-out-facts span {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(148, 163, 184, .12);
}

body[data-theme="aurora"] .signed-out-card,
body[data-theme="aurora"] .signed-out-summary,
body[data-theme="aurora"] .signed-out-side-body,
body[data-theme="aurora"] .signed-out-modal-note {
  border-color: rgba(20, 30, 55, .1);
  background: #ffffff;
}

body[data-theme="aurora"] .signed-out-facts span {
  border-color: rgba(20, 30, 55, .08);
  background: #f7f9fd;
}

.login-screen {
  position: relative;
  isolation: isolate;
  overflow: auto;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background: linear-gradient(35deg, #e3f2fd 0%, #90caf9 48%, #64b5f6 100%);
  color: var(--ink);
  perspective: 1200px;
}

.login-screen::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(760px 480px at 22% 8%, rgba(255, 255, 255, .54), transparent 68%),
    radial-gradient(860px 560px at 92% 18%, rgba(2, 119, 189, .2), transparent 70%),
    radial-gradient(640px 420px at 70% 94%, rgba(3, 155, 229, .18), transparent 70%);
}

.login-screen::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 520px at 76% 0%, transparent 0%, rgba(227, 242, 253, .62) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(227, 242, 253, .7));
}

.login-particles {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .88;
}

.login-card { position: relative; z-index: 1; width: min(440px, 100%); display: grid; gap: 20px; padding: 26px; border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--surface), transparent 3%); transform: translateZ(0); transition: border-color 180ms cubic-bezier(.16, 1, .3, 1), background-color 180ms cubic-bezier(.16, 1, .3, 1); }

.login-card::before {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  left: 1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: .64;
  background:
    radial-gradient(360px 180px at 14% 0%, rgba(255, 255, 255, .34), transparent 66%),
    linear-gradient(135deg, rgba(255, 255, 255, .15), transparent 44%);
  transform: translateZ(1px);
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.login-card-title {
  display: grid;
  gap: 7px;
}

.login-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.login-card-title small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.login-card-title h1 {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-title-row .theme-quick-toggle {
  flex: 0 0 auto;
}

.login-card-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-page-form {
  gap: 14px;
}

.login-auth-tabs { display: flex; gap: 8px; }
.login-auth-tabs button { flex: 1; }
.login-auth-tabs button.is-active { color: var(--primary); }

.login-policy-note {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 66%);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--primary), transparent 92%);
  font-size: 13px;
  line-height: 1.45;
}

.login-policy-note.is-error {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 92%);
}

.login-submit { width: 100%; min-height: 48px; height: 48px; border-radius: 16px; font-size: 15px; font-weight: 760; display: inline-flex; align-items: center; justify-content: center; line-height: 1; margin-top: 12px; transform: none; transition: background .16s var(--ease-out), border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), filter .16s var(--ease-out), opacity .16s var(--ease-out); }

.login-submit:hover,
.login-submit:focus { background: var(--grad); color: #fff; transform: none; filter: brightness(1.03); box-shadow: 0 12px 26px rgba(79, 140, 255, .3); }

.login-submit:active { opacity: .92; transform: none; filter: brightness(.98); }

.login-source-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

body[data-theme="midnight"] .login-card {
  background: rgba(4, 13, 31, .78);
  border-color: rgba(0, 217, 255, .16);
}

body[data-theme="midnight"] .login-card::before {
  opacity: .5;
  background:
    radial-gradient(360px 180px at 16% 0%, rgba(0, 245, 255, .16), transparent 66%),
    linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 42%);
}

body[data-theme="midnight"] .login-screen {
  background: linear-gradient(35deg, #000814 0%, #003566 52%, #0077b6 100%);
}

body[data-theme="midnight"] .login-screen::before {
  background:
    radial-gradient(720px 440px at 18% 14%, rgba(0, 245, 255, .18), transparent 68%),
    radial-gradient(860px 560px at 88% 20%, rgba(0, 150, 199, .3), transparent 70%),
    radial-gradient(640px 420px at 68% 96%, rgba(96, 165, 250, .2), transparent 72%);
}

body[data-theme="midnight"] .login-screen::after {
  background:
    radial-gradient(760px 520px at 78% 0%, transparent 0%, rgba(0, 8, 20, .52) 72%),
    linear-gradient(180deg, rgba(0, 8, 20, .1), rgba(0, 8, 20, .72));
}

body[data-theme="midnight"] .login-particles {
  opacity: .96;
}

body[data-theme="aurora"] .login-card {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(20, 30, 55, .1);
}

body[data-theme="aurora"] .login-card::before {
  opacity: .58;
  background:
    radial-gradient(360px 180px at 14% 0%, rgba(255, 255, 255, .46), transparent 68%),
    linear-gradient(135deg, rgba(255, 255, 255, .2), transparent 44%);
}

body[data-theme="aurora"] .login-screen {
  background: linear-gradient(35deg, #e3f2fd 0%, #90caf9 48%, #64b5f6 100%);
}

body[data-theme="aurora"] .login-screen::after {
  background:
    radial-gradient(760px 520px at 78% 0%, transparent 0%, rgba(227, 242, 253, .66) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(227, 242, 253, .72));
}

body[data-theme="aurora"] .login-particles {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .login-particles {
    opacity: .62;
  }

  .login-card {
    transform: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .login-screen {
    align-items: start;
    padding: 16px;
  }

  .login-card {
    padding: 20px;
    border-radius: 22px;
  }

  .signed-out-main {
    align-items: start;
    padding: 16px;
  }

  .signed-out-card {
    border-radius: 20px;
  }

  .signed-out-facts {
    grid-template-columns: 1fr;
  }

  .signed-out-actions {
    width: 100%;
  }

  .signed-out-actions button {
    flex: 1 1 100%;
  }
}

.composer-tool.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary), transparent 58%);
}

.message-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  left: 16px;
  z-index: 130;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.message-search-bar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.message-search-input-control {
  min-width: 0;
  flex: 1 1 260px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink-2);
}

.message-search-input-control:focus-within {
  border-color: color-mix(in srgb, var(--primary), var(--line) 24%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 78%);
}

.message-search-bar svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.message-search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.message-search-bar input::placeholder {
  color: var(--ink-3);
}

.message-search-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-search-date-row {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 4px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 18%);
}

.message-search-date-shell {
  position: relative;
  min-width: 0;
}

.message-search-date-control {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  appearance: none;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft), #fff 4%), var(--surface-soft));
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.message-search-date-control:hover,
.message-search-date-control:focus-within {
  border-color: color-mix(in srgb, var(--primary), var(--line) 26%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 76%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 82%);
}

.message-search-date-control.is-filled {
  border-color: color-mix(in srgb, var(--primary), var(--line) 35%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft), var(--surface) 56%), var(--surface-soft));
}

.message-search-date-icon,
.message-search-date-caret {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-soft), transparent 18%);
  color: var(--primary);
}

.message-search-date-caret {
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--ink-3);
}

.message-search-date-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.message-search-date-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-search-date-copy span {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-search-date-native {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.message-search-date-native::-webkit-calendar-picker-indicator {
  opacity: 0;
}

.message-search-date-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.message-search-date-actions::-webkit-scrollbar {
  display: none;
}

.message-search-date-chip,
.message-search-date-jump,
.message-search-date-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.message-search-date-chip {
  cursor: pointer;
}

.message-search-date-chip:hover,
.message-search-date-chip:focus,
.message-search-date-chip.is-active {
  border-color: color-mix(in srgb, var(--primary), var(--line) 32%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%);
  color: var(--primary);
}

.message-search-date-chip.is-clear {
  color: var(--ink-3);
}

.message-search-date-chip.is-clear svg {
  width: 13px;
  height: 13px;
}

.message-search-date-jump {
  border-color: color-mix(in srgb, var(--primary), var(--line) 26%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary), transparent 90%), color-mix(in srgb, var(--primary-soft), var(--surface) 56%));
  color: var(--primary);
  cursor: pointer;
}

.message-search-date-jump:hover,
.message-search-date-jump:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary), transparent 86%);
}

.message-search-date-status {
  border-style: dashed;
  color: var(--ink-3);
}

.message-search-list {
  max-height: min(268px, 34vh);
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.message-search-result {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.message-search-result:hover,
.message-search-result:focus {
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 68%);
}

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

.message-search-copy em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
}

.message-search-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-search-copy mark {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, #ff5d6c, transparent 84%);
  color: #ff4d61;
}

.message-search-result time {
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.message-search-empty,
.message-search-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink-3);
  font-size: 12px;
}

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

.message-search-note {
  border-color: color-mix(in srgb, var(--warn), var(--line) 58%);
  color: var(--warn);
}

.global-search-results {
  display: grid;
  gap: 12px;
  padding: 10px;
}

.global-search-head,
.global-search-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.global-search-head span,
.global-search-section-head span,
.global-search-category-empty,
.global-search-note {
  color: var(--ink-3);
  font-size: 12px;
}

.global-search-note,
.global-search-empty,
.global-search-category-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.global-search-note.is-error {
  border-color: color-mix(in srgb, var(--danger), var(--line) 58%);
  color: var(--danger);
}

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

.global-search-list {
  display: grid;
  gap: 6px;
}

.global-search-result {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus {
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 68%);
}

.global-search-kind {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary), transparent 82%);
  color: var(--primary);
  font-size: 12px;
  font-weight: 760;
}

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

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

.global-search-copy small mark {
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, #ff5d6c, transparent 84%);
  color: #ff4d61;
}

body:not([data-theme="aurora"]) .message-search-panel {
  border-color: rgba(203, 213, 225, .16);
  background: #101624;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .42);
}

body:not([data-theme="aurora"]) .message-search-date-row {
  background: #141c2b;
}

body:not([data-theme="aurora"]) .message-search-input-control,
body:not([data-theme="aurora"]) .message-search-date-control,
body:not([data-theme="aurora"]) .message-search-date-chip,
body:not([data-theme="aurora"]) .message-search-date-status,
body:not([data-theme="aurora"]) .message-search-date-jump,
body:not([data-theme="aurora"]) .message-search-result,
body:not([data-theme="aurora"]) .message-search-empty,
body:not([data-theme="aurora"]) .message-search-note {
  border-color: rgba(203, 213, 225, .14);
  background: #182132;
}

body:not([data-theme="aurora"]) .message-search-date-control:hover,
body:not([data-theme="aurora"]) .message-search-date-control:focus-within {
  background: #1c2940;
}

body[data-theme="aurora"] .message-search-panel {
  background: #fff;
}

body[data-theme="aurora"] .composer-tool.is-active {
  color: #2f63ff;
  background: #eaf1ff;
  box-shadow: inset 0 0 0 1px #b9c9ff;
}

body[data-theme="aurora"] .message-search-input-control,
body[data-theme="aurora"] .message-search-date-control,
body[data-theme="aurora"] .message-search-date-chip,
body[data-theme="aurora"] .message-search-date-status,
body[data-theme="aurora"] .message-search-result,
body[data-theme="aurora"] .message-search-empty,
body[data-theme="aurora"] .message-search-note,
body[data-theme="aurora"] .global-search-result,
body[data-theme="aurora"] .global-search-note,
body[data-theme="aurora"] .global-search-empty,
body[data-theme="aurora"] .global-search-category-empty {
  border-color: #dbe3ef;
  background: #f7f9fc;
}

body[data-theme="aurora"] .message-search-copy mark,
body[data-theme="aurora"] .global-search-copy mark {
  background: #ffe8ec;
  color: #e53e52;
}

@media (max-width: 720px) {
  .message-search-panel {
    padding: 10px;
  }

  .message-search-bar {
    gap: 8px;
  }

  .message-search-input-control {
    flex-basis: calc(100% - 128px);
    height: 38px;
  }

  .message-search-nav {
    gap: 6px;
  }

  .message-search-date-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .message-search-date-control {
    height: 42px;
  }

  .message-search-date-actions {
    padding-bottom: 1px;
  }

  .message-search-list {
    max-height: 220px;
  }

  .message-search-result {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .message-search-result time {
    justify-self: end;
  }
}

.composer-shell > input.composer-file-input,
input.composer-file-input[type="file"] {
  display: none !important;
  position: absolute !important;
  top: auto !important;
  right: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

.context-panel .detail-actions.two,
.context-panel .user-action-grid.is-profile-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-profile-primary,
.context-panel .user-action-grid.is-profile-danger {
  grid-template-columns: minmax(0, 1fr) !important;
}

.context-panel .user-action-panel {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.context-panel .user-action-grid {
  gap: 10px;
  min-width: 0;
}

.context-panel .user-action-grid.is-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-primary .user-action.is-main {
  grid-column: 1 / -1;
}

.context-panel .user-action-grid.is-contact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-contact-actions .user-action.is-main,
.context-panel .user-action-grid.is-contact-actions .user-action[data-action="delete-friend"] {
  grid-column: 1 / -1;
}

.context-panel .user-action-grid.is-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.context-panel .user-action-grid.is-secondary .user-action.is-danger,
.context-panel .user-action-grid.is-secondary .user-action.is-warning {
  grid-column: 1 / -1;
}

.context-panel .detail-actions.two button,
.context-panel .user-action-grid.is-profile-primary .user-action,
.context-panel .user-action-grid.is-profile-secondary .user-action,
.context-panel .user-action-grid.is-profile-danger .user-action,
.context-panel .user-action-grid.is-primary .user-action,
.context-panel .user-action-grid.is-contact-actions .user-action,
.context-panel .user-action-grid.is-secondary .user-action {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 8%);
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
  color: var(--ink);
  box-shadow: none;
  overflow: hidden;
}

.context-panel .user-action-grid.is-primary .user-action:not(.is-main),
.context-panel .user-action-grid.is-contact-actions .user-action:not(.is-main),
.context-panel .user-action-grid.is-profile-secondary .user-action,
.context-panel .user-action-grid.is-profile-danger .user-action,
.context-panel .user-action-grid.is-secondary .user-action {
  font-weight: 700;
}

.context-panel .user-action-grid.is-primary .user-action:not(.is-main):hover,
.context-panel .user-action-grid.is-contact-actions .user-action:not(.is-main):hover,
.context-panel .user-action-grid.is-profile-secondary .user-action:hover,
.context-panel .user-action-grid.is-profile-danger .user-action:hover,
.context-panel .user-action-grid.is-secondary .user-action:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 34%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 50%);
  color: var(--primary);
}

.context-panel .user-action-grid.is-secondary .user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 93%);
  color: var(--danger);
}

.context-panel .user-action-grid.is-contact-actions .user-action.is-danger,
.context-panel .user-action-grid.is-profile-secondary .user-action.is-danger,
.context-panel .user-action-grid.is-profile-danger .user-action.is-danger {
  border-color: color-mix(in srgb, var(--danger), transparent 62%);
  background: color-mix(in srgb, var(--danger), transparent 93%);
  color: var(--danger);
}

.context-panel .user-action-grid.is-secondary .user-action.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), transparent 40%);
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
}

.context-panel .user-action-grid.is-contact-actions .user-action.is-danger:hover,
.context-panel .user-action-grid.is-profile-secondary .user-action.is-danger:hover,
.context-panel .user-action-grid.is-profile-danger .user-action.is-danger:hover {
  border-color: color-mix(in srgb, var(--danger), transparent 40%);
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
}

.context-panel .user-action-grid .user-action span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-panel .detail-actions .detail-file-button {
  border: 1.5px solid color-mix(in srgb, var(--primary), var(--line) 22%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft), var(--surface) 54%), color-mix(in srgb, var(--surface), var(--primary-soft) 18%)) !important;
  color: var(--primary) !important;
  font-weight: 720;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff, transparent 88%),
    0 10px 22px color-mix(in srgb, var(--primary), transparent 90%);
}

.context-panel .detail-actions .detail-file-button svg {
  width: 16px;
  height: 16px;
  color: currentColor !important;
  stroke-width: 2.2;
}

.context-panel .detail-actions .detail-file-button:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 18%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft), var(--surface) 18%), color-mix(in srgb, var(--surface), var(--primary-soft) 40%)) !important;
  transform: translateY(-1px);
}

body[data-theme="aurora"] .context-panel .detail-actions .detail-file-button {
  border: 1.5px solid #83a6ff !important;
  background: linear-gradient(180deg, #ffffff, #edf3ff) !important;
  color: #1f55d6 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .78),
    0 10px 22px rgba(77, 119, 255, .16);
}

body[data-theme="aurora"] .context-kind-group .context-overview .detail-actions .detail-file-button,
body[data-theme="teal"] .context-kind-group .context-overview .detail-actions .detail-file-button,
body[data-theme="graphite"] .context-kind-group .context-overview .detail-actions .detail-file-button {
  border: 1.5px solid #83a6ff !important;
  color: #1f55d6 !important;
}

body[data-theme="midnight"] .context-panel .detail-actions .detail-file-button {
  border: 1px solid rgba(126, 157, 216, .42) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .028)) !important;
  color: #dbe7ff !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .035),
    0 10px 22px rgba(0, 0, 0, .16);
}

body[data-theme="midnight"] .context-panel .detail-actions .detail-file-button svg {
  color: #7bc5ff !important;
}

body[data-theme="midnight"] .context-panel .detail-actions .detail-file-button:hover {
  border-color: rgba(123, 197, 255, .62) !important;
  background:
    linear-gradient(180deg, rgba(91, 157, 255, .16), rgba(255, 255, 255, .04)) !important;
}

/* Canonical visual contract for ordinary profile actions. Renderers opt in via
   one semantic attribute; primary, danger and warning actions are ineligible. */
[data-profile-secondary-action] {
  --profile-secondary-background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary), transparent 92%), color-mix(in srgb, var(--primary), transparent 96%)),
    color-mix(in srgb, var(--surface), var(--primary-soft) 16%);
  --profile-secondary-border: color-mix(in srgb, var(--primary), var(--line) 18%);
  --profile-secondary-color: var(--primary);
  --profile-secondary-hover-background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary), transparent 88%), color-mix(in srgb, var(--primary), transparent 94%)),
    color-mix(in srgb, var(--surface), var(--primary-soft) 22%);
  --profile-secondary-hover-border: color-mix(in srgb, var(--primary), transparent 26%);
  --profile-secondary-hover-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff, transparent 72%),
    0 10px 24px color-mix(in srgb, var(--primary), transparent 88%);
}

button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) {
  min-height: 44px;
  border: 1.5px solid var(--profile-secondary-border);
  border-radius: 13px;
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  font-weight: 760;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff, transparent 76%);
}

button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--profile-secondary-hover-border);
  background: var(--profile-secondary-hover-background);
  color: var(--profile-secondary-color);
  transform: translateY(-1px);
  box-shadow: var(--profile-secondary-hover-shadow);
}

button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):active:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--profile-secondary-hover-border);
  background: var(--profile-secondary-hover-background);
  color: var(--profile-secondary-color);
  opacity: .92;
  transform: translateY(1px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff, transparent 78%);
}

button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):focus {
  border-color: var(--profile-secondary-hover-border);
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 68%);
  outline-offset: 2px;
}

button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):disabled {
  border-color: var(--profile-secondary-border);
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  opacity: .48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button[data-profile-secondary-action][aria-disabled="true"]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) {
  border-color: var(--profile-secondary-border);
  background: var(--profile-secondary-background);
  color: var(--profile-secondary-color);
  opacity: .48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) svg {
  width: 16px;
  height: 16px;
  color: currentColor;
  stroke-width: 2.1;
}

.edit-profile-actions .primary-button {
  border: 0 !important;
  background: var(--grad) !important;
  color: #fff !important;
  font-weight: 760;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary), transparent 80%);
}

.edit-profile-actions .primary-button:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary), transparent 74%);
}

.drawer-card.drawer-profile {
  width: min(430px, calc(100vw - 28px));
}

.drawer-card.drawer-profile .drawer-body {
  padding: 16px 18px 22px;
}

.drawer-user-profile {
  display: grid;
  gap: 16px;
}

.drawer-profile-hero,
.drawer-profile-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.drawer-profile-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 14px 16px;
  overflow: hidden;
  text-align: center;
}

.drawer-profile-cover {
  width: calc(100% + 28px);
  height: 108px;
  display: block;
  margin: 0 -14px -38px;
  background:
    radial-gradient(180px 96px at 12% 18%, rgba(255, 255, 255, .24), transparent 66%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary), #8bd8ff 12%), color-mix(in srgb, var(--primary), #8b62ff 18%));
}

.drawer-profile-hero .avatar-xl {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border: 4px solid var(--surface);
  border-radius: 22px;
  font-size: 27px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary), transparent 74%);
}

.drawer-profile-hero h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.2;
}

.drawer-profile-hero p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
}

.drawer-profile-hero .user-action-panel {
  margin-top: 8px;
}

.drawer-user-profile .user-action-grid.is-profile-primary,
.drawer-user-profile .user-action-grid.is-profile-danger {
  grid-template-columns: minmax(0, 1fr);
}

.drawer-user-profile .user-action-grid.is-profile-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-user-profile .user-action-grid.is-profile-primary .user-action,
.drawer-user-profile .user-action-grid.is-profile-secondary .user-action,
.drawer-user-profile .user-action-grid.is-profile-danger .user-action {
  width: 100%;
  min-height: 44px;
  height: 44px;
  border-radius: 13px;
}

.drawer-profile-card {
  display: grid;
  gap: 0;
  padding: 0 14px;
}

.drawer-profile-card .detail-card-head {
  padding: 14px 0 11px;
}

.drawer-profile-card .detail-kv {
  padding: 12px 0;
}

.drawer-profile-card .context-file-list {
  padding: 0 0 14px;
}

.drawer-profile-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 0 14px;
}

.drawer-profile-secondary-actions .user-action {
  width: 100%;
  min-height: 42px;
}

body[data-theme="aurora"] [data-profile-secondary-action] {
  --profile-secondary-background: linear-gradient(180deg, #f6f9ff, #edf3ff);
  --profile-secondary-border: #95b6ff;
  --profile-secondary-color: #1859d9;
  --profile-secondary-hover-background: linear-gradient(180deg, #eef4ff, #e4ecff);
  --profile-secondary-hover-border: #6b99ff;
  --profile-secondary-hover-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .82),
    0 10px 22px rgba(66, 118, 255, .14);
}

body[data-theme="aurora"] .drawer-profile-hero,
body[data-theme="aurora"] .drawer-profile-card {
  border-color: #dfe7f1;
  background: #fff;
}

body[data-theme="midnight"] .drawer-profile-hero,
body[data-theme="midnight"] .drawer-profile-card {
  border-color: rgba(148, 163, 184, .15);
  background: rgba(255, 255, 255, .035);
}

body[data-theme="midnight"] [data-profile-secondary-action] {
  --profile-secondary-background:
    linear-gradient(180deg, rgba(83, 125, 255, .16), rgba(83, 125, 255, .07)),
    rgba(17, 26, 45, .76);
  --profile-secondary-border: rgba(106, 154, 255, .56);
  --profile-secondary-color: #8bb6ff;
  --profile-secondary-hover-background:
    linear-gradient(180deg, rgba(99, 149, 255, .22), rgba(99, 149, 255, .1)),
    rgba(20, 31, 54, .9);
  --profile-secondary-hover-border: rgba(132, 180, 255, .78);
  --profile-secondary-hover-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .06),
    0 10px 24px rgba(64, 116, 255, .12);
}

@media (-ms-high-contrast: active) {
  button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):hover:not(:disabled):not([aria-disabled="true"]) {
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
    box-shadow: none;
  }

  button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):active:not(:disabled):not([aria-disabled="true"]) {
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
    box-shadow: none;
  }

  button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):focus {
    border-color: ButtonText;
    background: ButtonFace;
    color: ButtonText;
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  button[data-profile-secondary-action]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning):disabled {
    border-color: GrayText;
    background: ButtonFace;
    color: GrayText;
  }

  button[data-profile-secondary-action][aria-disabled="true"]:not(.primary-button):not(.is-main):not(.is-danger):not(.is-warning) {
    border-color: GrayText;
    background: ButtonFace;
    color: GrayText;
  }
}

.behavior-authority-timeline {
  min-height: 320px;
}

.behavior-authority-event-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.behavior-authority-event {
  display: grid;
  grid-template-columns: 58px 12px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px 0;
}

.behavior-authority-event:not(:last-child) .behavior-authority-event-dot::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -22px;
  left: 4px;
  width: 2px;
  background: color-mix(in srgb, var(--primary), transparent 78%);
}

.behavior-authority-event time {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 18px;
}

.behavior-authority-event-dot {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary), transparent 48%);
}

.behavior-authority-event > div {
  min-width: 0;
}

.behavior-authority-event strong,
.behavior-authority-event p,
.behavior-authority-event small {
  overflow-wrap: anywhere;
}

.behavior-authority-event strong {
  color: var(--ink);
  font-size: 13px;
}

.behavior-authority-event p {
  margin: 3px 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.behavior-authority-event small {
  color: var(--ink-3);
}

@media (max-width: 680px) {
  .behavior-authority-event {
    grid-template-columns: 58px 10px minmax(0, 1fr);
    gap: 8px;
  }
}

.context-panel .user-action.is-main,
.drawer-user-profile .user-action.is-main,
.contact-profile-card .user-action.is-main,
.contact-profile-workspace .user-action.is-main {
  border: 1px solid color-mix(in srgb, var(--primary), #ffffff 16%) !important;
  background:
    radial-gradient(120px 80px at 18% 8%, rgba(255, 255, 255, .24), transparent 62%),
    linear-gradient(135deg, #5c8cff 0%, #7567ff 100%) !important;
  color: #fff !important;
  box-shadow:
    0 15px 34px rgba(86, 116, 255, .30),
    inset 0 1px 0 rgba(255, 255, 255, .24) !important;
}

.context-panel .user-action.is-main:hover,
.drawer-user-profile .user-action.is-main:hover,
.contact-profile-card .user-action.is-main:hover,
.contact-profile-workspace .user-action.is-main:hover {
  border-color: rgba(184, 206, 255, .72) !important;
  background:
    radial-gradient(130px 86px at 18% 8%, rgba(255, 255, 255, .30), transparent 64%),
    linear-gradient(135deg, #6a99ff 0%, #806fff 100%) !important;
  transform: translateY(-1px);
  box-shadow:
    0 18px 40px rgba(86, 116, 255, .38),
    inset 0 1px 0 rgba(255, 255, 255, .28) !important;
}

body[data-theme="aurora"] .context-panel .user-action.is-main,
body[data-theme="aurora"] .drawer-user-profile .user-action.is-main,
body[data-theme="aurora"] .contact-profile-card .user-action.is-main,
body[data-theme="aurora"] .contact-profile-workspace .user-action.is-main {
  border-color: #6d94ff !important;
  background:
    radial-gradient(120px 80px at 18% 8%, rgba(255, 255, 255, .28), transparent 62%),
    linear-gradient(135deg, #5a8bff 0%, #7366f5 100%) !important;
  color: #fff !important;
  box-shadow:
    0 14px 30px rgba(80, 112, 235, .22),
    inset 0 1px 0 rgba(255, 255, 255, .30) !important;
}

body[data-theme="aurora"] .context-panel .user-action.is-main:hover,
body[data-theme="aurora"] .drawer-user-profile .user-action.is-main:hover,
body[data-theme="aurora"] .contact-profile-card .user-action.is-main:hover,
body[data-theme="aurora"] .contact-profile-workspace .user-action.is-main:hover {
  border-color: #4e7fff !important;
  background:
    radial-gradient(130px 86px at 18% 8%, rgba(255, 255, 255, .34), transparent 64%),
    linear-gradient(135deg, #4f84ff 0%, #6d5ff0 100%) !important;
  box-shadow:
    0 16px 34px rgba(80, 112, 235, .28),
    inset 0 1px 0 rgba(255, 255, 255, .34) !important;
}

body[data-theme="midnight"] .context-panel .user-action.is-main,
body[data-theme="midnight"] .drawer-user-profile .user-action.is-main,
body[data-theme="midnight"] .contact-profile-card .user-action.is-main,
body[data-theme="midnight"] .contact-profile-workspace .user-action.is-main {
  border-color: rgba(126, 166, 255, .72) !important;
  background:
    radial-gradient(120px 80px at 18% 8%, rgba(255, 255, 255, .18), transparent 62%),
    linear-gradient(135deg, #5e8cff 0%, #7568ff 100%) !important;
  color: #fff !important;
  box-shadow:
    0 18px 38px rgba(70, 104, 255, .28),
    inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}

body[data-theme="midnight"] .context-panel .user-action.is-main:hover,
body[data-theme="midnight"] .drawer-user-profile .user-action.is-main:hover,
body[data-theme="midnight"] .contact-profile-card .user-action.is-main:hover,
body[data-theme="midnight"] .contact-profile-workspace .user-action.is-main:hover {
  border-color: rgba(170, 198, 255, .86) !important;
  background:
    radial-gradient(130px 86px at 18% 8%, rgba(255, 255, 255, .24), transparent 64%),
    linear-gradient(135deg, #6d9aff 0%, #8373ff 100%) !important;
  box-shadow:
    0 20px 44px rgba(70, 104, 255, .34),
    inset 0 1px 0 rgba(255, 255, 255, .22) !important;
}

@media (max-width: 560px) {
  .drawer-profile-secondary-actions {
    grid-template-columns: 1fr;
  }
}

.message-mention-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 0 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #ff5d6c, transparent 86%);
  color: #ff5d6c;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
}

.message-row.is-me .message-mention-badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

body[data-theme="aurora"] .message-mention-badge {
  background: #ffe9ee;
  color: #e23e54;
}

.message-search-scope {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-3);
  font-size: 12px;
}

.message-search-scope strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
}

.message-search-scope span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-icon-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-2);
}

.ghost-icon-action:hover {
  border-color: var(--line);
  color: var(--ink);
}

.ghost-icon-action svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 720px) {
  .set-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .set-row > :not(.sr-body) {
    justify-self: start;
    max-width: 100%;
  }

  .message-search-scope {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

.avatar,
.avatar-xl,
.avatar-soft,
.avatar-user,
.avatar.is-system,
.directory-avatar,
.signed-out-avatar,
.message-avatar,
.detail-avatar,
.incoming-avatar,
.incoming-avatar span,
.context-profile-card .avatar,
.context-section .profile-large .avatar,
.profile-large .avatar-xl,
.drawer-profile-hero .avatar-xl,
.drawer-profile-card .avatar,
.contact-profile-large .avatar-xl,
.contact-avatar-wrap .avatar-xl,
.detail-member .avatar,
.governance-row .avatar,
.seen-modal .avatar,
.mention-item .avatar,
.member-popover-head .avatar,
.context-file-mini .avatar,
.context-member-pill .avatar,
.message-row > .avatar,
.conversation-card .avatar,
.plain-row .avatar,
.conversation-avatar-wrap .avatar,
.call-history-row .avatar,
.rtc-record-card .avatar,
.rtc-live-tile .avatar {
  border-radius: 50% !important;
  overflow: hidden;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-overflow: clip;
}

.rail-footer {
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.rail-user {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  overflow: visible;
  line-height: 1;
  border-radius: 50% !important;
}

.rail-user > span {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.rail-user > span > .avatar-fallback,
.rail-user > span > img[data-avatar-image] {
  grid-area: 1 / 1;
}

.rail-user > span > img,
.rail-user img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rail-user img[data-avatar-image] {
  visibility: hidden;
}

.rail-user img[data-avatar-image].is-avatar-loaded {
  visibility: visible;
}

.rail-user > .presence-dot {
  right: 0;
  bottom: 0;
  z-index: 2;
}

.avatar img,
.directory-avatar img,
.signed-out-avatar img,
.message-avatar img,
.detail-avatar img,
.incoming-avatar > img,
.incoming-avatar span img,
.rail-user img {
  border-radius: 50% !important;
}

.conversation-card .avatar.is-system,
.conversation-avatar-wrap .avatar.is-system,
.avatar.is-system {
  width: 46px;
  height: 46px;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}

.conversation-card .avatar.is-system img,
.conversation-avatar-wrap .avatar.is-system img,
.avatar.is-system img {
  width: 100%;
  height: 100%;
  transform: scale(1.22);
  transform-origin: center;
}

.conversation-card .avatar.is-group-default-avatar,
.conversation-avatar-wrap .avatar.is-group-default-avatar,
.avatar.is-group-default-avatar {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 50%;
}

.avatar.is-group-default-avatar .avatar-fallback {
  visibility: hidden;
}

.conversation-card .avatar.is-group-default-avatar img[data-avatar-image].is-group-default-avatar-image,
.conversation-avatar-wrap .avatar.is-group-default-avatar img[data-avatar-image].is-group-default-avatar-image,
.avatar.is-group-default-avatar img[data-avatar-image].is-group-default-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18);
  transform-origin: center;
}

.group-profile-modal {
  width: min(640px, calc(100vw - 28px));
  overflow: hidden;
}

.my-avatar-modal {
  width: min(560px, calc(100vw - 28px));
  overflow: hidden;
}

.my-name-modal {
  width: min(500px, calc(100vw - 28px));
  overflow: hidden;
}

.my-name-editor {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.account-profile-card.is-name-editor {
  padding: 14px;
}

.my-name-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.my-name-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 680;
  outline: none;
}

.my-name-field input:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%);
}

.my-account-readonly {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 42%);
}

.my-account-readonly span {
  color: var(--muted);
}

.my-account-readonly strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.my-account-readonly small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.group-profile-editor {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: stretch;
}

.group-profile-preview {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 14%, color-mix(in srgb, var(--primary), transparent 86%), transparent 48%),
    color-mix(in srgb, var(--surface-soft), var(--surface) 36%);
}

.my-avatar-editor {
  grid-template-columns: 190px minmax(0, 1fr);
}

.my-avatar-preview-card {
  min-height: 224px;
}

.group-avatar-crop {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--primary), transparent 58%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary), transparent 90%);
  pointer-events: none;
}

.avatar-crop-trigger {
  position: relative;
  padding: 0;
  appearance: none;
  cursor: pointer;
  touch-action: none;
  color: inherit;
  pointer-events: auto;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.avatar-crop-trigger.is-cropping {
  cursor: grab;
  border-radius: 24px;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 25%, transparent 25% 75%, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 75%),
    linear-gradient(45deg, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 25%, transparent 25% 75%, color-mix(in srgb, var(--surface-soft), var(--ink) 5%) 75%),
    color-mix(in srgb, var(--surface), var(--primary-soft) 12%);
  background-position: 0 0, 8px 8px, 0 0;
  background-size: 16px 16px, 16px 16px, auto;
}

.avatar-crop-trigger.is-cropping.is-dragging {
  cursor: grabbing;
}

.avatar-crop-trigger.is-cropping::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  border-radius: 22px;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 0 69%, color-mix(in srgb, var(--ink), transparent 70%) 70% 100%);
}

.avatar-crop-trigger.is-cropping::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  border: 2px solid color-mix(in srgb, var(--primary), white 34%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, white, transparent 10%) inset;
}

.avatar-crop-trigger:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary), transparent 82%);
  transform: translateY(-1px);
}

.avatar-crop-trigger:active {
  transform: translateY(0);
}

.avatar-crop-trigger:focus {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 76%);
  outline-offset: 3px;
}

.avatar-crop-trigger.is-disabled,
.group-avatar-change-button.is-disabled {
  opacity: .62;
  cursor: progress;
  pointer-events: none;
}

.my-avatar-crop {
  border-radius: 50%;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface), transparent 2%), color-mix(in srgb, var(--surface-soft), transparent 0%)),
    color-mix(in srgb, var(--surface-soft), var(--surface) 40%);
}

.my-avatar-crop-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  contain: paint;
}

.avatar-crop-trigger.is-cropping .my-avatar-crop-preview,
.avatar-crop-trigger.is-cropping .group-profile-avatar-preview {
  border-radius: 22px !important;
}

.my-avatar-crop-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate3d(var(--avatar-pan-x, 0px), var(--avatar-pan-y, 0px), 0) scale(var(--avatar-zoom, 1));
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.avatar-crop-trigger.is-cropping .my-avatar-crop-preview img,
.avatar-crop-trigger.is-cropping .group-profile-avatar-preview img {
  object-fit: contain;
  border-radius: 0 !important;
}

.my-avatar-preview-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 40px;
  font-weight: 860;
  line-height: 1;
  text-align: center;
}

.group-profile-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
}

.group-profile-avatar-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate3d(var(--avatar-pan-x, 0px), var(--avatar-pan-y, 0px), 0) scale(var(--avatar-zoom, 1));
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.group-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  opacity: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.group-profile-preview:focus-within {
  border-color: color-mix(in srgb, var(--primary), transparent 28%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 82%);
}

.group-avatar-change-button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 42%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface), var(--primary-soft) 22%);
  color: color-mix(in srgb, var(--primary), var(--ink) 12%);
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.group-profile-preview:hover .avatar-crop-trigger {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--primary), transparent 82%);
  transform: translateY(-1px);
}

.group-profile-preview:hover .group-avatar-change-button {
  border-color: color-mix(in srgb, var(--primary), transparent 18%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 8%);
  color: var(--primary);
  transform: translateY(-1px);
}

.group-avatar-change-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.15;
}

.group-avatar-change-button:hover {
  border-color: color-mix(in srgb, var(--primary), transparent 18%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 8%);
  color: var(--primary);
  transform: translateY(-1px);
}

.group-avatar-change-button:active {
  transform: translateY(0);
}

.group-avatar-change-button:focus {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 78%);
  outline-offset: 2px;
}

.group-profile-form {
  padding: 0;
  align-content: start;
  gap: 14px;
}

.group-profile-form input[data-group-profile-name] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.group-profile-form input[data-group-profile-name]:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 24%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 86%);
}

.group-zoom-field input[type="range"] {
  width: 100%;
  height: 28px;
  accent-color: var(--primary);
  cursor: pointer;
}

.group-zoom-field input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.avatar-editor-state {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 74%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 55%);
  color: var(--ink);
}

.avatar-editor-state strong {
  font-size: 13px;
  font-weight: 780;
}

.avatar-editor-state span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.avatar-editor-state.is-error {
  border-color: color-mix(in srgb, #ff5b6b, transparent 54%);
  background: color-mix(in srgb, #ff5b6b, var(--surface) 88%);
}

.avatar-editor-state.is-error strong,
.avatar-editor-state.is-error span {
  color: color-mix(in srgb, #d9273e, var(--ink) 18%);
}

.detail-avatar-edit-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.detail-title-row {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
  max-width: 100%;
}

.detail-title-row h2,
.detail-title-row h3 {
  position: relative;
  display: inline-block;
  margin: 0;
  min-width: 0;
  max-width: calc(100% - 36px);
  overflow: visible;
  vertical-align: top;
}

.detail-title-row h2 > span,
.detail-title-row h3 > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-edit-icon-button {
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: color-mix(in srgb, var(--ink), transparent 58%);
  box-shadow: none;
  opacity: .72;
  transition:
    background .16s ease,
    border-color .16s ease,
    color .16s ease,
    opacity .16s ease,
    transform .16s ease;
}

.group-edit-icon-button svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke-width: 1.9;
}

.group-edit-icon-button:hover {
  opacity: 1;
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary), transparent 78%);
  background: color-mix(in srgb, var(--primary), transparent 92%);
  transform: translateY(-1px);
  box-shadow: none;
}

.group-edit-icon-button.is-permission-blocked,
.group-avatar-hover-edit.is-permission-blocked {
  opacity: .58;
  cursor: not-allowed;
}

.group-edit-icon-button.is-permission-blocked:hover,
.group-avatar-hover-edit.is-permission-blocked:hover {
  color: color-mix(in srgb, var(--ink), transparent 58%);
  border-color: transparent;
  background: transparent;
  transform: none;
}

.group-avatar-hover-edit {
  cursor: pointer;
  border-radius: 50%;
  isolation: isolate;
  outline: none;
}

.group-avatar-hover-edit .avatar {
  transition:
    filter .16s ease,
    transform .16s ease;
}

.group-avatar-hover-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(15, 23, 42, .44), rgba(15, 23, 42, .28));
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .16s ease,
    background .16s ease;
}

.group-avatar-hover-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .34);
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .22);
  transform: scale(.92);
  transition:
    transform .16s ease,
    background .16s ease,
    border-color .16s ease;
}

.group-avatar-hover-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke-width: 0;
}

.group-avatar-hover-edit:hover .avatar,
.group-avatar-hover-edit:focus .avatar {
  filter: brightness(.72) saturate(.92);
  transform: scale(1.015);
}

.group-avatar-hover-edit:hover .group-avatar-hover-mask,
.group-avatar-hover-edit:focus .group-avatar-hover-mask {
  opacity: 1;
}

.group-avatar-hover-edit:hover .group-avatar-hover-icon,
.group-avatar-hover-edit:focus .group-avatar-hover-icon {
  transform: scale(1);
  background: color-mix(in srgb, var(--primary), rgba(15, 23, 42, .38) 30%);
  border-color: color-mix(in srgb, var(--primary), #ffffff 64%);
}

.title-edit-button {
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  margin-left: 0;
  transform: translateY(-50%);
}

.title-edit-button:hover {
  transform: translateY(-50%);
}

.notice-edit-button {
  width: 28px;
  height: 28px;
}

body[data-theme="midnight"] .group-edit-icon-button {
  color: rgba(203, 213, 225, .52);
}

body[data-theme="midnight"] .group-edit-icon-button:hover {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, .24);
  background: rgba(96, 165, 250, .12);
}

body[data-theme="midnight"] .group-avatar-hover-mask {
  background:
    radial-gradient(circle at 50% 42%, rgba(2, 6, 23, .58), rgba(2, 6, 23, .36));
}

body[data-theme="midnight"] .group-avatar-hover-icon {
  background: rgba(15, 23, 42, .5);
  border-color: rgba(226, 232, 240, .34);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
}

body[data-theme="midnight"] .group-avatar-hover-edit:hover .group-avatar-hover-icon,
body[data-theme="midnight"] .group-avatar-hover-edit:focus .group-avatar-hover-icon {
  background: rgba(96, 165, 250, .78);
  border-color: rgba(226, 232, 240, .62);
}

body[data-theme="midnight"] .group-profile-preview {
  background:
    radial-gradient(circle at 50% 14%, rgba(123, 197, 255, .14), transparent 48%),
    rgba(255, 255, 255, .035);
}

body[data-theme="midnight"] .group-avatar-change-button {
  border-color: rgba(123, 197, 255, .5);
  background: rgba(123, 197, 255, .12);
  color: #d7f0ff;
}

body[data-theme="midnight"] .group-avatar-change-button:hover {
  border-color: rgba(123, 197, 255, .72);
  background: rgba(123, 197, 255, .18);
  color: #ffffff;
}

.startup-error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--app-bg);
  color: var(--ink);
}

.startup-error-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  text-align: center;
}

.startup-error-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 8px;
}

.startup-error-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.startup-error-card button {
  height: 42px;
  padding: 0 22px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 34%);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.read-status-summary {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 35%);
}

.read-status-summary strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 22px;
}

.read-status-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

body[data-theme="midnight"] .read-status-summary {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .11);
}

.switch {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 24px;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--line), var(--ink) 8%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong), #fff 4%), color-mix(in srgb, var(--surface), #000 3%));
  box-shadow: inset 0 1px 2px color-mix(in srgb, #000, transparent 88%);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.switch::before {
  width: 18px;
  height: 18px;
  margin: 2px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--surface-soft), #fff 32%));
  box-shadow: 0 1px 3px color-mix(in srgb, #000, transparent 82%);
  transition: margin .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.switch.is-on {
  border-color: color-mix(in srgb, var(--primary), #fff 12%);
  background: linear-gradient(135deg, #5d8cff, #7668ff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    0 7px 18px color-mix(in srgb, var(--primary), transparent 78%);
}

.switch.is-on::before {
  margin-left: 18px;
  border-color: rgba(255, 255, 255, .58);
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 2px 6px color-mix(in srgb, #1d3c8f, transparent 70%);
}

body[data-theme="midnight"] .switch {
  border-color: rgba(148, 163, 184, .24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .055));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .025),
    inset 0 1px 2px rgba(0, 0, 0, .36);
}

body[data-theme="midnight"] .switch::before {
  border-color: rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, #aeb7c8, #747d91);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .36);
}

body[data-theme="midnight"] .switch.is-on {
  border-color: rgba(133, 160, 255, .56);
  background: linear-gradient(135deg, #5a7dff, #7b67ff);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    0 8px 22px rgba(102, 126, 255, .22);
}

body[data-theme="midnight"] .switch.is-on::before {
  border-color: rgba(255, 255, 255, .68);
  background: linear-gradient(180deg, #ffffff, #dfe8ff);
  box-shadow: 0 3px 8px rgba(23, 43, 111, .52);
}

body[data-theme="aurora"] .switch {
  border-color: rgba(119, 134, 164, .22);
  background: linear-gradient(180deg, #eef3fb, #e3eaf4);
  box-shadow: inset 0 1px 2px rgba(13, 29, 56, .06);
}

body[data-theme="aurora"] .switch::before {
  border-color: rgba(119, 134, 164, .16);
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
  box-shadow: 0 2px 5px rgba(44, 69, 112, .16);
}

body[data-theme="aurora"] .switch.is-on {
  border-color: rgba(92, 124, 255, .38);
  background: linear-gradient(135deg, #5d8cff, #7668ff);
  box-shadow: 0 8px 18px rgba(91, 125, 255, .18);
}

@media (max-width: 720px) {
  .detail-actions.three {
    grid-template-columns: 1fr;
  }

  .group-profile-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .contact-search-inline,
  .contact-search-result {
    grid-template-columns: 1fr;
  }

  .contact-search-field button,
  .contact-apply-submit {
    width: 100%;
  }

  .contact-search-result .directory-status {
    justify-self: start;
  }
}

.context-panel .user-action-grid.is-primary {
  background: transparent !important;
  box-shadow: none !important;
}
.context-panel .user-action-grid.is-primary .user-action.is-main {
  background: linear-gradient(135deg, #4f8cff 0%, #7c6bff 100%) !important;
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.30) !important;
}

.contact-profile-workspace .contact-profile-card .user-action-grid.is-contact-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.contact-profile-workspace .contact-profile-card .user-action-grid.is-contact-actions .user-action.is-main,
.contact-profile-workspace .contact-profile-card .user-action-grid.is-contact-actions .user-action[data-action="delete-friend"] {
  grid-column: auto !important;
}

.rtc-call-workspace.is-active-call .rtc-live-tile:hover,
.rtc-call-workspace.is-active-call .rtc-live-tile:focus,
.rtc-call-workspace.is-active-call .rtc-live-tile:focus-within,
.rtc-call-workspace.is-active-call .rtc-live-tile:active {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  box-shadow: none !important;
  transform: none !important;
}

.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:hover,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:focus,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:focus-within,
.rtc-call-workspace.is-active-call .rtc-live-tile.is-peer:active {
  background:
    radial-gradient(380px 240px at 50% 10%, color-mix(in srgb, var(--primary), transparent 68%), transparent 72%),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft), var(--surface) 24%), var(--surface-soft)) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  transform: none !important;
}

.password-change-modal {
  width: min(520px, calc(100vw - 32px));
}

.password-change-body {
  display: grid;
  gap: 14px;
  padding: 20px 24px 8px;
}

.password-guard-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary), transparent 92%);
}

.password-guard-card svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.password-guard-card strong {
  display: block;
  color: var(--ink);
}

.password-guard-card p {
  margin: 2px 0 0;
  color: var(--muted);
}

.password-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.password-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: color-mix(in srgb, var(--surface), #fff 3%);
  color: var(--ink);
  font: inherit;
}

.password-field input:focus {
  border-color: color-mix(in srgb, var(--primary), #fff 10%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 84%);
}

.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.password-strength-bar {
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 20%);
}

.password-strength-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #7c6bff);
}

.password-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
}

.password-rule-list li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.password-rule-list li span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted), transparent 50%);
}

.password-rule-list li.is-ok {
  color: var(--success);
}

.password-rule-list li.is-ok span {
  background: var(--success);
}

.password-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger), transparent 90%);
}

body[data-theme="midnight"] .password-guard-card,
body[data-theme="midnight"] .password-field input {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
}

body[data-theme="aurora"] .password-field input {
  background: #fff;
}

.copy-user-id-button,
.copy-user-id-button:hover,
.copy-user-id-button:active,
.copy-user-id-button:focus { box-sizing: border-box; width: auto; max-width: 100%; height: auto; min-width: 0; min-height: 0; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: 0; transform: none; white-space: nowrap; line-height: 1.35; color: var(--primary); font-size: 14px; font-weight: 800; }

.detail-kv strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

.info-list strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

.info-grid strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

.account-info-list strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

.contact-info-grid strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

.member-role-user-id strong:has(.copy-user-id-button) { width: auto !important; max-width: 100%; min-width: 0 !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; overflow: hidden; line-height: 1.35; text-align: left; }

.detail-kv .copy-user-id-button, .info-list .copy-user-id-button, .info-grid .copy-user-id-button, .account-info-list .copy-user-id-button, .contact-info-grid .copy-user-id-button, .member-role-user-id .copy-user-id-button { width: fit-content !important; min-width: 0 !important; max-width: 100%; height: auto !important; min-height: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: flex-start !important; flex-wrap: nowrap; gap: 6px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; overflow: hidden; vertical-align: top; background: transparent !important; box-shadow: none !important; color: var(--primary) !important; font-size: 14px; font-weight: 800; line-height: 1.35; }

.detail-kv .copy-user-id-button span, .info-list .copy-user-id-button span, .info-grid .copy-user-id-button span, .account-info-list .copy-user-id-button span, .contact-info-grid .copy-user-id-button span, .member-role-user-id .copy-user-id-button span { display: block !important; min-width: 0 !important; flex: 1 1 auto; overflow: hidden; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: inherit !important; line-height: inherit; text-overflow: ellipsis; white-space: nowrap; }

.detail-kv .copy-user-id-button svg, .info-list .copy-user-id-button svg, .info-grid .copy-user-id-button svg, .account-info-list .copy-user-id-button svg, .contact-info-grid .copy-user-id-button svg, .member-role-user-id .copy-user-id-button svg { width: 13px !important; height: 13px !important; min-width: 13px; flex: 0 0 13px; display: block; align-self: center; margin-left: 1px; color: currentColor !important; opacity: .72; }

.copy-user-id-button:hover,
.copy-user-id-button:active,
.copy-user-id-button:focus { color: var(--primary); }

.detail-kv .copy-user-id-button:active { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.detail-kv .copy-user-id-button:focus { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.info-list .copy-user-id-button:active { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.info-list .copy-user-id-button:focus { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.info-grid .copy-user-id-button:active { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.info-grid .copy-user-id-button:focus { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.account-info-list .copy-user-id-button:active { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.account-info-list .copy-user-id-button:focus { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.contact-info-grid .copy-user-id-button:active { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.contact-info-grid .copy-user-id-button:focus { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.member-role-user-id .copy-user-id-button:active { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.member-role-user-id .copy-user-id-button:focus { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.detail-kv .copy-user-id-button:hover, .info-list .copy-user-id-button:hover, .info-grid .copy-user-id-button:hover, .account-info-list .copy-user-id-button:hover, .contact-info-grid .copy-user-id-button:hover, .member-role-user-id .copy-user-id-button:hover { background: transparent !important; box-shadow: none !important; color: var(--primary-strong, var(--primary)) !important; transform: none !important; }

.copy-user-id-button:focus { outline: 0; outline-offset: 0; }

button.message-avatar,
.message-avatar {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #b66bff, #7c6bff);
  box-shadow: 0 4px 12px rgba(124, 107, 255, .14);
  transition:
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out),
    color .16s var(--ease-out),
    transform .16s var(--ease-out);
  outline: 0;
  --message-avatar-ring: transparent;
}

button.message-avatar::after,
.message-avatar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 2px var(--message-avatar-ring);
  transition: opacity .16s var(--ease-out), box-shadow .16s var(--ease-out);
}

button.message-avatar.is-system,
.message-avatar.is-system {
  background: linear-gradient(135deg, #ef625b, #dc443f);
  box-shadow: 0 4px 12px rgba(239, 98, 91, .14);
}

button.message-avatar:hover,
button.message-avatar:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 34%);
  background: linear-gradient(135deg, #b66bff, #7c6bff);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 34%);
  transform: none;
}

button.message-avatar.is-system:hover,
button.message-avatar.is-system:focus {
  border-color: color-mix(in srgb, #ef625b, transparent 32%);
  background: linear-gradient(135deg, #ef625b, #dc443f);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, #ef625b, transparent 34%);
}

body[data-theme="aurora"] button.message-avatar:hover,
body[data-theme="aurora"] button.message-avatar:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 42%);
}

body[data-theme="midnight"] button.message-avatar:hover,
body[data-theme="midnight"] button.message-avatar:focus {
  border-color: color-mix(in srgb, var(--primary), transparent 42%);
  box-shadow: none;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 28%);
}

button.message-avatar:hover,
button.message-avatar:focus,
.message-avatar:hover,
.message-avatar:focus {
  box-shadow: none !important;
  --message-avatar-ring: color-mix(in srgb, var(--primary), transparent 28%);
  transform: none !important;
}

button.message-avatar:hover::after,
button.message-avatar:focus::after,
.message-avatar:hover::after,
.message-avatar:focus::after {
  opacity: 1;
}

button.message-avatar.is-system:hover,
button.message-avatar.is-system:focus,
.message-avatar.is-system:hover,
.message-avatar.is-system:focus {
  box-shadow: none !important;
  --message-avatar-ring: color-mix(in srgb, #ef625b, transparent 28%);
  transform: none !important;
}

button.message-avatar:hover img,
button.message-avatar:focus img,
.message-avatar:hover img,
.message-avatar:focus img,
button.message-avatar:hover .avatar-fallback,
button.message-avatar:focus .avatar-fallback,
.message-avatar:hover .avatar-fallback,
.message-avatar:focus .avatar-fallback {
  transform: none !important;
}

@media (max-width: 560px) {
  .password-rule-list {
    grid-template-columns: 1fr;
  }
}

.detail-kv,
.info-list > span,
.info-grid > span,
.contact-info-grid > span,
.account-info-list > span,
.member-role-user-id {
  min-width: 0;
}

.detail-kv strong:has(.copy-user-id-button),
.info-list strong:has(.copy-user-id-button),
.info-grid strong:has(.copy-user-id-button),
.contact-info-grid strong:has(.copy-user-id-button),
.account-info-list strong:has(.copy-user-id-button),
.member-role-user-id strong:has(.copy-user-id-button) {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.35;
  text-align: left;
}

.detail-kv .copy-user-id-button,
.info-list .copy-user-id-button,
.info-grid .copy-user-id-button,
.contact-info-grid .copy-user-id-button,
.account-info-list .copy-user-id-button,
.member-role-user-id .copy-user-id-button {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: hidden;
  vertical-align: top;
}

.detail-kv .copy-user-id-button span,
.info-list .copy-user-id-button span,
.info-grid .copy-user-id-button span,
.contact-info-grid .copy-user-id-button span,
.account-info-list .copy-user-id-button span,
.member-role-user-id .copy-user-id-button span {
  min-width: 0;
  display: block !important;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-kv .copy-user-id-button svg,
.info-list .copy-user-id-button svg,
.info-grid .copy-user-id-button svg,
.contact-info-grid .copy-user-id-button svg,
.account-info-list .copy-user-id-button svg,
.member-role-user-id .copy-user-id-button svg {
  flex: 0 0 13px;
  display: block;
  align-self: center;
  margin-left: 1px;
}

/* 1v1 video calling: every panel and floating surface is deliberately opaque. */
.rtc-contact-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.rtc-contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rtc-contact-actions button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 740;
}

.rtc-contact-actions button:first-child {
  border-color: color-mix(in srgb, var(--primary), var(--line) 40%);
  background: var(--primary-soft);
  color: var(--primary-2);
}

.rtc-contact-actions button:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.rtc-contact-actions svg {
  width: 17px;
  height: 17px;
}

.rtc-ended-summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
}

.rtc-ended-summary > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-2);
}

.rtc-ended-summary svg {
  width: 20px;
  height: 20px;
}

.rtc-ended-summary strong,
.rtc-ended-summary small {
  display: block;
}

.rtc-ended-summary small {
  margin-top: 4px;
  color: var(--ink-3);
}

.rtc-ended-summary > button {
  min-width: 112px;
  min-height: 48px;
  display: inline-flex;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raise);
  color: var(--ink-2);
}

.rtc-video-workspace .page-scroll {
  min-height: 0;
  align-content: stretch;
  overflow: auto;
}

.rtc-call-workspace.is-active-call .rtc-call-actions.call-controls {
  grid-area: auto;
}

.rtc-video-workspace.is-active-call .page-scroll {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  gap: 0;
}

.rtc-video-preflight {
  width: min(920px, 100%);
  min-height: min(680px, calc(100vh - 150px));
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto auto;
  gap: 18px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 44%);
  border-radius: 24px;
  background: #0d1524;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

body[data-theme="aurora"] .rtc-video-preflight {
  background: #fff;
}

.rtc-video-preflight-copy {
  display: grid;
  gap: 6px;
}

.rtc-video-preflight-copy .eyebrow {
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 780;
}

.rtc-video-preflight-copy h2 {
  color: var(--ink);
  font-size: 24px;
}

.rtc-video-preflight-copy p:not(.eyebrow) {
  color: var(--ink-2);
}

.rtc-video-frame {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #050914;
  color: #fff;
}

.rtc-video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #050914;
}

.rtc-video-frame.is-local video {
  transform: scaleX(-1);
}

.rtc-video-frame.is-camera-off video {
  visibility: hidden;
}

.rtc-video-fallback {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: #091121;
  color: #dfe9ff;
  text-align: center;
}

.rtc-video-frame.is-camera-off .rtc-video-fallback,
.rtc-video-frame.is-waiting .rtc-video-fallback {
  display: grid;
}

.rtc-video-fallback .avatar {
  width: 82px;
  height: 82px;
  border-radius: 28px;
}

.rtc-video-frame-label {
  position: static;
  justify-self: start;
  margin-top: 6px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #33455f;
  border-radius: 999px;
  background: #111b2c;
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.rtc-video-error {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger), var(--line) 40%);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--danger);
}

.rtc-video-error svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.rtc-video-error span {
  min-width: 0;
}

.rtc-video-preflight-actions,
.rtc-call-actions.call-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rtc-call-actions.call-controls {
  align-items: center;
}

.rtc-video-workspace.is-active-call .rtc-call-actions.call-controls {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  padding: 14px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: #0a1220;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.rtc-reversible-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rtc-call-actions.call-controls .call-answer,
.rtc-call-actions.call-controls .call-end {
  min-height: 48px;
  padding: 0 16px;
}

.rtc-downgrade-action {
  border: 1px solid #56657a;
  background: #202b3b;
  color: #fff;
  box-shadow: none;
}

.rtc-isolated-hangup {
  margin-inline-start: 14px;
  outline: 1px solid color-mix(in srgb, #ff6475, transparent 52%);
  outline-offset: 5px;
}

.rtc-call-workspace.is-active-call:not(.rtc-video-workspace) .page-scroll {
  min-height: 0;
  grid-template-rows: minmax(min-content, 1fr) auto;
  align-content: stretch;
  gap: 18px;
  overflow: auto;
  background:
    radial-gradient(620px 560px at 50% 43%, color-mix(in srgb, var(--primary), transparent 86%), transparent 72%),
    color-mix(in srgb, var(--bg), var(--surface) 4%);
}

.rtc-voice-stage {
  width: min(760px, 100%);
  min-height: 510px;
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 18px 24px;
  color: var(--ink);
}

.rtc-voice-call-meta {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.rtc-voice-status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 17px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 34%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft), transparent 18%);
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.rtc-voice-call-meta small {
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}

.rtc-voice-call-meta strong {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 38px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .02em;
}

.rtc-voice-peer {
  min-width: 0;
  max-width: 100%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
}

.rtc-voice-avatar-stage {
  position: relative;
  width: 226px;
  height: 226px;
  display: grid;
  place-items: center;
}

.rtc-voice-avatar-stage > i {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  border: 1px solid color-mix(in srgb, var(--primary), transparent 78%);
  border-radius: 999px;
  pointer-events: none;
}

.rtc-voice-avatar-stage > i:nth-child(2) {
  top: 31px;
  right: 31px;
  bottom: 31px;
  left: 31px;
  border-color: color-mix(in srgb, var(--primary), transparent 68%);
}

.rtc-voice-avatar-stage > i:nth-child(3) {
  top: 52px;
  right: 52px;
  bottom: 52px;
  left: 52px;
  border-color: color-mix(in srgb, var(--primary), transparent 56%);
}

.rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i {
  animation: rtc-voice-pulse 2.4s ease-in-out infinite;
}

.rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i:nth-child(2) {
  animation-delay: .25s;
}

.rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i:nth-child(3) {
  animation-delay: .5s;
}

.rtc-voice-avatar-stage .avatar {
  position: relative;
  z-index: 1;
  width: 126px;
  min-width: 126px;
  height: 126px;
  min-height: 126px;
  overflow: hidden;
  border: 5px solid color-mix(in srgb, var(--surface), #fff 72%);
  border-radius: 999px;
  box-shadow: 0 18px 52px color-mix(in srgb, var(--primary), transparent 64%);
}

.rtc-voice-peer > .identity-name-line {
  width: fit-content;
  max-width: min(100%, 420px);
  justify-content: center;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rtc-voice-peer .identity-display-name-text,
.rtc-voice-self-card .identity-display-name-text {
  flex: 0 1 auto;
}

.rtc-voice-peer .identity-name-line .certification-name-slot,
.rtc-voice-self-card .identity-name-line .certification-name-slot {
  flex: 0 1 auto;
  max-width: 45%;
  align-self: center;
}

.rtc-voice-peer .identity-name-line .verification-badge,
.rtc-voice-self-card .identity-name-line .verification-badge {
  flex: 0 1 auto;
  max-width: 100%;
  font-size: .72em;
}

.rtc-voice-peer .identity-name-line .verification-badge-icon,
.rtc-voice-self-card .identity-name-line .verification-badge-icon {
  width: 1.25em;
  height: 1.25em;
}

.rtc-voice-self-card {
  width: min(560px, 100%);
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), transparent 4%);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--bg), transparent 72%);
}

.rtc-voice-self-card .avatar {
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  border-radius: 999px;
}

.rtc-voice-self-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.rtc-voice-self-card strong {
  color: var(--ink);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.rtc-voice-self-card small {
  color: var(--ink-2);
}

.rtc-voice-controls {
  width: min(600px, 100%);
  min-width: 0;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface), transparent 2%);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--bg), transparent 62%);
}

.rtc-voice-control {
  min-width: 0;
  min-height: 122px;
  display: grid;
  grid-template-rows: 58px auto auto;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  touch-action: manipulation;
}

.rtc-voice-control > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong), transparent 10%);
}

.rtc-voice-control svg {
  width: 27px;
  height: 27px;
}

.rtc-voice-control strong {
  min-width: 0;
  color: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.rtc-voice-control small {
  min-width: 0;
  max-width: 100%;
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rtc-voice-control:hover:not(:disabled),
.rtc-voice-control.is-active {
  border-color: color-mix(in srgb, var(--primary), transparent 22%);
  background: color-mix(in srgb, var(--primary-soft), transparent 22%);
}

.rtc-voice-control:focus {
  border-color: var(--primary);
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 30%);
  outline-offset: 2px;
}

.rtc-voice-control:disabled {
  opacity: .68;
  cursor: not-allowed;
}

.rtc-voice-control.is-hangup > span {
  border-color: transparent;
  background: linear-gradient(135deg, #ff536c, #eb304e);
  color: #fff;
  box-shadow: 0 12px 28px rgba(235, 48, 78, .28);
}

.rtc-voice-control.is-hangup svg {
  transform: rotate(135deg);
}

@keyframes rtc-voice-pulse {
  0%, 100% { opacity: .58; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.02); }
}

@media (max-width: 760px) {
  .rtc-voice-stage {
    min-height: 430px;
    gap: 12px;
    padding: 10px 8px;
  }

  .rtc-voice-avatar-stage {
    width: 184px;
    height: 184px;
  }

  .rtc-voice-avatar-stage > i { top: 6px; right: 6px; bottom: 6px; left: 6px; }
  .rtc-voice-avatar-stage > i:nth-child(2) { top: 24px; right: 24px; bottom: 24px; left: 24px; }
  .rtc-voice-avatar-stage > i:nth-child(3) { top: 42px; right: 42px; bottom: 42px; left: 42px; }

  .rtc-voice-avatar-stage .avatar {
    width: 100px;
    min-width: 100px;
    height: 100px;
    min-height: 100px;
  }

  .rtc-voice-self-card {
    min-height: 92px;
    padding: 12px 14px;
  }

  .rtc-voice-self-card .avatar {
    width: 58px;
    min-width: 58px;
    height: 58px;
    min-height: 58px;
  }

  .rtc-voice-control {
    min-height: 104px;
    grid-template-rows: 48px auto auto;
    padding-inline: 4px;
  }

  .rtc-voice-control > span {
    width: 46px;
    height: 46px;
  }

  .rtc-voice-control svg {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 420px) {
  .rtc-call-workspace.is-active-call:not(.rtc-video-workspace) .page-scroll {
    gap: 10px;
    padding: 10px;
  }

  .rtc-voice-stage {
    min-height: 400px;
  }

  .rtc-voice-peer > .identity-name-line {
    font-size: 22px;
  }

  .rtc-voice-self-card {
    gap: 11px;
  }

  .rtc-voice-control strong {
    font-size: 12px;
  }

  .rtc-voice-control small {
    font-size: 10px;
  }
}

@media (-ms-high-contrast: active) {
  .rtc-voice-status-pill,
  .rtc-voice-avatar-stage .avatar,
  .rtc-voice-self-card,
  .rtc-voice-controls,
  .rtc-voice-control,
  .rtc-voice-control > span {
    border: 1px solid CanvasText;
  }

  .rtc-voice-control:focus {
    outline: 3px solid Highlight;
  }

  .rtc-voice-control.is-hangup > span {
    background: Highlight;
    color: HighlightText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rtc-voice-stage.is-pending .rtc-voice-avatar-stage > i {
    animation: none;
  }
}

.rtc-video-workspace .workspace-topbar .icon-action,
.rtc-video-workspace .workspace-topbar .detail-action {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
}

.rtc-control {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--raise);
  color: var(--ink);
  font-weight: 760;
}

.rtc-control.is-primary {
  min-width: 176px;
  border-color: transparent;
  background: var(--grad);
  color: #fff;
}

.rtc-control.is-off,
.call-answer.is-off {
  color: var(--warn);
}

.rtc-control:disabled {
  opacity: .52;
  cursor: wait;
}

.rtc-control svg {
  width: 19px;
  height: 19px;
}

.rtc-incoming-panel.is-video .rtc-call-actions {
  grid-template-columns: repeat(3, minmax(112px, 1fr));
}

.call-answer.is-audio,
.call-answer.is-secondary {
  border: 1px solid var(--line);
  background: var(--raise);
  color: var(--ink);
  box-shadow: none;
}

.call-answer.is-video {
  background: var(--grad);
  box-shadow: 0 16px 34px rgba(79, 140, 255, .28);
}

.rtc-video-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 28%);
  grid-template-rows: min(50vh, 420px) auto;
  grid-template-areas: "remote remote" "status local";
  gap: 8px;
  padding: 8px;
  min-height: min(660px, calc(100vh - 220px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-radius: 24px;
  background: #050914;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.rtc-video-workspace.is-active-call .rtc-video-stage {
  width: 100%;
  height: max-content;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 24px 24px 0 0;
  box-shadow: none;
}

.rtc-video-stage > .rtc-video-frame.is-remote {
  position: relative;
  grid-area: remote;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.rtc-video-stage-status {
  position: static;
  grid-area: status;
  align-self: center;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #33455f;
  border-radius: 999px;
  background: #111b2c;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.rtc-video-stage-status span,
.rtc-video-stage-status strong,
.rtc-video-frame-label,
.rtc-video-stage .rtc-video-fallback strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rtc-video-stage-status span {
  max-width: min(42vw, 28rem);
}

.rtc-video-stage-status strong {
  flex: 0 0 auto;
}

.rtc-video-stage-status strong {
  color: #8ebaff;
  font-variant-numeric: tabular-nums;
}

.rtc-video-local-pip {
  position: static;
  grid-area: local;
  justify-self: end;
  z-index: 3;
  width: min(100%, 260px);
  height: clamp(110px, 15vw, 180px);
}

.rtc-video-local-pip .rtc-video-frame {
  width: 100%;
  height: 100%;
  border-color: #50627e;
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .42);
}

.rtc-video-local-pip .rtc-video-fallback {
  padding: 12px;
}

.rtc-video-local-pip .rtc-video-fallback .avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.rtc-video-local-pip .rtc-video-fallback strong {
  font-size: 11px;
}

.rtc-video-dock {
  position: fixed;
  z-index: 79;
  right: 20px;
  bottom: 20px;
  width: min(400px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #344764;
  border-radius: 20px;
  background: #0a1220;
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

.rtc-video-dock-main {
  width: 100%;
  min-height: 152px;
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: #050914;
  color: inherit;
  text-align: left;
}

.rtc-video-dock-main > .rtc-video-frame {
  position: relative;
  height: 180px;
  max-height: 40vh;
  border: 0;
  border-radius: 0;
}

.rtc-video-dock-copy {
  position: static;
  z-index: 3;
  display: grid;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid #33455f;
  border-radius: 12px;
  background: #111b2c;
}

.rtc-video-dock-copy small {
  color: #b7c3d9;
  font-size: 11px;
}

.rtc-video-dock-copy em {
  color: #d8e2f2;
  font-size: 11px;
  font-style: normal;
}

.rtc-video-dock-states {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.rtc-video-dock-states b {
  padding: 3px 6px;
  border: 1px solid #465a77;
  border-radius: 999px;
  color: #dbe7fb;
  font-size: 9px;
  font-weight: 760;
}

.rtc-video-dock-avatar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  background: #091121;
}

.rtc-video-dock-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-top: 1px solid #344764;
  background: #344764;
}

.rtc-video-dock-actions button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: #101a2b;
  color: #fff;
  font-size: 13px;
  font-weight: 760;
}

.rtc-video-dock-actions button.is-danger {
  color: #ff7d8c;
}

.rtc-video-dock-actions svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 920px) {
  .rtc-contact-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rtc-contact-actions {
    grid-column: 1 / -1;
  }

  .rtc-contact-actions button {
    flex: 1;
    justify-content: center;
  }

  .rtc-video-preflight {
    min-height: auto;
    padding: 16px;
    border-radius: 18px;
  }

  .rtc-video-preflight > .rtc-video-frame {
    min-height: 300px;
  }

  .rtc-video-stage {
    min-height: min(560px, calc(100vh - 230px));
    border-radius: 18px;
  }

  .rtc-video-local-pip {
    width: min(100%, 190px);
  }

  .rtc-incoming-panel.is-video .rtc-call-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .rtc-video-workspace .page-scroll,
  .rtc-call-workspace .page-scroll {
    padding: 12px;
  }

  .rtc-video-preflight > .rtc-video-frame {
    min-height: 240px;
  }

  .rtc-video-preflight-actions .rtc-control {
    width: 100%;
  }

  .rtc-ended-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rtc-ended-summary > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .rtc-reversible-controls,
  .rtc-downgrade-action,
  .rtc-isolated-hangup {
    width: 100%;
  }

  .rtc-reversible-controls .call-answer {
    flex: 1 1 calc(50% - 10px);
  }

  .rtc-isolated-hangup {
    margin: 10px 0 0;
  }

  .rtc-video-stage {
    min-height: calc(100vh - 280px);
  }

  .rtc-video-local-pip {
    width: 100%;
  }

  .rtc-video-dock {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

/* Internal-only key-user marker. The DOM is emitted only after sidecar authorization. */
.key-user-marker {
  display: inline-grid;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-inline-start: 4px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #b7791f 42%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #f6c453 24%, var(--surface, #fff));
  color: #9a5b00;
  font-size: 9px;
  line-height: 1;
  vertical-align: 1px;
}

.key-user-name-line {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: inherit;
}

.conversation-card.key-user-row-accent,
.group-member-row.key-user-row-accent,
.member-card.key-user-row-accent,
.context-member-pill.key-user-row-accent,
.detail-member.key-user-row-accent {
  box-shadow: inset 2px 0 0 color-mix(in srgb, #d79a22 56%, transparent);
}

.conversation-card.key-user-row-accent:not(.is-active),
.group-member-row.key-user-row-accent,
.member-card.key-user-row-accent,
.context-member-pill.key-user-row-accent,
.detail-member.key-user-row-accent {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, #f6c453 6%, transparent),
    transparent 32%
  );
}

.key-user-profile-switch {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, #d79a22 30%, var(--line, #dfe4ea));
  border-radius: 14px;
  background: color-mix(in srgb, #f6c453 8%, var(--surface, #fff));
}

.key-user-profile-switch__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.key-user-profile-switch__label {
  font-weight: 750;
}

.key-user-profile-switch__value,
.key-user-profile-switch__explanation,
.key-user-profile-switch__status {
  color: var(--muted, #667085);
  font-size: 12px;
}

.key-user-profile-switch__explanation,
.key-user-profile-switch__status {
  min-height: 1em;
  margin: 0;
}

.key-user-profile-switch__control {
  display: inline-grid;
  width: 42px;
  height: 24px;
  padding: 2px;
  place-items: center start;
  border: 1px solid color-mix(in srgb, #9a5b00 34%, transparent);
  border-radius: 999px;
  background: var(--surface-muted, #e8edf3);
  color: #8a5a00;
  transition: background-color 120ms ease, color 120ms ease;
}

.key-user-profile-switch__control[aria-checked="true"] {
  place-items: center end;
  background: #d99b21;
  color: #fff;
}

.key-user-profile-switch__control:focus {
  outline: 3px solid color-mix(in srgb, #d99b21 38%, transparent);
  outline-offset: 2px;
}

.key-user-profile-switch__control:disabled {
  cursor: wait;
  opacity: .58;
}

[data-theme="midnight"] .key-user-marker,
[data-theme="aurora"] .key-user-marker {
  background: color-mix(in srgb, #f6c453 22%, #172033);
  color: #ffd978;
}

@media (max-width: 560px) {
  .key-user-profile-switch__line {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .key-user-profile-switch__value {
    grid-column: 1;
    grid-row: 2;
  }

  .key-user-profile-switch__control {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-key-account-spinner,
  .key-user-profile-switch__control {
    transition: none;
    animation: none;
  }
}

@media (-ms-high-contrast: active) {
  .chat-key-account-bar,
  .chat-key-account-list,
  .chat-key-account-item,
  .chat-key-account-state {
    border: 1px solid CanvasText;
  }

  .chat-key-account-head:focus,
  .chat-key-account-item:focus,
  .chat-key-account-state button:focus {
    outline-color: Highlight;
  }

  .key-user-marker,
  .key-user-profile-switch,
  .key-user-profile-switch__control {
    border: 1px solid ButtonText;
    forced-color-adjust: auto;
  }

  .key-user-row-accent {
    outline: 1px solid Highlight;
    outline-offset: -2px;
  }
}

/* User-selected display density. Keep shell columns and responsive breakpoints unchanged. */
.density-toggle button {
  min-width: 64px;
  min-height: 44px;
  justify-content: center;
}

body[data-display-density="compact"] .conversation-stack,
body[data-display-density="compact"] .plain-list,
body[data-display-density="compact"] .file-list,
body[data-display-density="compact"] .card-list {
  gap: 4px;
}

body[data-display-density="compact"] .conversation-card,
body[data-display-density="compact"] .plain-row,
body[data-display-density="compact"] .file-card {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
  padding: 7px 10px;
}

body[data-display-density="compact"] .conversation-card {
  grid-template-rows: 20px 20px;
  row-gap: 2px;
}

body[data-display-density="compact"] .conversation-card .avatar,
body[data-display-density="compact"] .plain-row .avatar,
body[data-display-density="compact"] .file-card .file-type,
body[data-display-density="compact"] .conversation-avatar-wrap {
  width: 40px;
  height: 40px;
}

body[data-display-density="compact"] .contact-row {
  min-height: 54px;
}

body[data-display-density="compact"] .setting-nav-row {
  min-height: 64px;
  padding: 9px 14px;
}

body[data-display-density="compact"] .set-row {
  padding-block: 10px;
}

body[data-display-density="compact"] .message-scroll {
  padding: 12px 20px 14px;
}

body[data-display-density="compact"] .message-flow {
  gap: 4px;
}

body[data-display-density="compact"] .message-row {
  gap: 8px;
}

/* Authoritative enterprise certification and in-conversation batch forwarding. */
.account-enterprise-certification.is-verified {
  border-color: color-mix(in srgb, #2f6fed 48%, var(--line));
  background: color-mix(in srgb, #2f6fed 10%, var(--surface));
}

.account-enterprise-certification.is-verified strong {
  color: color-mix(in srgb, #2f6fed 82%, var(--ink));
}

.account-enterprise-certification.is-loading strong,
.account-enterprise-certification.is-unavailable strong,
.account-enterprise-certification.is-inactive strong {
  color: var(--ink-3);
}

.batch-forward-inline-bar {
  flex: 0 0 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 8px 18px 18px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 48%);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong), var(--surface) 40%);
  box-shadow: var(--sh-sm);
}

.batch-forward-inline-bar p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 720;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-forward-inline-bar button {
  min-width: 64px;
  min-height: 44px;
}

.batch-forward-inline-actions {
  display: flex;
  gap: 8px;
}

.message-row.is-batch-forward-selecting {
  max-width: min(74%, 680px);
  padding: 0 0 0 52px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: outline-color .14s ease, background-color .14s ease;
}

.message-row.is-me.is-batch-forward-selecting {
  padding: 0 52px 0 0;
}

.message-row.is-batch-forward-selected {
  outline: 1px solid color-mix(in srgb, var(--primary), var(--line) 32%);
  outline-offset: 7px;
  background: color-mix(in srgb, var(--primary), transparent 90%);
}

.message-row.is-batch-forward-selecting .message-stack {
  pointer-events: none;
}

.message-row.is-me.is-batch-forward-selecting .message-stack::after {
  content: "";
  width: 1px;
  min-height: 22px;
}

.batch-forward-source-check {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 0;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(-50%);
}

.message-row.is-me .batch-forward-source-check {
  right: 0;
  left: auto;
}

.batch-forward-source-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.batch-forward-source-check span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink-3);
  border-radius: 8px;
  background: var(--surface);
  color: #fff;
  font-weight: 850;
}

.batch-forward-source-check input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
}

.batch-forward-source-check input:focus + span {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 35%);
  outline-offset: 3px;
}

.batch-forward-source-check.is-disabled {
  cursor: not-allowed;
  opacity: .48;
}

.modal-card.batch-forward-modal-card {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(90vh, 860px);
  max-height: min(90dvh, 860px);
  overflow: hidden;
  padding: 0;
  background: var(--surface);
}

.batch-forward-shell {
  color: var(--ink);
  background: var(--surface);
}

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

.batch-forward-header {
  background: color-mix(in srgb, var(--surface), var(--bg) 4%);
}

.batch-forward-title-block h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 780;
}

.batch-forward-title-block p,
.batch-forward-pane p,
.batch-forward-delivery-summary span,
.batch-forward-selected-targets-head p {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.batch-forward-icon-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 0;
}

.batch-forward-icon-button svg {
  width: 18px;
  height: 18px;
}

.batch-forward-shell button,
.batch-forward-shell [role="tab"],
.batch-forward-shell summary {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}

.batch-forward-shell button {
  min-height: 44px;
  padding: 8px 12px;
}

.batch-forward-shell button:hover:not(:disabled),
.batch-forward-shell summary:hover,
.batch-forward-shell [role="tab"]:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary), var(--line) 42%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 72%);
  color: var(--ink);
}

.batch-forward-shell button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.batch-forward-pane {
  background: color-mix(in srgb, var(--surface-soft), var(--surface) 34%);
}

/* Keep pagination at the selector bottom; an empty selected summary must not
   reserve a blank row below it. The result list owns the remaining height. */
.batch-forward-webchat .batch-forward-target-pane {
  display: flex;
  flex-direction: column;
}

.batch-forward-webchat .batch-forward-target-heading-row {
  flex: 0 0 auto;
}

.batch-forward-webchat .batch-forward-target-pane > [data-batch-forward-selected-slot] {
  order: 1;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

.batch-forward-webchat .batch-forward-target-pane > [data-batch-forward-selected-slot]:empty {
  display: none;
}

.batch-forward-webchat .batch-forward-target-pane > .batch-forward-target-panel {
  order: 2;
  flex: 1 1 0;
}

.batch-forward-pane h3,
.batch-forward-pane h4 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.batch-forward-pane [role="tablist"] {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 36%);
}

.batch-forward-target-heading-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-forward-target-heading-row .batch-forward-pane-head {
  flex: 1 1 auto;
}

.batch-forward-target-heading-row [role="tablist"] {
  flex: 0 1 auto;
  gap: 4px;
}

.batch-forward-pane [role="tab"] {
  flex: 1 1 0;
  min-width: 54px;
  min-height: 34px;
  padding: 5px 9px;
}

.batch-forward-pane [role="tab"][aria-selected="true"] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 30%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 52%);
  color: var(--primary);
  font-weight: 760;
}

.batch-forward-pane label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
}

.batch-forward-pane input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
}

.batch-forward-row,
.batch-forward-message-preview-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 8px 10px;
}

.batch-forward-row {
  cursor: pointer;
}

.batch-forward-row[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--primary), var(--line) 26%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 58%);
}

.batch-forward-row[aria-disabled="true"] {
  cursor: not-allowed;
}

.batch-forward-row-copy strong,
.batch-forward-selected-label-text {
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
}

.batch-forward-row-copy small,
.batch-forward-row-copy time {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.batch-forward-row-copy em {
  margin-top: 4px;
  color: var(--danger);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.batch-forward-target-icon[data-target-kind="group"] {
  background: color-mix(in srgb, var(--primary), var(--surface) 88%);
  color: var(--primary);
}

.batch-forward-target-icon[data-target-kind="direct"] {
  background: color-mix(in srgb, var(--ok), var(--surface) 88%);
  color: color-mix(in srgb, var(--ok), var(--ink) 20%);
}

.batch-forward-target-icon {
  overflow: hidden;
}

.batch-forward-target-icon .avatar, .batch-forward-target-icon .av {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: inherit;
}

.batch-forward-target-icon .avatar img, .batch-forward-target-icon .av img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.batch-forward-selected-targets {
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.batch-forward-selected-targets-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.batch-forward-selected-targets-heading-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.batch-forward-selected-preview-item,
.batch-forward-selected-more,
.batch-forward-selected-remove,
.batch-forward-chip-list button {
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 56%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 62%);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  padding: 4px 8px 4px 5px;
}

.batch-forward-selected-more {
  justify-content: center;
  min-width: 48px;
  padding-inline: 10px;
  color: var(--primary);
  font-weight: 780;
}

.batch-forward-selected-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.batch-forward-selected-label .batch-forward-target-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.batch-forward-selected-label .batch-forward-target-icon svg {
  width: 15px;
  height: 15px;
}

.batch-forward-selected-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-forward-selected-manage {
  flex: 0 0 auto;
  min-width: 0;
  border-top: 0;
  padding-top: 0;
}

.batch-forward-selected-manage[open] {
  border-color: var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

body[data-theme="midnight"] .batch-forward-selected-manage[open] {
  background: #121826;
}

body[data-theme="aurora"] .batch-forward-selected-manage[open],
body[data-theme="teal"] .batch-forward-selected-manage[open],
body[data-theme="graphite"] .batch-forward-selected-manage[open] {
  background: #ffffff;
}

.batch-forward-selected-manage summary {
  width: fit-content;
  min-height: 34px;
  padding: 5px 10px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 760;
}

.batch-forward-selected-manage-list {
  margin-top: 8px;
}

.batch-forward-selected-remove {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
  background: var(--surface);
}

.batch-forward-selected-remove svg,
.batch-forward-chip-list button svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.batch-forward-delivery-summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.batch-forward-limit-warning {
  color: var(--danger) !important;
  white-space: normal !important;
}

.batch-forward-footer-actions [data-batch-forward-action="confirm"] {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  font-weight: 760;
}

.batch-forward-status {
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.batch-forward-source-preview time {
  color: var(--ink-3);
  font-size: 11px;
}

.batch-forward-status.is-error,
.batch-forward-status.is-uncertain {
  background: color-mix(in srgb, var(--danger), var(--surface) 88%);
  color: var(--danger);
}

.batch-forward-status.is-offline {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.batch-forward-status.is-success {
  background: color-mix(in srgb, var(--ok), var(--surface) 88%);
  color: color-mix(in srgb, var(--ok), var(--ink) 20%);
}

.batch-forward-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface), transparent 18%);
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

body[data-theme="midnight"] .batch-forward-shell {
  background: color-mix(in srgb, var(--surface), #050812 8%);
}

body[data-theme="midnight"] .batch-forward-pane {
  background: color-mix(in srgb, var(--surface-soft), transparent 6%);
}

body[data-theme="midnight"] .batch-forward-row,
body[data-theme="midnight"] .batch-forward-message-preview-row,
body[data-theme="midnight"] .batch-forward-selected-remove {
  background: color-mix(in srgb, var(--surface), transparent 4%);
}

body[data-theme="aurora"] .batch-forward-shell,
body[data-theme="teal"] .batch-forward-shell,
body[data-theme="graphite"] .batch-forward-shell {
  background: var(--surface);
}

@media (max-width: 1280px) {
  .modal-card.batch-forward-modal-card {
    width: min(1040px, calc(100vw - 28px));
  }
}

@media (max-width: 1024px) {
  .modal-card.batch-forward-modal-card {
    width: min(940px, calc(100vw - 24px));
  }
}

@media (max-width: 620px) {
  .batch-forward-inline-bar {
    margin: 8px 10px 12px;
  }
}

@media (max-width: 480px) {
  .batch-forward-inline-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .batch-forward-inline-bar p {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .batch-forward-inline-cancel {
    grid-column: 1;
    grid-row: 2;
  }

  .batch-forward-inline-actions {
    grid-column: 2;
    grid-row: 2;
  }

  .batch-forward-inline-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .message-row.is-batch-forward-selecting,
  .message-row.is-batch-forward-selecting.is-me {
    width: min(100%, 680px);
    max-width: 94%;
  }
}

@media (-ms-high-contrast: active) {
  .message-row.is-batch-forward-selected,
  .batch-forward-inline-bar,
  .batch-forward-source-check span {
    border-color: Highlight;
  }

  .batch-forward-source-check input:checked + span {
    background: Highlight;
    color: HighlightText;
  }
}

/* Frozen responsive shell contract: 1180 detail overlay, 960 two-column,
   620 top navigation/single-column, 480 action reflow. Keep this final so
   legacy theme blocks cannot silently restore the obsolete 760px shell. */
@media (max-width: 960px) {
  :root {
    --rail-w: 64px;
    --mobile-side-w: min(340px, calc(100vw - var(--rail-w) - 24px));
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"],
  .im-shell[data-view="rtc"]:not(.is-detail-open),
  .im-shell[data-view="files"].is-detail-open,
  .im-shell[data-view="settings"].is-detail-open {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .side-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: var(--rail-w);
    width: var(--mobile-side-w);
    transform: translateX(calc(-100% - var(--rail-w)));
    visibility: hidden;
    pointer-events: none;
    transition: transform .18s ease, visibility 0s linear .18s;
    border-left: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface), #050812 12%);
  }

  .im-shell.is-list-open .side-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .list-scrim {
    position: fixed;
    z-index: 58;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(var(--rail-w) + var(--mobile-side-w));
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--scrim);
  }

  .list-toggle {
    display: inline-grid;
  }
}

@media (max-width: 620px) {
  :root {
    --rail-h: 64px;
    --mobile-side-w: min(360px, 100vw);
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"],
  .im-shell[data-view="rtc"]:not(.is-detail-open),
  .im-shell[data-view="files"].is-detail-open,
  .im-shell[data-view="settings"].is-detail-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--rail-h) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }

  .app-rail {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: var(--rail-h);
    height: var(--rail-h);
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-nav,
  .rail-footer {
    width: auto;
    flex-direction: row;
    gap: 2px;
  }

  .rail-nav {
    min-width: 0;
    flex: 1;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-footer {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
  }

  .rail-item,
  .rail-user {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
  }

  .rail-item.is-active::before {
    top: auto;
    right: 12px;
    bottom: -6px;
    left: 12px;
    width: auto;
    height: 3px;
  }

  .workspace {
    grid-column: 1;
    grid-row: 2;
  }

  .side-panel {
    top: var(--rail-h);
    left: 0;
    width: var(--mobile-side-w);
    transform: translateX(-104%);
    border-left: 0;
  }

  .list-scrim {
    top: var(--rail-h);
    right: 0;
    bottom: 0;
    left: var(--mobile-side-w);
  }

  .context-panel {
    top: var(--rail-h);
    width: 100vw;
  }

  .context-scrim {
    top: var(--rail-h);
    left: 0;
  }

  .mention-popover {
    left: 12px;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-side-w: 100vw;
  }

  .rtc-call-workspace .page-scroll {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .rtc-incoming-panel {
    width: 100%;
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "avatar"
      "copy"
      "actions";
    align-items: stretch;
    gap: 18px;
    padding: 20px 16px;
  }

  .rtc-incoming-panel .incoming-pulse-stage,
  .rtc-incoming-panel .rtc-call-copy {
    justify-self: center;
  }

  .rtc-incoming-panel .rtc-call-copy {
    text-align: center;
  }

  .rtc-incoming-panel.is-video .rtc-call-actions,
  .rtc-incoming-panel .rtc-call-actions {
    position: relative;
    z-index: 1;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .list-scrim {
    display: none;
  }

  .workspace-topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .topbar-title {
    flex: 1 1 100%;
  }

  .topbar-actions,
  .message-actions,
  .composer-toolbar,
  .composer-footer,
  .composer-actions {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .composer-input-row {
    flex-wrap: wrap;
  }

  .composer-input {
    flex: 1 1 calc(100% - 52px);
  }

  .attachment-file-card,
  .attachment-image-card,
  .attachment-video-card,
  .message-media {
    max-width: 100%;
  }

  .attachment-media-error-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .attachment-media-error-actions button,
  .attachment-file-action,
  .file-transfer-actions button,
  .attachment-confirm-modal footer button,
  .media-viewer-tools button {
    width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .attachment-file-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .attachment-file-action {
    grid-column: 1 / -1;
    max-width: none;
    text-align: center;
  }

  .composer-transfer-item,
  .composer-transfer-item.is-failed {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-transfer-actions,
  .attachment-confirm-modal footer,
  .media-viewer-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
}

/* Browser zoom can leave the layout viewport one device pixel narrower than
   100vw. Keep the shell parent-sized at the 200% ultra-narrow boundary so
   that rounding and fixed overlays cannot create page-level x overflow. */
@media (max-width: 320px) {
  html,
  body,
  #chat-root {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  .im-shell,
  .im-shell.is-detail-open,
  .im-shell[data-view="files"],
  .im-shell[data-view="settings"],
  .im-shell[data-view="rtc"],
  .im-shell[data-view="rtc"]:not(.is-detail-open),
  .im-shell[data-view="files"].is-detail-open,
  .im-shell[data-view="settings"].is-detail-open {
    width: 100%;
    max-width: 100%;
  }

  .workspace,
  .workspace-topbar,
  .topbar-title,
  .topbar-actions,
  .chat-top-stack,
  .message-stage,
  .message-scroll,
  .message-flow,
  .composer-panel,
  .composer-shell,
  .composer-footer,
  .composer-input-row {
    min-width: 0;
    max-width: 100%;
  }

  .topbar-title h1,
  .topbar-title p {
    overflow-wrap: anywhere;
  }
}

/* Six 44px primary targets cannot share a 240px top rail in one row. The
   navigation stays a top rail and uses a second row for the account control,
   keeping every target visible without shrinking its accessible hit area. */
@media (max-width: 260px) {
  :root {
    --rail-h: 112px;
  }

  .app-rail {
    min-height: var(--rail-h);
    height: var(--rail-h);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
  }

  .rail-nav {
    width: 100%;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    justify-items: center;
    gap: 0;
    overflow-x: visible;
  }

  .rail-footer {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin: 0;
  }

  .rail-item,
  .rail-user {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .rail-item.is-active::before {
    bottom: -2px;
  }
}

/* Overlay panels need an opaque theme surface: --surface is translucent in
   the dark workbench and otherwise lets the underlying page show through. */
@media (max-width: 1180px) {
  body[data-theme] .context-panel {
    background: var(--layer-surface);
  }
}

@media (max-width: 960px) {
  body[data-theme] .side-panel {
    background: var(--layer-surface);
  }
}

/* Size content against its available pane, including when desktop details are
   open. The existing visibility/breakpoint contract above remains authoritative. */
.composer-footer {
  flex-wrap: wrap;
}

.composer-toolbar {
  min-width: 0;
  flex-basis: 240px;
}

body[data-theme] .composer-enter-mode-control {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 44px;
  min-height: 36px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body[data-theme] .composer-enter-mode-control:hover:not(:disabled) {
  color: var(--ink);
}

body[data-theme] .composer-enter-mode-control:focus {
  outline: 2px solid var(--ink-2);
  outline-offset: 2px;
}

body[data-theme] .composer-enter-mode-control:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
  text-decoration: none;
}

.message-stack .message-voice {
  min-width: 0;
  max-width: min(320px, 100%);
}

.message-stack .voice-message-body {
  grid-template-columns: minmax(0, 1fr) auto;
}

.message-stack .voice-waveform {
  min-width: 0;
}

.modal-layer {
  grid-template-columns: minmax(0, 1fr);
}

.modal-card {
  min-width: 0;
  max-width: 100%;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
}

.modal-card footer {
  flex-wrap: wrap;
}

/* Member profiles have four sections, unlike the generic three-row dialog.
   Do not squeeze the avatar/name section into the generic flexible row. */
.modal-card.member-profile-modal {
  grid-template-rows: none;
  grid-auto-rows: max-content;
  overflow-y: auto;
}

.media-viewer-modal {
  max-width: 100%;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
}

.media-viewer-modal:not(.user-avatar-preview-modal) {
  grid-template-rows: auto max-content auto;
}

/* Keep the message viewport inside the workspace: read visibility and message
   menus are anchored to .message-scroll. Only ancillary content may scroll. */
.chat-workspace .message-stage {
  flex: 1 0 min(96px, 20vh);
  flex: 1 0 min(96px, 20dvh);
  min-height: min(96px, 20vh);
  min-height: min(96px, 20dvh);
}

.chat-workspace .composer-panel {
  display: flex;
  flex: 0 1 auto;
  min-height: min(80px, 20vh);
  min-height: min(80px, 20dvh);
}

.chat-workspace .composer-shell {
  min-height: 0;
  overflow-y: auto;
  grid-auto-rows: max-content;
}

/* Search is an out-of-flow child of this stack. Scroll only the normal-flow
   status regions so their ancestor cannot clip the search overlay. */
.chat-top-stack {
  flex-shrink: 0;
  max-height: 20%;
}

.chat-top-stack > :not(.message-search-panel) {
  min-height: 0;
  overflow-y: auto;
}

.message-search-panel {
  max-height: 60vh;
  max-height: 60dvh;
  overflow-y: auto;
  grid-auto-rows: max-content;
}

/* When status strips also occupy a very short mobile pane, share the remaining
   height without making the workspace itself scroll when a control is focused. */
@media (max-width: 480px) and (max-height: 400px) {
  .chat-workspace:has(.chat-top-stack > :not(.message-search-panel)) .message-stage {
    flex-shrink: 1;
    min-height: 32px;
  }

  .chat-workspace:has(.chat-top-stack > :not(.message-search-panel)) .composer-panel {
    min-height: 44px;
  }
}

/* Older Chromium lacks relational selectors. In very short panes reserve
   usable message/input space conservatively, without scrolling the workspace. */
@supports not selector(:has(*)) {
  @media (max-width: 480px) and (max-height: 400px) {
    .chat-workspace .message-stage { flex-shrink: 1; min-height: 32px; }
    .chat-workspace .composer-panel { min-height: 44px; }
  }
}

@media (max-width: 720px), (max-height: 520px) {
  .message-search-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    left: 12px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-height: 520px) {
  .emoji-popover {
    bottom: 12px;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    min-height: 0;
  }

  .media-viewer-stage,
  .user-avatar-preview-stage,
  .user-avatar-preview-frame {
    min-height: min(40vh, 200px);
    min-height: min(40dvh, 200px);
  }

  .media-viewer-frame img,
  .media-viewer-frame video {
    max-width: 100%;
    max-height: 40vh;
    max-height: 40dvh;
  }
}

@media (min-width: 621px) and (max-height: 520px) {
  .app-rail {
    overflow-y: auto;
  }

  .rail-nav,
  .rail-footer {
    flex-shrink: 0;
  }
}

/* Unified authoritative identity presentation: verification and group members. */
.certification-name-slot {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(10rem, 48%);
  align-self: baseline;
  vertical-align: baseline;
}

.identity-name-line {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  vertical-align: baseline;
}

.identity-display-name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-metadata-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.verification-badge {
  --verification-accent: #285fb8;
  --verification-on-accent: #fff;
  --verification-surface: color-mix(in srgb, var(--verification-accent) 8%, var(--surface, #fff));
  --verification-border: color-mix(in srgb, var(--verification-accent) 28%, var(--line, transparent));
  --verification-label-limit: 9em;
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: min(100%, 12em);
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 2px 7px 2px 5px;
  border: 1px solid var(--verification-border);
  border-radius: 999px;
  background: var(--verification-surface);
  color: var(--verification-accent);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 740;
  line-height: 1.2;
  vertical-align: baseline;
  white-space: nowrap;
}

.verification-badge-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  place-items: center;
  color: var(--verification-accent);
}

.verification-badge-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.verification-badge-icon path:first-child {
  fill: currentColor;
  stroke: none;
}

.verification-badge-icon path:last-child {
  fill: none;
  stroke: var(--verification-on-accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verification-badge-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
}

.verification-badge-label {
  min-width: 0;
  max-width: var(--verification-label-limit);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verification-badge-source {
  display: none;
  min-width: 0;
  color: color-mix(in srgb, var(--verification-accent) 72%, var(--ink-2, #566177));
  font-size: 10px;
  font-weight: 620;
  line-height: 1.25;
}

.verification-badge.is-compact {
  --verification-label-limit: 7em;
  gap: 3px;
  min-height: 17px;
  padding: 1px 5px 1px 3px;
  font-size: 9px;
}

.verification-badge.is-compact .verification-badge-icon {
  width: 12px;
  height: 12px;
}

.verification-badge.is-standard {
  --verification-label-limit: 9em;
  min-height: 21px;
  font-size: 11px;
}

.verification-badge.is-detail {
  --verification-label-limit: none;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  gap: 8px;
  padding: 7px 11px 7px 8px;
  border-radius: 12px;
  font-size: 12px;
  white-space: normal;
}

.verification-badge.is-detail .verification-badge-icon {
  width: 21px;
  height: 21px;
}

.verification-badge.is-detail .verification-badge-copy {
  display: grid;
  gap: 2px;
}

.verification-badge.is-detail .verification-badge-label {
  max-width: 22em;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.verification-badge.is-detail .verification-badge-source {
  display: block;
}

[data-theme="midnight"] .verification-badge,
[data-theme="aurora"] .verification-badge {
  --verification-accent: #9dc0ff;
  --verification-on-accent: #10213d;
  --verification-surface: color-mix(in srgb, #5d91ee 18%, var(--surface, #172033));
  --verification-border: color-mix(in srgb, #9dc0ff 42%, var(--line, transparent));
}

/* A verified detail uses the same badge, not a page-private blue text box. */
.account-enterprise-certification {
  grid-column: 1 / -1;
}

.account-enterprise-certification.is-verified {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-soft), transparent 18%);
}

.account-certification-value {
  display: block;
  min-width: 0;
}

.account-info-list > span .verification-badge {
  width: fit-content;
  max-width: 100%;
}

.account-profile-card:not(.is-signed-out) {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "account-avatar account-name";
  align-items: center;
  column-gap: 14px;
}

.account-profile-card:not(.is-signed-out) > .identity-avatar-presence {
  grid-area: account-avatar;
}

.account-profile-card:not(.is-signed-out) > .account-name-block {
  grid-area: account-name;
  width: 100%;
}

.account-name-block .identity-name-line {
  flex: 0 1 auto;
}

/* Member rows reserve explicit avatar, primary, metadata, and action slots. */
.member-layout-row {
  --member-avatar-column: 40px;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--member-avatar-column) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.member-avatar-slot {
  width: var(--member-avatar-column);
  height: var(--member-avatar-column);
  min-width: var(--member-avatar-column);
  align-self: center;
}

.member-layout-row .member-avatar-slot > .avatar {
  width: 100%;
  height: 100%;
  min-width: 100%;
}

.member-primary-slot {
  min-width: 0;
  display: grid;
  justify-items: stretch;
  gap: 4px;
}

.member-primary-slot .identity-name-line {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 3px;
}

.member-primary-slot .certification-name-slot {
  width: fit-content;
  max-width: 100%;
  align-self: start;
}

.member-primary-slot .verification-badge {
  max-width: 100%;
}

.member-metadata-slot {
  min-height: 18px;
  justify-content: flex-start;
  overflow: hidden;
}

.member-metadata-slot .role-badge {
  max-width: 100%;
  min-width: 0;
}

.member-action-slot {
  width: 22px;
  height: 22px;
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  color: var(--ink-3);
}

.member-action-slot svg {
  width: 15px;
  height: 15px;
}

.member-grid,
.detail-member-strip {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
}

/* The group profile preview is one stable row of four equal identity tiles. */
.group-members-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.group-members-list .group-member-row.member-layout-row {
  min-height: 112px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--member-avatar-column) minmax(0, 1fr);
  align-items: start;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  text-align: center;
}

.group-members-list .member-primary-slot {
  width: 100%;
  justify-items: center;
  gap: 3px;
}

.group-members-list .identity-name-line {
  min-height: 35px;
  justify-items: center;
  align-content: start;
  gap: 2px;
}

.group-members-list .identity-display-name-text,
.group-members-list .certification-name-slot,
.group-members-list .verification-badge,
.group-members-list .verification-badge-copy,
.group-members-list .verification-badge-label {
  max-width: 100%;
}

.group-members-list .member-metadata-slot {
  justify-content: center;
}

.group-members-list .member-action-slot {
  display: none;
}

.member-card.member-layout-row,
.group-member-row.member-layout-row,
.context-member-pill.member-layout-row,
.detail-member.member-layout-row {
  min-height: 62px;
  place-items: initial;
  align-content: normal;
  justify-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 4%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), var(--surface-soft) 40%);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.member-card.member-layout-row:hover,
.group-member-row.member-layout-row:hover,
.context-member-pill.member-layout-row:hover,
.detail-member.member-layout-row:hover {
  border-color: color-mix(in srgb, var(--primary), var(--line) 62%);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 76%);
  transform: none;
}

.member-layout-row:focus {
  outline: 3px solid color-mix(in srgb, var(--primary), transparent 56%);
  outline-offset: 2px;
}

.member-card-copy .identity-metadata-line,
.detail-member-copy,
.detail-member-copy .identity-metadata-line {
  justify-content: flex-start;
  text-align: left;
}

.member-role-hero > div {
  min-width: 0;
}

.member-role-modal footer {
  flex-wrap: wrap;
}

.member-role-modal footer button {
  flex: 1 1 132px;
  min-width: 0;
}

.detail-member-more {
  width: 100%;
  min-height: 62px;
  height: auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 8px;
  border-radius: 14px;
}

@media (max-width: 560px) {
  .certification-name-slot {
    max-width: 44%;
  }

  .verification-badge {
    --verification-label-limit: 7em;
    max-width: min(100%, 8.5em);
  }

  .verification-badge.is-compact {
    --verification-label-limit: 5.8em;
  }

  .verification-badge.is-detail {
    width: 100%;
    max-width: 100%;
  }

  .account-profile-card:not(.is-signed-out) {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "account-avatar account-name";
    justify-items: stretch;
    text-align: left;
  }

  .member-layout-row {
    --member-avatar-column: 36px;
    gap: 8px;
  }

  .member-grid,
  .detail-member-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-members-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .group-members-list .role-badge {
    gap: 3px;
    padding-inline: 2px;
    font-size: 10px;
  }
}

@media (-ms-high-contrast: active) {
  .presence-dot,
  .avatar-presence,
  .contact-presence,
  .status-dot::before,
  .inline-status > i,
  .behavior-live-state > i {
    border-color: Canvas;
    outline: 1px solid CanvasText;
    background: var(--soft);
    forced-color-adjust: none;
  }

  .presence-dot[data-status="online"],
  .avatar-presence[data-status="online"],
  .contact-presence[data-status="online"],
  .status-dot[data-status="online"]::before,
  .inline-status[data-status="online"] > i,
  .behavior-live-state[data-status="online"] > i {
    background: var(--ok);
  }

  .verification-badge {
    border: 2px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }

  .verification-badge-icon {
    color: CanvasText;
  }

  .verification-badge-icon path:last-child {
    stroke: Canvas;
  }

  .verification-badge-source {
    color: CanvasText;
  }

  .member-layout-row {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }
}

/* Certification label scheme 3: a stable check-and-label identity line. */
.verification-badge,
.identity-name-line .verification-badge,
.conversation-body .verification-badge,
.profile-large .verification-badge,
.account-info-list .verification-badge,
.certification-name-slot .verification-badge {
  --verification-accent: #245ca8;
  --verification-label-limit: 16em;
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 18em);
  min-height: 18px;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--verification-accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.3;
  text-align: left;
  vertical-align: baseline;
  white-space: nowrap;
}

.verification-badge-icon,
.identity-name-line .verification-badge-icon,
.conversation-body .verification-badge-icon,
.profile-large .verification-badge-icon,
.account-info-list .verification-badge-icon,
.certification-name-slot .verification-badge-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  place-items: center;
  color: currentColor;
}

.verification-badge-icon svg,
.verification-badge-icon path {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: currentColor;
  stroke: none;
}

.verification-badge .verification-badge-icon path:first-child:last-child {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}

.verification-badge-copy,
.identity-name-line .verification-badge-copy,
.conversation-body .verification-badge-copy,
.profile-large .verification-badge-copy,
.account-info-list .verification-badge-copy,
.certification-name-slot .verification-badge-copy {
  display: flex;
  min-width: min(3.5em, 100%);
  max-width: 100%;
  align-items: baseline;
}

.verification-badge-label,
.identity-name-line .verification-badge-label,
.conversation-body .verification-badge-label,
.profile-large .verification-badge-label,
.account-info-list .verification-badge-label,
.certification-name-slot .verification-badge-label {
  display: block;
  min-width: 0;
  max-width: var(--verification-label-limit);
  overflow: hidden;
  color: currentColor;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verification-badge.is-compact,
.identity-name-line .verification-badge.is-compact,
.conversation-body .verification-badge.is-compact,
.certification-name-slot .verification-badge.is-compact {
  --verification-label-limit: 11em;
  min-height: 17px;
  gap: 3px;
  font-size: 10px;
}

.verification-badge.is-compact .verification-badge-icon,
.identity-name-line .verification-badge.is-compact .verification-badge-icon,
.conversation-body .verification-badge.is-compact .verification-badge-icon,
.certification-name-slot .verification-badge.is-compact .verification-badge-icon {
  width: 13px;
  height: 13px;
}

.verification-badge.is-detail {
  --verification-label-limit: none;
  flex: 1 1 100%;
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  gap: 6px;
  padding: 0;
  font-size: 12px;
  white-space: normal;
}

.verification-badge.is-detail .verification-badge-copy {
  display: flex;
  min-width: 0;
}

.verification-badge.is-detail .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  line-break: strict;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
}

.certification-name-slot:has(.verification-badge.is-detail) {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
}

.identity-name-line:has(.verification-badge.is-detail) {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 4px;
}

/* Member popovers keep the badge next to the name; profile details center it below. */
.member-popover-head .identity-display-name-text,
.member-profile-hero .identity-display-name-text {
  flex: 0 1 auto;
}

.member-profile-hero h2.identity-name-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
  white-space: normal;
}

.member-profile-hero .certification-name-slot {
  order: 1;
  flex: 0 0 100%;
  max-width: 100%;
  justify-content: center;
}

.member-profile-hero .certification-name-slot .verification-badge {
  flex: 0 1 auto;
  justify-content: center;
  text-align: center;
}

.verification-badge:focus {
  outline: 2px solid color-mix(in srgb, var(--verification-accent), transparent 35%);
  outline-offset: 3px;
  border-radius: 4px;
}

.verification-badge:not(.is-detail):focus {
  flex: 1 1 100%;
  max-width: 100%;
  white-space: normal;
}

.verification-badge:not(.is-detail):focus .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
}

.identity-name-line:has(.verification-badge:focus),
.certification-name-slot:has(.verification-badge:focus) {
  position: relative;
  z-index: 80;
  overflow: visible;
}

.identity-name-line:has(.verification-badge:focus) {
  flex-wrap: wrap;
}

body[data-theme="aurora"] .verification-badge {
  --verification-accent: #1f5aa6;
  color: var(--verification-accent);
}

body[data-theme="midnight"] .verification-badge,
[data-theme="midnight"] .verification-badge {
  --verification-accent: #9fc4ff;
  color: var(--verification-accent);
}

@media (max-width: 560px) {
  .certification-name-slot {
    max-width: 52%;
  }

  .verification-badge,
  .identity-name-line .verification-badge,
  .conversation-body .verification-badge {
    --verification-label-limit: 9em;
    max-width: 100%;
  }

  .verification-badge.is-compact,
  .identity-name-line .verification-badge.is-compact,
  .conversation-body .verification-badge.is-compact {
    --verification-label-limit: 7em;
  }

  .certification-name-slot:has(.verification-badge.is-detail) {
    max-width: 100%;
  }

  .group-members-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (-ms-high-contrast: active) {
  .verification-badge {
    border: 0;
    background: transparent;
    color: LinkText;
    forced-color-adjust: auto;
  }

  .verification-badge:focus {
    outline: 2px solid Highlight;
  }

  .verification-badge .verification-badge-icon path:first-child:last-child {
    fill: LinkText;
    stroke: none;
  }
}

/* Server-owned private RTC terminal record. */
.is-rtc-call-record-bubble{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important}
.rtc-call-record-card{--rtc-record-bg:var(--surface-soft,#f6f8fc);--rtc-record-border:var(--line,#dfe5ef);--rtc-record-copy:var(--ink-1,#172033);--rtc-record-muted:var(--ink-3,#667085);--rtc-record-accent:var(--primary,#246bfe);display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:9px;width:min(320px,100%);min-height:58px;padding:9px 11px;border:1px solid var(--rtc-record-border);border-radius:13px;background:var(--rtc-record-bg);color:var(--rtc-record-copy);font:inherit;text-align:left;cursor:pointer;transition:border-color 140ms ease,box-shadow 140ms ease,transform 140ms ease}.rtc-call-record-card:hover{border-color:color-mix(in srgb,var(--rtc-record-accent) 55%,var(--rtc-record-border));transform:translateY(-1px)}.rtc-call-record-card:focus{outline:3px solid color-mix(in srgb,var(--rtc-record-accent) 32%,transparent);outline-offset:2px;border-color:var(--rtc-record-accent)}.rtc-call-record-card:disabled{cursor:wait;opacity:.72;transform:none}
.rtc-call-record-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;color:var(--rtc-record-accent);background:color-mix(in srgb,var(--rtc-record-accent) 12%,transparent)}.rtc-call-record-svg{width:20px;height:20px}.rtc-call-record-copy{display:grid;min-width:0;gap:2px}.rtc-call-record-copy strong{color:var(--rtc-record-copy);font-size:13px;font-weight:650}.rtc-call-record-status{overflow:hidden;color:var(--rtc-record-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.rtc-call-record-ended-at{color:var(--rtc-record-muted);font-size:11px;line-height:1.25}.rtc-call-record-card.is-danger .rtc-call-record-status{color:var(--danger,#d33f49)}.rtc-call-record-card.is-warning .rtc-call-record-status{color:var(--warn,#b46b16)}
.rtc-call-record-redial{color:var(--rtc-record-accent);font-size:12px;font-weight:650;white-space:nowrap}.rtc-call-record-direction{display:inline-flex;align-items:center;margin-left:3px;padding:1px 5px;border-radius:999px;background:color-mix(in srgb,var(--rtc-record-accent) 11%,transparent);color:var(--rtc-record-accent);font-size:10px;font-weight:750;line-height:1.4;vertical-align:1px}.rtc-call-record-card.viewport-narrow{grid-template-columns:32px minmax(0,1fr);width:min(274px,calc(100vw - 102px));min-height:54px;padding:8px 10px}.rtc-call-record-card.viewport-narrow .rtc-call-record-redial{grid-column:2}.rtc-call-record-card.viewport-narrow .rtc-call-record-status{overflow:visible;text-overflow:clip;white-space:normal}.rtc-call-record-fallback{color:var(--muted,#667085);font-size:13px}
@media (prefers-reduced-motion:reduce){.rtc-call-record-card{transition:none}.rtc-call-record-card:hover{transform:none}}
@media (-ms-high-contrast: active){.rtc-call-record-card{border:1px solid ButtonText;background:Canvas;color:CanvasText}.rtc-call-record-card:focus{outline:3px solid Highlight}.rtc-call-record-direction,.rtc-call-record-icon{border:1px solid ButtonText;background:Canvas;color:CanvasText}}

/* Group member surfaces keep identity, search and actions stable as one local island. */
.group-member-surface {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.group-member-surface-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-member-surface-title {
  min-width: 0;
  display: inline-flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 7px;
  text-align: left;
}

.group-member-surface-title h3,
.group-member-surface-title span {
  min-width: 0;
  margin: 0;
}

.group-member-surface-title h3 {
  flex: 0 0 auto;
}

.group-member-surface-title span {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-surface-head .member-list-actions {
  position: static;
  z-index: auto;
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 0;
  background: none;
}

.group-member-invite-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.group-member-invite-button svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
}

.group-member-invite-button span {
  display: inline;
  line-height: 1;
}

.group-member-results {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.member-primary-slot .identity-name-line,
.member-primary-slot .identity-name-line:has(.verification-badge:focus) {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--identity-inline-gap);
  overflow: hidden;
  text-align: left;
}

.member-primary-slot .identity-display-name-text {
  width: auto;
  min-width: 2ch;
  max-width: 100%;
  flex: 0 1 auto;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-primary-slot .certification-name-slot {
  min-width: 0;
  max-width: min(42%, 10rem);
  flex: 0 1 auto;
  align-self: center;
  overflow: hidden;
}

.member-primary-slot .certification-name-slot .verification-badge {
  width: 100%;
  max-width: 100%;
}

.member-primary-slot .key-user-marker {
  min-width: 0;
  max-width: 28%;
  flex: 0 1 auto;
  overflow: hidden;
}

.member-primary-slot .member-metadata-slot {
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  max-width: 100%;
  flex: 0 1 auto;
  justify-content: flex-start;
  overflow: hidden;
}

.member-primary-slot .member-metadata-slot .role-badge {
  min-width: 0;
  max-width: 5.5em;
  flex: 0 1 auto;
}

.member-primary-slot .member-metadata-slot .role-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-members-list .group-member-row.member-layout-row {
  text-align: left;
}

.group-members-list .member-primary-slot {
  align-items: stretch;
  justify-items: stretch;
  text-align: left;
}

.group-members-list .identity-name-line {
  min-height: 0;
  justify-content: flex-start;
  align-content: normal;
  justify-items: stretch;
  text-align: left;
}

.group-members-list .member-metadata-slot {
  justify-content: flex-start;
}

body[data-theme="teal"] .role-badge.is-owner,
body[data-theme="graphite"] .role-badge.is-owner {
  color: #8a5200;
}

@media (max-width: 560px) {
  .group-member-surface-head {
    gap: 8px;
  }

  .group-member-surface-title {
    gap: 5px;
  }

  .group-member-invite-button {
    padding-inline: 10px;
  }

  .member-primary-slot .certification-name-slot {
    max-width: 38%;
  }
}

@media (-ms-high-contrast: active) {
  .group-member-invite-button,
  .member-layout-row {
    forced-color-adjust: auto;
  }
}

/* One token and one inline geometry for member, message-sender and call identities. */
:root {
  --identity-inline-gap: 6px;
}

.message-meta > .message-sender-name {
  width: auto;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--identity-inline-gap);
  overflow: visible;
  vertical-align: middle;
}

.message-meta > .message-sender-name:has(.verification-badge:focus) {
  flex-wrap: wrap;
  align-items: center;
  position: static;
  z-index: auto;
  overflow: visible;
}

.message-meta > .message-sender-name > .identity-display-name-text {
  order: 0;
  flex: 0 1 auto;
  min-width: 2ch;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta > .message-sender-name > .certification-name-slot {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  align-self: center;
  overflow: visible;
}

.message-meta > .message-sender-name > .certification-name-slot:has(.verification-badge:focus) {
  position: static;
  z-index: auto;
  overflow: visible;
}

.message-meta > .message-sender-name .verification-badge:not(.is-detail):focus {
  flex: 0 1 auto;
  max-width: 100%;
  outline-offset: -1px;
  white-space: normal;
}

.message-meta > .message-sender-name .verification-badge:not(.is-detail):focus .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.message-meta > .message-sender-name > .certification-name-slot .verification-badge,
.call-identity-line > .certification-name-slot .verification-badge {
  width: 100%;
  max-width: 100%;
  align-items: center;
}

.message-meta > .message-sender-name > .certification-name-slot .verification-badge {
  width: auto;
  max-width: 100%;
  white-space: normal;
}

.message-meta > .message-sender-name .verification-badge-label {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.call-identity-line {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--identity-inline-gap);
  overflow: hidden;
  vertical-align: middle;
}

.call-identity-line:has(.verification-badge:focus) {
  flex-wrap: nowrap;
  align-items: center;
}

.call-history-row .call-history-identity,
.rtc-record-card .rtc-contact-identity,
.rtc-detail-profile-card .rtc-detail-identity {
  display: inline-flex;
}

.call-identity-line > .identity-display-name-text {
  flex: 0 1 auto;
  min-width: 2ch;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-identity-line > .certification-name-slot {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(48%, 11em);
  align-self: center;
  overflow: hidden;
}

.call-history-row > span,
.rtc-contact-card > div:not(.rtc-contact-actions) {
  min-width: 0;
  text-align: left;
}

.call-history-row > .call-identity-avatar,
.rtc-contact-card > .call-identity-avatar,
.rtc-detail-profile-card > .call-identity-avatar {
  min-width: 0;
  display: inline-grid;
  place-items: center;
}

.call-history-identity {
  justify-content: flex-start;
  justify-self: start;
  text-align: left;
}

.rtc-contact-identity {
  justify-content: flex-start;
  justify-self: start;
  text-align: left;
}

.rtc-contact-actions {
  flex: 0 0 auto;
}

.rtc-record-grid {
  container-type: inline-size;
}

@container (max-width: 620px) {
  .rtc-contact-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rtc-contact-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .rtc-contact-actions button {
    flex: 1;
    justify-content: center;
  }
}

.rtc-detail-profile-card .rtc-detail-identity {
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  justify-self: center;
  text-align: center;
}

@media (max-width: 560px) {
  .call-identity-line > .certification-name-slot {
    max-width: 46%;
  }

  .message-meta > .message-sender-name > .certification-name-slot {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .message-meta > .message-sender-name,
  .call-identity-line {
    gap: 5px;
  }
}

@media (-ms-high-contrast: active) {
  .message-meta > .message-sender-name,
  .call-identity-line {
    forced-color-adjust: auto;
  }
}

/* Group member role labels stay optional and complete beside the stable arrow. */
.member-layout-row {
  --member-action-column: 28px;
  grid-template-columns: var(--member-avatar-column) minmax(0, 1fr) max-content var(--member-action-column);
  column-gap: 8px;
}

.member-primary-slot {
  grid-column: 2;
  min-width: 0;
}

.member-role-slot {
  grid-column: 3;
  min-width: max-content;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  overflow: visible;
  white-space: nowrap;
}

.member-role-slot .role-badge {
  min-width: max-content;
  max-width: none;
  flex: 0 0 auto;
  overflow: visible;
  white-space: nowrap;
}

.member-role-slot .role-badge span {
  min-width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.member-action-slot {
  grid-column: 4;
  width: var(--member-action-column);
  min-width: var(--member-action-column);
  height: var(--member-action-column);
}

.group-members-list {
  grid-template-columns: minmax(0, 1fr);
}

.group-members-list .group-member-row.member-layout-row {
  min-height: 60px;
  grid-template-columns: var(--member-avatar-column) minmax(0, 1fr) max-content var(--member-action-column);
  grid-template-rows: none;
  align-items: center;
  justify-items: stretch;
  gap: 8px;
  padding: 9px 10px;
  text-align: left;
}

.group-members-list .member-primary-slot {
  width: auto;
  min-width: 0;
  justify-items: stretch;
}

.group-members-list .identity-name-line {
  min-height: 0;
  justify-content: flex-start;
  align-content: normal;
  text-align: left;
}

.group-members-list .member-action-slot {
  display: inline-grid;
}

@media (max-width: 560px) {
  .member-layout-row {
    --member-action-column: 26px;
    column-gap: 7px;
  }

  .group-members-list .group-member-row.member-layout-row {
    gap: 7px;
    padding-inline: 8px;
  }
}


/* Personal certification uses the same authority as the existing name marker.
   Decoration is out of flow; group/company avatars never receive this child. */
.has-avatar-certification,
.avatar.has-avatar-certification,
.directory-avatar.has-avatar-certification,
.signed-out-avatar.has-avatar-certification,
.message-avatar.has-avatar-certification,
.detail-avatar.has-avatar-certification,
.incoming-avatar.has-avatar-certification,
.rail-user > span.has-avatar-certification {
  position: relative;
  overflow: visible;
  border-radius: 50%;
}
.has-avatar-certification > img[data-avatar-image] {
  border-radius: 50%;
}
.avatar-certification-decoration {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  container-type: inline-size;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.avatar-certification-ring {
  position: absolute;
  top: -1.5%;
  right: -1.5%;
  bottom: -1.5%;
  left: -1.5%;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1.5px rgb(47 107 255 / 92%);
  box-shadow: inset 0 0 0 max(1.5px, 4.5cqi) rgb(47 107 255 / 92%);
  border-radius: 50%;
}
.avatar-certification-shield {
  position: absolute;
  right: -1%;
  bottom: -1%;
  width: max(13px, 33%);
  height: auto;
  display: block;
  overflow: visible;
}

/* Keep connectivity and certification separate, matching iOS corner placement. */
.has-avatar-certification > .avatar-presence,
.conversation-avatar-wrap.has-certified-avatar > .avatar-presence,
.identity-avatar-presence.has-certified-avatar > .avatar-presence,
.member-avatar-wrap.has-certified-avatar > .avatar-presence,
.rail-user.has-certified-avatar > .presence-dot {
  left: 0;
  right: auto;
}

/* Mirror the contact dot onto the circle's left edge, clear of the shield. */
.contact-avatar-wrap.has-certified-avatar > .contact-presence {
  left: 6px;
  right: auto;
}

/* Keep the conversation indicator above the avatar decoration without moving rows. */
.conversation-avatar-wrap {
  overflow: visible;
  isolation: isolate;
}
.conversation-avatar-wrap > .avatar-presence {
  z-index: 3;
}

/* Clip the image itself; the message avatar's ring and shield remain outside it. */
.message-row.has-certified-avatar {
  overflow-clip-margin: 3px;
}
.message-row > .message-avatar.has-avatar-certification {
  overflow: visible;
  isolation: isolate;
}
.message-row > .message-avatar > img[data-avatar-image],
.message-row > .message-avatar > .avatar-fallback {
  border-radius: 50%;
  clip-path: circle(50%);
}

.topbar-behavior-entry[data-action="open-behavior-analysis"] {
  width: auto;
  min-width: 38px;
  padding-inline: 6px;
  white-space: nowrap;
}

.user-context-profile > div {
  width: 100%;
}
.user-context-profile h3.identity-name-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
  white-space: normal;
}
.user-context-profile .identity-display-name-text {
  flex: 0 1 auto;
}
.user-context-profile .certification-name-slot {
  order: 1;
  flex: 0 0 100%;
  max-width: 100%;
  justify-content: center;
}
.user-context-profile .certification-name-slot .verification-badge {
  flex: 0 1 auto;
  justify-content: center;
  text-align: center;
}

.behavior-base-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
.behavior-base-status button {
  flex-shrink: 0;
  white-space: nowrap;
}
.behavior-profile-presence > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Group member previews and complete lists share a four-column avatar matrix. */
.member-grid,
.detail-member-strip,
.group-members-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.member-layout-row.member-layout-tile,
.group-members-list .group-member-row.member-layout-tile {
  min-width: 0;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px 20px;
  align-content: start;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 10px 3px 6px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: none;
  transition: border-color .15s, background-color .15s;
}
.member-layout-row.member-layout-tile:hover,
.group-members-list .group-member-row.member-layout-tile:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}
.member-layout-row.member-layout-tile:focus,
.group-members-list .group-member-row.member-layout-tile:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  box-shadow: none;
  transform: none;
}
.member-layout-tile .member-avatar-slot {
  position: relative;
  grid-column: 1;
  width: 40px;
  height: 40px;
  overflow: visible;
}
.member-layout-tile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.member-layout-tile .avatar img {
  border-radius: 50%;
}
.member-layout-tile .member-primary-slot,
.group-members-list .member-layout-tile .member-primary-slot {
  grid-column: 1;
  display: block;
  width: 100%;
  min-width: 0;
  text-align: center;
}
.member-layout-tile .member-primary-slot .identity-name-line,
.group-members-list .member-layout-tile .identity-name-line {
  display: flex;
  width: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.member-layout-tile .identity-display-name-text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  text-align: center;
}
.member-layout-tile .member-role-slot {
  position: absolute;
  top: -5px;
  right: -4px;
  z-index: 1;
}
.member-layout-tile .member-avatar-slot .member-role-slot .role-badge {
  background: var(--bg-soft);
  gap: 2px;
  padding: 2px 3px;
  font-size: 10px;
}
body[data-theme="teal"] .member-layout-tile .member-role-slot .role-badge.is-owner,
body[data-theme="graphite"] .member-layout-tile .member-role-slot .role-badge.is-owner {
  background: #fff6df;
}
.member-layout-tile .member-role-slot .role-badge svg {
  width: 11px;
  height: 11px;
}
.member-layout-tile .member-action-slot,
.group-members-list .member-layout-tile .member-action-slot {
  display: none;
}
.group-member-invite-button.primary-button {
  background: #245fc8;
  border: 1px solid #245fc8;
  color: #fff;
  opacity: 1;
}
.group-member-invite-button.primary-button span {
  color: inherit;
}
.group-member-invite-button.primary-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: #194ca6;
  color: #fff;
}
.group-member-invite-button.primary-button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.context-kind-group .context-overview .group-member-invite-button.primary-button:disabled {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink-2);
  box-shadow: none;
}
.context-kind-group .context-overview .group-member-invite-button.primary-button[aria-disabled="true"], .group-member-invite-button.primary-button:disabled, .group-member-invite-button.primary-button[aria-disabled="true"] {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink-2);
  box-shadow: none;
}
.context-kind-group .context-overview .group-member-invite-button.primary-button:disabled svg {
  color: inherit;
}
.context-kind-group .context-overview .group-member-invite-button.primary-button[aria-disabled="true"] svg {
  color: inherit;
}
@media (-ms-high-contrast: active) {
  .group-member-invite-button.primary-button {
    background: ButtonFace;
    border-color: ButtonText;
    color: ButtonText;
  }
}

/* Global search: distinct failure, partial result, and empty states. */
.global-search-results .global-search-empty,
.global-search-results .global-search-category-empty,
.global-search-results .global-search-note {
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}
.global-search-results .global-search-empty .ghost-action,
.global-search-results .global-search-category-empty .ghost-action,
.global-search-results .global-search-note .ghost-action {
  justify-self: start;
}
.global-search-results .global-search-empty.is-error,
.global-search-results .global-search-category-empty.is-error {
  border-color: color-mix(in srgb, var(--danger), var(--line) 58%);
  color: var(--danger);
}
.global-search-results .global-search-category-empty.is-degraded {
  border-color: color-mix(in srgb, var(--warn), var(--line) 58%);
  color: var(--warn);
}
.global-search-results .global-search-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px;
}
.global-search-results .global-search-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.global-search-results .global-search-tab.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--ink);
}
.global-search-results .global-search-tab:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* The independent group workspace uses its available width; drawers stay four columns. */
.group-workspace-members .member-grid {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.group-workspace-member-scroll { padding: 2px; }
.group-workspace-member-scroll > .group-member-results > .member-grid {
  max-height: min(536px, 60dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.group-workspace-members .group-member-surface-head { align-items: center; gap: 12px; }
.group-workspace-members .group-member-surface-head h3 { margin: 0; }
.group-workspace-members .member-filter-bar { margin-block: 10px; }
.group-workspace-members .member-filter-field { min-width: 0; flex: 1; }
.group-profile-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.group-profile-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 600;
  line-height: 22px;
  transform: none;
}
.group-profile-actions > button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.group-profile-actions > .primary-button { background: var(--grad); color: #fff; }
.group-profile-actions > .secondary-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
}
.group-profile-actions > button:active { transform: none; }
.group-profile-actions > button:hover { transform: none; }
.group-profile-actions > button:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--primary);
  filter: brightness(1.06);
}
.group-profile-actions > .secondary-button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.group-profile-actions > button:focus { outline: 2px solid var(--primary); outline-offset: 3px; }
.group-profile-actions > button:disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-3);
  box-shadow: none;
  filter: none;
  cursor: not-allowed;
}
.group-profile-actions > button[aria-disabled="true"] {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-3);
  box-shadow: none;
  filter: none;
  cursor: not-allowed;
}

.global-search-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.global-search-head > strong { min-width: 0; overflow-wrap: anywhere; flex: 1 1 150px; }
.global-search-head > span { color: var(--ink-2); font-size: 12px; }
.global-search-empty { padding: 18px 14px; }
.global-search-empty > strong { color: var(--ink); }
.global-search-empty > span { color: var(--ink-2); line-height: 1.6; }
.global-search-category-empty { line-height: 1.6; }
.global-search-category-empty.is-guidance { color: var(--ink-2); }


/* The time picker stays in the existing modal body, never above its footer. */
.modal-card.group-mute-modal { max-height: min(100%, calc(100vh - 24px)); max-height: min(100%, calc(100dvh - 24px)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; }
.group-mute-modal .group-mute-form { min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; grid-auto-rows: max-content; }
.group-mute-modal .group-mute-time-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; }
.group-mute-modal .group-mute-time-row:nth-of-type(2) { border-bottom: 0; }
.group-mute-time-value { grid-column: 3; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); font-variant-numeric: tabular-nums; }
.group-mute-time-value svg { width: 14px; height: 14px; }
.group-mute-time-picker { min-width: 0; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); }
.group-mute-time-picker-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.group-mute-time-picker-title span { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.group-mute-time-picker-title svg { width: 16px; height: 16px; color: var(--primary); }
.group-mute-time-picker-title b { font-size: 20px; font-variant-numeric: tabular-nums; }
.group-mute-time-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.group-mute-time-column { min-width: 0; display: grid; gap: 6px; text-align: center; color: var(--ink-2); font-size: 12px; }
.group-mute-time-options { position: relative; height: min(168px,28vh); height: min(168px,28dvh); min-height: 80px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); scrollbar-width: thin; }
.group-mute-time-options button { display: block; width: 100%; min-height: 40px; margin: 2px 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.group-mute-time-options button[aria-selected="true"] { border-color: var(--primary); background: color-mix(in srgb,var(--primary),transparent 85%); color: var(--ink); font-weight: 800; }
.group-mute-time-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group-mute-time-picker-actions button { min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--ink); font: inherit; font-weight: 700; }
.group-mute-time-picker-actions .primary-button { background: var(--grad); color: #fff; }
.group-mute-time-row:hover:not(:disabled), .group-mute-time-options button:hover:not(:disabled), .group-mute-time-picker-actions button:hover:not(:disabled) { border-color: var(--primary); background-color: color-mix(in srgb,var(--primary),transparent 88%); }
.group-mute-time-row:focus, .group-mute-time-options button:focus, .group-mute-time-picker-actions button:focus { outline: 2px solid var(--primary); outline-offset: -3px; }
.group-mute-modal button:disabled { cursor: not-allowed; opacity: .55; }
.group-mute-modal[aria-busy="true"] button:disabled { cursor: wait; }
@media (max-width: 480px) { .group-mute-time-row { gap: 6px; padding-inline: 10px; } .group-mute-time-value { padding: 8px; } }

.detail-setting-row > .group-dissolve-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger), transparent 45%);
  background: color-mix(in srgb, var(--danger), transparent 94%);
}
.detail-setting-row > .group-dissolve-entry:hover {
  background: color-mix(in srgb, var(--danger), transparent 87%);
}
.detail-setting-row > .group-dissolve-entry:focus {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.group-dissolve-entry > span { white-space: nowrap; }
.group-dissolve-entry > svg { width: 18px; height: 18px; flex: 0 0 18px; }

/* Group ownership controls share the same layout in the full page and sidebar. */
.group-owner-actions{display:flex;flex-wrap:wrap;gap:10px;padding-top:18px;margin-top:18px;border-top:1px solid var(--line,rgba(130,145,170,.16))}
.group-owner-actions .group-owner-action{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 1 auto;min-height:38px;padding:8px 13px;border:1px solid rgba(105,117,255,.24);border-radius:10px;background:rgba(105,117,255,.06);color:var(--primary,#6674ee);font-size:12px;white-space:nowrap;cursor:pointer}
.group-owner-actions .group-dissolve-entry{width:auto;min-height:44px;color:#e45b70;border-color:rgba(228,91,112,.27);background:rgba(228,91,112,.045)}
.group-owner-action svg,.group-mute-list-label>svg{width:16px;height:16px;flex:0 0 16px}
.group-mute-list-label{display:flex;align-items:center;gap:9px}
.group-mute-list-label>svg{color:#dca452}
.group-owner-transfer-modal{width:min(560px,calc(100vw - 28px));height:min(660px,calc(100vh - 36px));height:min(660px,calc(100dvh - 36px));max-height:calc(100vh - 36px);max-height:calc(100dvh - 36px);display:flex;flex-direction:column;overflow:hidden}
.group-owner-transfer-modal .notice-modal-head{flex:0 0 auto;padding:20px 22px;gap:12px}
.group-owner-transfer-modal .notice-modal-title{min-width:0;display:flex;align-items:center;gap:12px}
.group-owner-transfer-modal .notice-modal-title>div{min-width:0}
.group-owner-transfer-modal .notice-modal-title p{max-width:380px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-owner-title-icon{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;border-radius:13px;background:linear-gradient(135deg,#6096ff,#8874ff);color:white}
.group-owner-title-icon svg{width:22px;height:22px}
.group-owner-transfer-modal .group-owner-transfer-body{display:flex;flex-direction:column;gap:13px;padding:18px 22px;flex:1;min-height:0;overflow:hidden}
.group-owner-transfer-note{margin:0;color:var(--muted,#8994ad);font-size:12px;line-height:1.7}
.group-owner-search{display:flex;align-items:center;gap:9px;flex:0 0 auto;padding:10px 12px;border:1px solid var(--line,rgba(130,145,170,.18));border-radius:11px;background:rgba(136,150,180,.055)}
.group-owner-search svg{width:17px;height:17px;color:var(--muted,#8994ad)}
.group-owner-search input{width:100%;min-width:0;border:0!important;background:transparent!important;outline:none;padding:0!important;font-size:13px}
.group-owner-search:focus-within{border-color:#8993ff;box-shadow:0 0 0 3px rgba(110,124,255,.10)}
.group-owner-list-heading{display:flex;justify-content:space-between;gap:10px;font-size:12px;font-weight:600}
.group-owner-list-heading small{font-weight:400;color:var(--muted,#8994ad)}
.group-owner-transfer-candidates{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0;overflow-y:scroll;overscroll-behavior:contain;scrollbar-gutter:stable;padding:2px 6px 2px 2px;scrollbar-width:thin;scrollbar-color:#bbc4d9 transparent}
.group-owner-transfer-candidates::-webkit-scrollbar{width:7px}
.group-owner-transfer-candidates::-webkit-scrollbar-thumb{background:#bbc4d9;border-radius:8px}
.group-owner-transfer-candidate{position:relative;display:flex;align-items:center;gap:12px;flex:0 0 auto;min-height:70px;padding:11px 12px;border:1px solid var(--line,rgba(130,145,170,.18));border-radius:12px;cursor:pointer;background:var(--surface,#fff);transition:border-color .15s,background .15s}
.group-owner-transfer-candidate:hover{border-color:#a7afff;background:rgba(105,117,255,.025)}
.group-owner-transfer-candidate.is-selected{border-color:#8090ff;background:rgba(105,117,255,.065);box-shadow:0 0 0 1px rgba(105,117,255,.12)}
.group-owner-transfer-candidate:focus-within{outline:2px solid #7b89ff;outline-offset:1px}
.group-owner-transfer-candidate>input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.group-owner-transfer-modal .avatar{width:40px;height:40px;flex:0 0 40px;border-radius:50%}
.group-owner-identity{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.group-owner-identity strong,.group-owner-identity small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-owner-identity strong{font-size:13px}
.group-owner-identity small{font-size:11px;color:var(--muted,#8994ad)}
.group-owner-choice{display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border:1.5px solid #cad1df;border-radius:50%}
.is-selected>.group-owner-choice{background:#7684ff;border-color:#7684ff;color:white}
.group-owner-choice svg{width:14px;height:14px}
.group-owner-empty{margin:auto;text-align:center;max-width:230px;color:var(--muted,#8994ad);font-size:13px;line-height:1.7}
.group-owner-transfer-modal .group-owner-transfer-footer{display:flex;justify-content:space-between;align-items:center;gap:14px;flex:0 0 auto;padding:16px 22px;border-top:1px solid var(--line,rgba(130,145,170,.16));background:var(--surface,#fff)}
.group-owner-selected{display:flex;align-items:center;gap:9px;min-width:0;flex:1}
.group-owner-selected .avatar{width:32px;height:32px;flex-basis:32px}
.group-owner-selected>span{min-width:0;display:flex;flex-direction:column;gap:3px}
.group-owner-selected strong{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.group-owner-selected small,.group-owner-unselected{font-size:11px;color:var(--muted,#8994ad)}
.group-owner-footer-buttons{display:flex;gap:9px;flex:0 0 auto}
.group-owner-footer-buttons>button{min-height:38px;padding:9px 16px;border-radius:10px;white-space:nowrap}
.group-owner-transfer-modal .form-error{flex:0 0 auto;margin:0;font-size:12px}
.group-owner-confirm-target{display:flex;align-items:center;gap:14px;padding:22px 18px;border:1px solid rgba(105,117,255,.2);border-radius:14px;background:rgba(105,117,255,.04);margin-top:12px}
.group-owner-confirm-target .avatar{width:54px;height:54px;flex-basis:54px}
.group-owner-confirm-note{padding:14px;border-radius:12px;font-size:12px;line-height:1.8;color:#936c32;background:rgba(232,185,91,.08)}
.group-owner-transfer-modal.is-confirming{height:auto;min-height:360px}
@media(max-width:480px){.group-owner-transfer-modal .notice-modal-head{padding:16px}.group-owner-transfer-modal .group-owner-transfer-body{padding:14px 16px;gap:11px}.group-owner-transfer-modal .group-owner-transfer-footer{padding:14px 16px;flex-wrap:wrap}.group-owner-selected{min-width:100%;}.group-owner-footer-buttons{width:100%;justify-content:flex-end}.group-owner-footer-buttons>button{flex:1}.group-owner-transfer-modal .notice-modal-title p{max-width:230px}}
@media(max-height:560px){.group-owner-transfer-note{font-size:11px}.group-owner-transfer-modal .notice-modal-head{padding:12px 16px}.group-owner-transfer-modal .group-owner-transfer-body{padding:10px 16px;gap:8px}.group-owner-transfer-modal .group-owner-transfer-footer{padding:10px 16px}}

.group-owner-actions>.detail-setting-row{width:100%}
.detail-setting-row > .group-leave-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 0;
  text-align: left;
}
.group-leave-entry > svg { width: 16px; height: 16px; flex: 0 0 16px; }

.group-owner-transfer-modal.is-confirming .group-owner-transfer-body{overflow-y:auto;overscroll-behavior:contain}
.group-owner-transfer-modal.is-confirming .group-owner-transfer-body>*{flex-shrink:0}

/* These editors have a bounded body between header and actions. Grid content
   must scroll within its row instead of painting over the footer in short windows. */
.password-change-body,
.group-profile-modal > .group-profile-editor,
.my-avatar-modal > .group-profile-editor,
.attachment-confirm-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  align-content: start;
  grid-auto-rows: max-content;
}
/* Admission errors add a fourth section; keep the actual footer out of an
   implicit grid row and let only the preview body shrink. */
.modal-card.attachment-confirm-modal {
  display: flex;
  flex-direction: column;
}
.attachment-confirm-modal > header,
.attachment-confirm-modal > .modal-error,
.attachment-confirm-modal > footer {
  flex: 0 0 auto;
}
.attachment-confirm-modal > .attachment-confirm-body { flex: 0 1 auto; }
/* Report sender, excerpt and form are separate sections. Like member profiles,
   use one reachable scrolling surface rather than a three-row grid. */
.modal-card.message-report-modal {
  grid-template-rows: none;
  grid-auto-rows: max-content;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-height: 480px) {
  /* At this height the transfer header/search/footer cannot all fit around a
     useful list. Scroll the card as a whole, with a real candidate viewport. */
  .modal-card.group-owner-transfer-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
  }
  .group-owner-transfer-modal .group-owner-transfer-body { flex: 0 0 auto; }
  .group-owner-transfer-modal .group-owner-transfer-body > * { flex-shrink: 0; }
  .group-owner-transfer-candidates { flex: 0 0 auto; height: min(180px, 40vh); min-height: 112px; }
  .group-mute-list-body { overflow-y: auto; overscroll-behavior: contain; }
  .group-mute-list-add, .group-mute-list-section { flex: 0 0 auto; }
  .group-mute-list-candidates, .group-mute-list-rows { height: 112px; }
}

/* Default group friends: only the enhanced create/invite drawer uses this layout. */
.drawer-card.drawer-invite:has([data-default-group-picker]) {
  width: min(760px, calc(100vw - 28px));
}
.drawer-card.drawer-group-create:has([data-default-group-picker]) {
  width: min(760px, calc(100vw - 28px));
}
[data-default-group-picker] {
  container-type: inline-size;
  min-width: 0;
  color: var(--ink);
  gap: 12px;
}
[data-default-group-picker] .group-member-picker-fields { max-height: 58%; gap: 10px; }
[data-default-group-picker] .default-group-feature {
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary), var(--line) 65%);
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 70%);
}
[data-default-group-picker] .default-group-feature p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
[data-default-group-picker] .default-group-feature-head,
[data-default-group-picker] .default-group-restore,
[data-default-group-picker] .default-group-dirty-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
[data-default-group-picker] .default-group-feature-head strong { font-size: 14px; }
[data-default-group-picker] .default-group-feature-summary {
  display: flex;
  flex: 1 1 160px;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
[data-default-group-picker] .default-group-feature-summary > strong { flex: 0 0 auto; }
[data-default-group-picker] .default-group-feature-head > button { flex: 0 0 auto; align-self: flex-start; }
[data-default-group-picker] .default-group-saved-avatars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 3px;
}
[data-default-group-picker] .default-group-saved-avatar { display: inline-flex; flex: 0 0 auto; }
[data-default-group-picker] .default-group-saved-avatar > .avatar { width: 24px; height: 24px; font-size: 11px; }

[data-default-group-picker] .default-group-count {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  color: var(--primary);
  background: var(--surface);
  font-size: 12px;
}
[data-default-group-picker] .default-group-restore {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
[data-default-group-picker] .default-group-restore small {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 11px;
}
[data-default-group-picker] button { min-height: 44px; }
[data-default-group-picker] .default-group-feature button,
[data-default-group-picker] .default-group-dirty-note button {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--primary);
  background: var(--surface);
}
[data-default-group-picker] button:disabled { cursor: not-allowed; opacity: .6; }
[data-default-group-picker] button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
[data-default-group-picker] .invite-search-field input { min-height: 44px; }
[data-default-group-picker] .invite-friend-list { grid-template-columns: minmax(0, 1fr); padding: 2px 4px 4px 2px; }
[data-default-group-picker] .invite-friend-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
}
[data-default-group-picker] .invite-friend-row.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft), var(--surface) 65%);
}
[data-default-group-picker] .invite-friend-row.is-disabled { opacity: 1; }
[data-default-group-picker] .invite-friend-row .avatar { width: 36px; height: 36px; }
[data-default-group-picker] .invite-friend-row > .status-dot { display: none; }
[data-default-group-picker] .group-create-selected-list .invite-friend-row { grid-template-columns: 36px minmax(0, 1fr); }
[data-default-group-picker] .invite-friend-row button { padding: 0 9px; font-size: 12px; }
[data-default-group-picker] .identity-name-line { align-items: center; gap: 4px; flex-wrap: nowrap; }
[data-default-group-picker] .identity-display-name-text { flex: 0 1 auto; }
[data-default-group-picker] .identity-name-line > :not(.identity-display-name-text) { flex-shrink: 0; }
[data-default-group-picker] .identity-name-line .verification-badge { max-width: 82px; }
[data-default-group-picker] .invite-friend-copy small { font-size: 11px; }
[data-default-group-picker] .invite-friend-copy .default-group-person-state { color: var(--ink-3); }
[data-default-group-picker] .default-group-selection { flex: 0 1 auto; min-height: 0; }
[data-default-group-picker] .default-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  max-height: min(116px, 18dvh);
  overflow: auto;
  padding: 3px;
  overscroll-behavior: contain;
}
[data-default-group-picker] .default-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 3px 9px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface-soft);
}
[data-default-group-picker] .default-group-chip .avatar { width: 26px; height: 26px; flex: 0 0 26px; }
[data-default-group-picker] .default-group-chip > span:not(.avatar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-default-group-picker] .default-group-chip > span[aria-hidden] { flex: 0 0 auto; }
[data-default-group-picker] .group-create-actions { padding-top: 10px; }
[data-default-group-picker] .default-group-dirty-note { flex: 0 0 auto; color: var(--ink-2); }
@container (min-width: 650px) {
  [data-default-group-picker] .invite-friend-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-default-group-picker] .invite-search-note.is-error,
[data-default-group-picker] .default-group-feature .is-error { color: var(--danger); }

/* Use the existing modal/button palette without replacing the underlying draft. */
.chat-confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.chat-confirm-dialog::backdrop { background: rgba(12, 18, 35, .48); backdrop-filter: blur(4px); }
.chat-confirm-dialog h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.4; }
.chat-confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.75; overflow-wrap: anywhere; }
.chat-confirm-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chat-confirm-dialog button { min-height: 40px; padding: 9px 16px; border-radius: 11px; }
.chat-confirm-dialog button:focus { outline: 3px solid var(--primary); outline-offset: 3px; }
@media (max-width: 360px) {
  .chat-confirm-dialog { padding: 20px; }
  .chat-confirm-dialog footer button { flex: 1 1 auto; }
}

/* Recent successful accounts share the existing theme palette. */
.login-layout { position: relative; z-index: 1; display: grid; justify-items: center; gap: 24px; width: min(1100px, 100%); min-width: 0; }
.recent-logins { box-sizing: border-box; width: min(100%, max(540px, calc(var(--recent-columns) * 246px + (var(--recent-columns) - 1) * 12px + 48px))); min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: color-mix(in srgb, var(--surface), transparent 3%); }
.web-login-form .quick-login-limit { color: var(--danger, #dc3545); font-size: 12px; }
.recent-logins-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent-logins-heading h2 { margin: 0; font-size: 15px; font-weight: 750; color: var(--ink); }
.recent-logins-heading > span { color: var(--muted); font-size: 11px; }
.recent-logins-note, .recent-logins-empty { margin: 8px 0 16px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.recent-logins-empty { padding: 12px; border-radius: 12px; background: var(--surface); text-align: center; }
.recent-logins-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 2px; }
.recent-logins-list { display: grid; gap: 12px; width: min(100%, calc(var(--recent-columns) * 246px + (var(--recent-columns) - 1) * 12px)); margin-inline: auto; min-width: calc(var(--recent-columns) * 208px + (var(--recent-columns) - 1) * 12px); }
.recent-logins-row { display: grid; grid-template-columns: repeat(var(--recent-columns), minmax(0, 1fr)); gap: 12px; width: 100%; padding: 0; margin: 0; list-style: none; }
.recent-logins-row li { position: relative; display: flex; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.recent-login-choice { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 24px 10px 7px; background: transparent; border: 0; border-radius: 12px; text-align: left; color: var(--ink); }
.recent-login-avatar { position: relative; display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; border-radius: 13px; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); font-weight: 750; }
.recent-login-avatar img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.recent-login-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.recent-login-copy strong, .recent-login-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-login-copy strong { font-size: 13px; font-weight: 650; }
.recent-login-copy small { color: var(--muted); font-size: 11px; }
.recent-login-remove { position: absolute; right: 4px; top: 4px; width: 26px; min-height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; }
.recent-login-choice:hover, .recent-login-remove:hover { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); }
.recent-logins button:focus, .recent-logins-scroll:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.recent-logins button:disabled { opacity: .55; cursor: wait; }
.login-screen { align-items: safe center; }
@media (max-width: 600px) {
  .login-layout { gap: 16px; }
  .recent-logins { padding: 18px 14px; border-radius: 20px; }
}


/* Compact layouts keep navigation and call actions within their own pane. */
.list-panel-back { display: none; }
@media (max-width: 960px) {
  .list-panel-back { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .settings-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .settings-pane-head { flex-wrap: wrap; }
  .settings-pane-head > div { flex: 1; min-width: 0; }
  .settings-pane-head h2, .settings-pane-head .lead { overflow-wrap: anywhere; }
  .rtc-idle-workspace .page-scroll { grid-auto-rows: max-content; gap: 16px; padding: 16px; }
  .rtc-empty-panel { min-height: 0; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px; }
  .rtc-empty-visual { width: 64px; height: 64px; border-radius: 20px; }
  .rtc-empty-icon svg { width: 30px; height: 30px; }
  .rtc-empty-copy h2 { font-size: 22px; }
  .rtc-empty-copy p:not(.eyebrow) { font-size: 13px; }
  .rtc-contact-actions button { min-height: 44px; }
  .rtc-video-preflight { min-width: 0; max-width: 100%; min-height: 0; grid-template-rows: auto minmax(100px, 26dvh) auto auto; gap: 12px; padding: 16px; }
  .rtc-video-preflight > *, .rtc-video-preflight-copy { min-width: 0; max-width: 100%; }
  .rtc-video-preflight-copy h2 { overflow-wrap: anywhere; }
  .rtc-video-preflight > .rtc-video-frame { min-height: 0; }
  .rtc-video-frame-label { max-width: 100%; }
  .rtc-video-workspace.is-active-call .rtc-video-stage { grid-template-rows: minmax(120px, 34dvh) auto; }
  .rtc-video-local-pip { width: min(100%, 112px); height: 90px; }
  .rtc-video-workspace.is-active-call .rtc-call-actions.call-controls { position: static; flex: 0 0 auto; z-index: 4; padding: 10px; gap: 8px; }
  .rtc-video-workspace .rtc-reversible-controls { width: 100%; }
  .rtc-video-workspace .rtc-reversible-controls .call-answer { flex: 1; min-width: 0; }
  .rtc-video-workspace .rtc-downgrade-action, .rtc-video-workspace .rtc-isolated-hangup { width: auto; flex: 1; min-width: 0; margin-inline-start: 0; }
  .rtc-call-workspace.is-active-call:not(.rtc-video-workspace) .page-scroll { grid-template-rows: minmax(min-content, 1fr) auto; gap: 12px; padding: 12px; }
  .rtc-call-workspace.is-active-call .page-scroll { display: flex; flex-direction: column; overflow: hidden; }
  .rtc-call-workspace.is-active-call .rtc-voice-stage { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; gap: 12px; padding: 8px; }
  .rtc-video-workspace.is-active-call .rtc-video-stage { flex: 1 1 auto; height: auto; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  .rtc-voice-avatar-stage { width: 150px; height: 150px; }
  .rtc-voice-controls { position: static; flex: 0 0 auto; z-index: 4; }
  .rtc-voice-control { min-height: 88px; padding: 6px 4px; grid-template-rows: 38px auto auto; }
  .rtc-voice-control > span { width: 36px; height: 36px; }
  .rtc-voice-control svg { width: 20px; height: 20px; }
  .group-workspace-member-scroll { max-height: none; overflow: visible; scrollbar-gutter: auto; }
  .incoming-call-notice { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .incoming-call-card { min-width: 0; max-width: 100%; min-height: 0; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; padding: 20px 16px; }
  .incoming-call-main, .incoming-copy { width: 100%; min-width: 0; max-width: 100%; }
  .incoming-copy .identity-name-line { max-width: 100%; justify-content: center; }
  .incoming-copy .identity-display-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .incoming-call-actions { gap: 8px; }
  .incoming-call-actions button { padding-inline: 8px; min-height: 48px; }
}
@media (max-width: 620px) {
  .app-rail { padding-top: calc(6px + env(safe-area-inset-top)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .composer-panel { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .page-scroll, .side-content { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .rtc-empty-panel { padding: 16px; gap: 12px; }
  .rtc-empty-visual { width: 52px; height: 52px; border-radius: 16px; }
  .rtc-empty-copy h2 { font-size: 20px; }
}
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 620px) { :root { --rail-h: calc(64px + env(safe-area-inset-top)); } }
  @media (max-width: 260px) { :root { --rail-h: calc(112px + env(safe-area-inset-top)); } }
}
@media (max-width: 960px) and (max-height: 520px) {
  .rtc-call-workspace .workspace-topbar { min-height: 56px; flex-wrap: nowrap; }
  .rtc-call-workspace .topbar-title { flex: 1 1 0; min-width: 0; }
  .rtc-call-workspace .topbar-actions { width: auto; flex-wrap: nowrap; gap: 4px; }
  .rtc-video-workspace.is-active-call .rtc-video-stage { grid-template-rows: minmax(0, 1fr); grid-template-areas: "remote remote"; }
  .rtc-video-stage-status { position: absolute; left: 8px; bottom: 8px; min-height: 28px; padding-inline: 8px; gap: 6px; }
  .rtc-video-local-pip { position: absolute; right: 8px; bottom: 8px; height: 60px; width: 80px; }
  .rtc-video-preflight { grid-template-rows: auto minmax(72px, 24dvh) auto auto; }
  .rtc-call-workspace.is-active-call .rtc-voice-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 6px; }
  .rtc-voice-call-meta { grid-column: 1; grid-row: 1; }
  .rtc-voice-peer { grid-column: 2; grid-row: 1 / 3; }
  .rtc-voice-self-card { grid-column: 1; grid-row: 2; }
  .rtc-voice-avatar-stage { width: 96px; height: 96px; }
  .rtc-voice-avatar-stage .avatar { width: 64px; height: 64px; min-width: 64px; min-height: 64px; }
  .rtc-voice-self-card { min-height: 64px; padding: 8px 12px; }
  .rtc-voice-self-card .avatar { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .incoming-call-card { gap: 10px; padding: 12px; }
  .incoming-call-main { gap: 8px; }
  .incoming-avatar { width: 72px; height: 72px; }
  .incoming-avatar > .incoming-avatar-core { width: 64px; height: 64px; min-width: 64px; min-height: 64px; border-radius: 22px; }
  .incoming-copy strong { font-size: 20px; }
}

/* Shared with the standards inert polyfill; keep it in the existing stylesheet. */
[inert] { pointer-events: none; cursor: default; }
[inert], [inert] * { user-select: none; -webkit-user-select: none; -ms-user-select: none; }

/* Unsupported var()-based colors can invalidate component focus shorthands. */
:focus { outline: 2px solid currentColor !important; outline-offset: -2px !important; }

/* Bounded member DOM; records/search/pagination remain owned by the model. */
.member-grid.is-virtualized {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-height: 480px;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  align-content: start;
}
.member-grid.is-virtualized .member-virtual-spacer {
  flex: 0 0 100%;
  width: 100%;
  pointer-events: none;
  min-height: 0;
}
.member-grid.is-virtualized .member-virtual-item { flex-grow: 0; flex-shrink: 0; box-sizing: border-box; min-width: 0; padding-left: 6px; padding-right: 6px; }
.member-grid.is-virtualized .member-virtual-item > .member-card { width: 100%; height: 100%; }

html[data-low-resource-mode],
html[data-low-resource-mode] *,
html[data-low-resource-mode] *::before,
html[data-low-resource-mode] *::after {
  animation: none !important;
  transition: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
}

html[data-low-resource-mode],
html[data-low-resource-mode] :not(:focus),
html[data-low-resource-mode] *::before,
html[data-low-resource-mode] *::after {
  box-shadow: none !important;
}

html[data-chat-input-priority] .side-content, html[data-chat-input-priority] .message-flow, html[data-chat-input-priority] .composer-shell, html[data-chat-input-priority] .context-panel {
  contain: inline-size;
}

html[data-native-composer-sizing] .composer-input textarea {
  field-sizing: content;
  overflow-y: auto;
  transition: none;
}
}
