:root {
  --ink: #18212b;
  --muted: #667382;
  --line: #dce1e7;
  --line-strong: #c8d0d9;
  --paper: #eef1f4;
  --panel: #ffffff;
  --panel-soft: #f6f7f9;
  --accent: #087a55;
  --accent-strong: #066144;
  --accent-soft: #e2f4ed;
  --blue: #2f6fed;
  --blue-soft: #e8efff;
  --violet: #7252bd;
  --red: #c7353e;
  --red-soft: #fff0f1;
  --shadow: 0 18px 50px rgba(24, 33, 43, 0.16);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overscroll-behavior-x: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
}

button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.22);
  outline-offset: 2px;
}

button.secondary {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
}

button.secondary:hover,
button.ghost:hover {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
}

button.danger {
  background: var(--red);
  border-color: var(--red);
}

button.danger:hover {
  background: #aa2832;
  border-color: #aa2832;
}

button.small {
  min-height: 32px;
  padding: 5px 9px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

svg.lucide {
  height: 19px;
  pointer-events: none;
  stroke-width: 2;
  width: 19px;
}

.icon-button {
  aspect-ratio: 1;
  border-radius: 50%;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0;
  width: 40px;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  line-height: 1.35;
  min-height: 44px;
  resize: none;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 7px;
  line-height: 1.3;
}

h1,
h2,
p {
  margin-top: 0;
}

.app-shell {
  height: 100%;
}

.boot,
.onboarding {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  padding: 24px;
  text-align: center;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 28px;
  font-weight: 800;
  height: 62px;
  justify-content: center;
  width: 62px;
}

.brand-mark.compact {
  background: var(--accent);
  flex: 0 0 38px;
  font-size: 18px;
  height: 38px;
  width: 38px;
}

.qeyet-wordmark {
  --qeyet-wordmark-size: 28px;
  align-items: baseline;
  color: currentColor;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--qeyet-wordmark-size);
  font-variant-ligatures: none;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.qeyet-wordmark.hero {
  --qeyet-wordmark-size: 42px;
}

.qeyet-wordmark.compact {
  --qeyet-wordmark-size: 21px;
}

.qeyet-wordmark-eye {
  font-size: .72em;
  line-height: 1;
  margin: 0 .045em;
  position: relative;
}

.qeyet-wordmark-eye::before {
  background: currentColor;
  border-radius: 2px;
  content: "";
  height: .075em;
  left: 0;
  position: absolute;
  right: 0;
  top: -.22em;
}

.boot-brand,
.onboarding-brand {
  color: var(--ink);
  margin: 0;
}

.onboarding-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  max-width: 620px;
  padding: 26px;
  width: min(100%, 620px);
}

.onboarding h1,
.onboarding p {
  margin-bottom: 6px;
}

.device-link-entry {
  justify-content: center;
  margin-top: -6px;
}

.passphrase {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  padding: 12px;
}

.passphrase span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  padding: 8px;
}

.split-actions,
.button-row,
.modal-actions {
  display: flex;
  gap: 10px;
}

.split-actions > *,
.button-row > * {
  flex: 1 1 0;
}

.workspace {
  background: var(--paper);
  display: grid;
  grid-template-columns: 324px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.rail-header,
.chat-header,
.side-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  min-height: 66px;
  padding: 10px 14px;
}

.rail-header,
.chat-header {
  justify-content: space-between;
}

.brand-lockup,
.chat-title {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.brand-lockup > .qeyet-wordmark {
  color: var(--ink);
}

.identity,
.chat-title > div {
  min-width: 0;
}

.identity strong,
.identity span,
.chat-title > div > strong,
.chat-title > div > span,
.side-header strong,
.side-header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity strong,
.chat-title > div > strong,
.side-header strong {
  font-size: 14px;
  font-weight: 700;
}

.identity span,
.chat-title > div > span,
.side-header span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.rail-header-actions,
.chat-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.search-wrap {
  padding: 10px 12px 8px;
  position: relative;
}

.search-wrap input {
  background: var(--panel-soft);
  border-color: transparent;
  padding-left: 38px;
}

.search-icon {
  color: var(--muted);
  left: 23px;
  pointer-events: none;
  position: absolute;
  top: 21px;
  z-index: 1;
}

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

.chat-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 10px;
}

.chat-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  justify-content: stretch;
  min-height: 64px;
  padding: 8px 10px;
  text-align: left;
  touch-action: pan-y;
  transition: background 0.15s ease, transform 0.15s ease;
  width: 100%;
}

.chat-item:hover {
  background: var(--panel-soft);
  border-color: transparent;
}

.chat-item.active {
  background: var(--accent-soft);
  border-color: #c5e7db;
  color: var(--ink);
}

.chat-item.swiping {
  background: var(--red-soft);
  border-color: #f0c6ca;
  transition: none;
}

.chat-avatar-wrap {
  display: inline-flex;
  height: 44px;
  position: relative;
  width: 44px;
}

.presence-dot {
  background: #a6afb9;
  border: 2px solid #fff;
  border-radius: 50%;
  bottom: 0;
  height: 12px;
  position: absolute;
  right: 0;
  width: 12px;
}

.chat-item.active .presence-dot {
  border-color: var(--accent-soft);
}

.presence-dot.online {
  background: #14a46f;
}

.avatar {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent-strong);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.avatar.group {
  background: var(--blue-soft);
  color: #2857bc;
}

.avatar.agent,
.action-icon.agent {
  background: #edf0ff;
  color: #4d5ca8;
}

.avatar.agent svg {
  height: 19px;
  width: 19px;
}

.avatar.agent.large svg {
  height: 30px;
  width: 30px;
}

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

.profile-avatar {
  background: var(--accent);
  color: #fff;
}

.chat-meta {
  min-width: 0;
}

.chat-meta strong,
.chat-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-meta strong {
  font-size: 14px;
  margin-bottom: 4px;
}

.chat-meta strong .agent-label {
  background: #edf0ff;
  border-radius: 4px;
  color: #4d5ca8;
  display: inline-flex;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  margin-left: 7px;
  padding: 0 5px;
  text-transform: uppercase;
  vertical-align: 1px;
}

.agent-chat-item.active {
  box-shadow: inset 3px 0 #4d5ca8;
}

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

.chat-meta .typing-preview {
  color: var(--accent-strong);
  font-weight: 700;
}

.chat-meta .draft-preview {
  color: var(--red);
  font-weight: 700;
}

.chat-meta .chat-label-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  overflow: hidden;
}

.chat-label-row small {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  display: inline-block;
  font-size: 9px;
  line-height: 16px;
  max-width: 90px;
  overflow: hidden;
  padding: 0 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  align-items: center;
  background: var(--blue);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
}

.rail-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 7px;
  min-height: 48px;
  padding: 10px 14px;
}

.rail-footer-id {
  margin-left: auto;
}

.status-dot {
  background: #a6afb9;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.status-dot.online {
  background: var(--accent);
}

.empty-list,
.empty-conversation,
.empty-panel {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 20px;
  text-align: center;
}

.empty-list {
  margin: auto 0;
}

.empty-list.compact {
  margin: 0;
  padding-top: 26px;
}

.empty-list strong,
.empty-conversation h1,
.empty-panel h2 {
  color: var(--ink);
  margin: 12px 0 4px;
}

.empty-list p,
.empty-conversation p,
.empty-panel p {
  font-size: 13px;
  margin-bottom: 16px;
}

.empty-list-icon,
.empty-conversation > span {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.empty-list-icon svg,
.empty-conversation > span svg {
  height: 24px;
  width: 24px;
}

.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  min-width: 0;
}

.mobile-back {
  display: none;
}

.chat-header {
  min-width: 0;
}

.header-action {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-strong);
}

.header-action:hover {
  background: #cceadf;
  border-color: transparent;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  padding: 22px clamp(16px, 4vw, 52px) 12px;
}

.empty-conversation {
  align-self: center;
  margin: auto;
}

.empty-conversation h1 {
  font-size: 20px;
}

.empty-chat {
  align-self: center;
  color: var(--muted);
  margin: auto;
  max-width: 320px;
  text-align: center;
}

.message {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px 17px 17px 5px;
  box-shadow: 0 1px 1px rgba(24, 33, 43, 0.04);
  display: grid;
  gap: 5px;
  align-self: flex-start;
  margin-top: 5px;
  max-width: min(68ch, 76%);
  padding: 8px 11px 7px;
}

.message.mine {
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 17px 17px 5px 17px;
  color: #fff;
  align-self: flex-end;
}

.message.deleted {
  color: var(--muted);
  font-style: italic;
}

.message-sender {
  color: var(--accent-strong);
  display: none;
  font-size: 11px;
  font-weight: 750;
}

.message-sender.visible {
  display: block;
}

.message.mine .message-sender {
  color: #dbe6ff;
  text-align: right;
}

.reply-chip {
  background: rgba(47, 111, 237, 0.08);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  color: #244f9f;
  display: none;
  font-size: 12px;
  padding: 6px 8px;
}

.message.mine .reply-chip {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: #fff;
  color: #fff;
}

.reply-chip.visible {
  display: block;
}

.message-body {
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.agent-rich {
  max-width: min(920px, 88%);
  min-width: min(320px, 54%);
}

.message.agent-rich .message-body {
  line-height: 1.52;
  min-width: 0;
  overflow-wrap: break-word;
  white-space: normal;
}

.message.agent-rich .message-body > :first-child {
  margin-top: 0;
}

.message.agent-rich .message-body > :last-child {
  margin-bottom: 0;
}

.message.agent-rich .message-body p {
  margin: 8px 0;
}

.message.agent-rich .message-body h1,
.message.agent-rich .message-body h2,
.message.agent-rich .message-body h3,
.message.agent-rich .message-body h4 {
  color: #17202a;
  letter-spacing: 0;
  line-height: 1.24;
  margin: 17px 0 7px;
}

.message.agent-rich .message-body h1 {
  font-size: 20px;
}

.message.agent-rich .message-body h2 {
  font-size: 17px;
}

.message.agent-rich .message-body h3,
.message.agent-rich .message-body h4 {
  font-size: 15px;
}

.message.agent-rich .message-body ul,
.message.agent-rich .message-body ol {
  margin: 8px 0;
  padding-left: 24px;
}

.message.agent-rich .message-body li {
  margin: 3px 0;
}

.message.agent-rich .message-body blockquote {
  border-left: 3px solid var(--accent);
  color: #465463;
  margin: 10px 0;
  padding: 3px 0 3px 12px;
}

.message.agent-rich .message-body a {
  color: #1859c9;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.message.agent-rich .message-body a:hover {
  color: #0d47ad;
}

.message.agent-rich .message-body .rich-link-blocked {
  color: var(--muted);
  text-decoration: line-through;
}

.message.agent-rich .message-body code {
  background: #eef2f5;
  border: 1px solid #dce2e8;
  border-radius: 4px;
  color: #26313d;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92em;
  padding: 1px 4px;
}

.message.agent-rich .message-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 15px 0;
}

.rich-toolbar {
  align-items: center;
  background: #f4f6f8;
  border-bottom: 1px solid #d7dde4;
  color: #4d5966;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 35px;
  padding: 3px 5px 3px 9px;
}

.rich-toolbar > span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.rich-toolbar strong {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-toolbar svg {
  height: 15px;
  width: 15px;
}

.rich-toolbar button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #52606d;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  padding: 0;
  width: 28px;
}

.rich-toolbar button:hover,
.rich-toolbar button:focus-visible {
  background: #e3e8ed;
  color: #17202a;
}

.rich-toolbar-actions {
  flex: 0 0 auto;
}

.rich-code-block,
.rich-table-block,
.rich-chart {
  border: 1px solid #d7dde4;
  border-radius: 6px;
  margin: 11px 0;
  max-width: 100%;
  overflow: hidden;
}

.rich-code-block pre {
  background: #18212b;
  color: #f5f7f9;
  margin: 0;
  max-height: 440px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 13px;
  tab-size: 2;
  white-space: pre;
}

.message.agent-rich .rich-code-block pre code {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 12px;
  padding: 0;
}

.rich-table-scroll,
.rich-chart-data {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.rich-table-block table,
.rich-chart-data table {
  border-collapse: collapse;
  font-size: 12px;
  margin: 0;
  min-width: 100%;
  width: max-content;
}

.rich-table-block th,
.rich-table-block td,
.rich-chart-data th,
.rich-chart-data td {
  border-bottom: 1px solid #e0e5ea;
  border-right: 1px solid #e7ebef;
  max-width: 360px;
  min-width: 96px;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.rich-table-block th:first-child,
.rich-table-block td:first-child,
.rich-chart-data th:first-child,
.rich-chart-data td:first-child {
  min-width: 132px;
}

.rich-table-block th,
.rich-chart-data th {
  background: #edf1f4;
  color: #2a3540;
  font-weight: 750;
}

.rich-table-block tbody tr:nth-child(even),
.rich-chart-data tbody tr:nth-child(even) {
  background: #f8fafb;
}

.rich-table-block tr:last-child > *,
.rich-chart-data tr:last-child > * {
  border-bottom: 0;
}

.rich-table-block tr > *:last-child,
.rich-chart-data tr > *:last-child {
  border-right: 0;
}

.rich-chart-canvas,
.rich-table-chart {
  background: #fff;
  height: 330px;
  min-height: 230px;
  padding: 12px;
  position: relative;
  width: 100%;
}

.rich-chart-canvas canvas,
.rich-table-chart canvas {
  display: block;
  height: 100% !important;
  max-width: 100%;
  width: 100% !important;
}

.rich-chart-data {
  border-top: 1px solid #d7dde4;
}

.rich-image-link {
  align-items: center;
  background: #f0f4f7;
  border: 1px solid #d7dde4;
  border-radius: 6px;
  display: inline-flex;
  gap: 7px;
  margin: 6px 0;
  max-width: 100%;
  padding: 7px 9px;
  text-decoration: none;
}

.rich-image-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rich-image-link svg {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.rich-image-link.blocked {
  color: var(--muted);
}

.message-body .search-hit {
  background: #ffe78a;
  border-radius: 3px;
  color: #1f2937;
  padding: 0 2px;
}

.message-mention {
  color: #1859c9;
  font-weight: 750;
}

.message-mention.mine {
  background: rgba(8, 122, 85, 0.12);
  border-radius: 4px;
  color: #086747;
  padding: 1px 2px;
}

.message.mine .message-mention,
.message.mine .message-mention.mine {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
}

.reaction-chip {
  align-items: center;
  background: #f2f5f8;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  gap: 3px;
  min-height: 25px;
  padding: 2px 7px;
}

.reaction-chip strong {
  font-size: 10px;
}

.reaction-chip.mine {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.message.mine .reaction-chip {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.message footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  gap: 6px;
  justify-content: flex-end;
}

.message.mine footer {
  color: #dce6ff;
}

.message-actions {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 7px 20px rgba(24, 33, 43, 0.15);
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: 4;
}

.message.mine .message-actions {
  left: auto;
  right: 0;
}

.message {
  position: relative;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.message-actions button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  display: inline-flex;
  font-size: 11px;
  gap: 4px;
  min-height: 28px;
  padding: 4px 6px;
  white-space: nowrap;
}

.message-actions button[hidden] {
  display: none !important;
}

.message-actions button[data-action="copy-message"],
.message-actions button[data-action="react"],
.message-actions button[data-action="reply"],
.message-actions button[data-action="edit-message"] {
  justify-content: center;
  width: 30px;
}

.message-actions button[data-action="copy-message"] span,
.message-actions button[data-action="react"] span,
.message-actions button[data-action="reply"] span,
.message-actions button[data-action="edit-message"] span {
  display: none;
}

.message-actions button:hover {
  background: var(--panel-soft);
}

.attachment {
  display: grid;
  gap: 8px;
}

.attachment-content {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.attachment-media-frame {
  aspect-ratio: var(--attachment-ratio);
  background: rgba(24, 33, 43, 0.06);
  border-radius: 8px;
  display: grid;
  max-width: 100%;
  overflow: hidden;
  width: var(--attachment-width);
}

.message.mine .attachment-media-frame {
  background: rgba(255, 255, 255, 0.14);
}

.attachment-media-frame img,
.attachment-media-frame video {
  display: block;
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: contain;
  width: 100%;
}

.attachment img,
.attachment video {
  border-radius: 8px;
  max-height: 320px;
  max-width: 100%;
  object-fit: contain;
}

.attachment audio {
  width: min(320px, 100%);
}

.voice-note-player {
  align-items: center;
  display: grid;
  gap: 3px 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: min(300px, 64vw);
}

.voice-note-player audio {
  min-width: 0;
  width: 100%;
}

.voice-note-icon {
  align-items: center;
  background: rgba(24, 33, 43, 0.08);
  border-radius: 50%;
  display: inline-flex;
  grid-row: 1 / 3;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.voice-note-duration {
  color: var(--muted);
  font-size: 10px;
  grid-column: 2;
}

.message.mine .voice-note-icon {
  background: rgba(255, 255, 255, 0.18);
}

.message.mine .voice-note-duration {
  color: rgba(255, 255, 255, 0.76);
}

.voice-note-placeholder {
  justify-content: space-between;
}

.attachment-file {
  align-items: center;
  background: rgba(24, 33, 43, 0.06);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 8px;
}

.message.mine .attachment-file {
  background: rgba(255, 255, 255, 0.14);
}

.p2p-transfer-status {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 6px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: min(260px, 62vw);
}

.p2p-transfer-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.p2p-transfer-copy strong,
.p2p-transfer-copy span {
  overflow-wrap: anywhere;
}

.p2p-transfer-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.p2p-transfer-copy span {
  font-size: 10px;
}

.p2p-transfer-status.complete .p2p-transfer-copy strong {
  color: var(--green);
}

.p2p-retry {
  height: 30px;
  min-height: 30px;
  width: 30px;
}

.p2p-progress {
  background: rgba(24, 33, 43, 0.12);
  border-radius: 3px;
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
}

.p2p-progress:not(.visible) {
  visibility: hidden;
}

.p2p-progress span {
  background: var(--blue);
  display: block;
  height: 100%;
  transition: width 120ms linear;
}

.message.mine .p2p-transfer-status,
.message.mine .p2p-transfer-copy strong {
  color: rgba(255, 255, 255, 0.94);
}

.message.mine .p2p-transfer-copy span {
  color: rgba(255, 255, 255, 0.74);
}

.message.mine .p2p-progress {
  background: rgba(255, 255, 255, 0.22);
}

.message.mine .p2p-progress span {
  background: #fff;
}

.typing-row {
  color: var(--muted);
  font-size: 12px;
  min-height: 20px;
  padding: 0 clamp(16px, 4vw, 52px) 5px;
}

.composer {
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 10px clamp(12px, 3vw, 34px) 12px;
  position: relative;
}

.reply-bar {
  align-items: center;
  background: var(--panel-soft);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  display: none;
  font-size: 12px;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 9px;
}

.reply-bar.visible {
  display: flex;
}

.composer-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  margin: 0 auto;
  max-width: 980px;
  width: 100%;
}

.composer textarea {
  border-radius: 22px;
  max-height: 120px;
  min-height: 42px;
  overflow-y: auto;
  padding: 10px 14px;
  scrollbar-width: none;
}

.composer textarea::-webkit-scrollbar {
  display: none;
}

.file-picker {
  display: none;
}

.attachment-button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.voice-note-button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.voice-note-composer {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  margin: 0 auto;
  max-width: 980px;
  width: 100%;
}

.recording-dot {
  background: #d92d20;
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.voice-note-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.voice-note-copy strong {
  font-size: 13px;
}

.voice-note-copy span {
  color: var(--muted);
  font-size: 11px;
}

.mention-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  bottom: calc(100% - 4px);
  box-shadow: 0 10px 28px rgba(24, 33, 43, 0.16);
  display: none;
  left: clamp(12px, 3vw, 34px);
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  position: absolute;
  width: min(340px, calc(100% - 24px));
  z-index: 12;
}

.mention-menu.visible {
  display: grid;
}

.mention-menu button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 40px;
  padding: 5px 7px;
  text-align: left;
}

.mention-menu button:hover,
.mention-menu button:focus-visible {
  background: var(--panel-soft);
}

.reaction-modal {
  max-width: 390px;
}

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

.reaction-picker button {
  background: var(--panel-soft);
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 24px;
  min-height: 48px;
  padding: 4px;
}

.reaction-picker button:hover,
.reaction-picker button:focus-visible {
  border-color: var(--blue);
}

.send-button {
  background: var(--blue);
  border-color: var(--blue);
  height: 42px;
  min-height: 42px;
  width: 42px;
}

.send-button:hover {
  background: #245bc7;
  border-color: #245bc7;
}

.panel-backdrop {
  background: rgba(24, 33, 43, 0.34);
  border: 0;
  border-radius: 0;
  display: none;
  inset: 0;
  min-height: 0;
  padding: 0;
  position: fixed;
  z-index: 70;
}

.panel-backdrop.visible {
  display: block;
}

.panel-backdrop:hover {
  background: rgba(24, 33, 43, 0.34);
  border-color: transparent;
}

.side-panel {
  background: var(--panel);
  box-shadow: -16px 0 44px rgba(24, 33, 43, 0.16);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 410px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform 0.2s ease;
  width: min(92vw, 410px);
  z-index: 80;
}

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

.side-header {
  justify-content: space-between;
}

.side-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.panel-section {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 18px;
}

.panel-section:last-child {
  border-bottom: 0;
}

.panel-section h2 {
  font-size: 14px;
  margin: 0;
}

.panel-section p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.conversation-profile {
  justify-items: center;
  padding: 24px 18px;
  text-align: center;
}

.conversation-profile h2 {
  font-size: 18px;
  margin-top: 2px;
}

.action-list {
  gap: 3px;
  padding: 8px;
}

.action-row {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  display: grid;
  gap: 11px;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  justify-content: stretch;
  min-height: 64px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.action-row:hover {
  background: var(--panel-soft);
  border-color: transparent;
}

.action-row > span:nth-child(2) {
  min-width: 0;
}

.action-row strong,
.action-row small {
  display: block;
}

.action-row strong {
  font-size: 14px;
  margin-bottom: 3px;
}

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

.action-row > svg {
  color: var(--muted);
  height: 16px;
  width: 16px;
}

.action-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.action-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.action-icon.violet {
  background: #efeafa;
  color: var(--violet);
}

.agent-connection-note {
  align-items: flex-start;
  background: #f4f6ff;
  border: 1px solid #dce2ff;
  border-radius: 8px;
  color: #3f4a78;
  display: flex;
  font-size: 12px;
  gap: 9px;
  line-height: 1.45;
  padding: 11px;
}

.agent-connection-note svg {
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.hermes-install-option {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr) 38px;
  text-align: left;
}

.hermes-install-option strong,
.hermes-install-option small {
  display: block;
}

.hermes-install-option small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.hermes-install-link {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  display: flex;
  height: 38px;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
  width: 38px;
}

.hermes-install-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.hermes-connect-divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  gap: 10px;
  text-transform: uppercase;
}

.hermes-connect-divider::before,
.hermes-connect-divider::after {
  background: var(--line);
  content: "";
  flex: 1 1 auto;
  height: 1px;
}

.agent-gateway-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
}

.agent-gateway-row span:nth-child(2),
.agent-gateway-row strong,
.agent-gateway-row small {
  display: block;
  min-width: 0;
}

.agent-gateway-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.agent-profile p,
.agent-session-settings p,
.agent-security-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.enterprise-directory {
  border-bottom: 1px solid var(--line);
  gap: 6px;
  padding: 12px 8px 10px;
}

.enterprise-spaces {
  border-bottom: 1px solid var(--line);
  gap: 6px;
  padding: 12px 8px 10px;
}

.enterprise-space-row {
  min-height: 58px;
}

.space-avatar {
  background: #e9eef8;
  color: #344d78;
}

.enterprise-heading {
  padding: 0 8px 4px;
}

.enterprise-heading > span:first-child {
  min-width: 0;
}

.enterprise-heading h2,
.enterprise-heading small {
  display: block;
}

.enterprise-heading h2 {
  font-size: 15px;
}

.enterprise-heading small,
.enterprise-contact-row small,
.enterprise-organization small {
  color: var(--muted);
  font-size: 12px;
}

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

.enterprise-contact-row {
  min-height: 58px;
}

.enterprise-avatar {
  background: #e5f3ed;
  color: #126047;
  font-size: 14px;
  font-weight: 700;
}

.directory-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 8px;
}

.enterprise-enrollment-badge {
  background: #e5f3ed;
  border: 1px solid #b8ddce;
  border-radius: 6px;
  color: #126047;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.enterprise-settings {
  gap: 12px;
}

.enterprise-status {
  background: #e5f3ed;
  border-radius: 999px;
  color: #126047;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
}

.enterprise-organization {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr);
}

.enterprise-organization strong,
.enterprise-organization small {
  display: block;
}

.managed-device-note {
  background: var(--panel-soft);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  padding: 10px;
}

.managed-space-card,
.managed-space-note {
  gap: 10px;
}

.managed-space-card > p,
.managed-space-note > p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.managed-space-badge {
  align-items: center;
  background: #e9eef8;
  border-radius: 5px;
  color: #344d78;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
  padding: 5px 7px;
  text-transform: capitalize;
  width: fit-content;
}

.managed-space-badge svg {
  height: 13px;
  width: 13px;
}

.space-policy-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  padding-top: 9px;
}

.space-policy-row span {
  color: var(--muted);
}

.invite-result:empty {
  display: none;
}

.invite-result input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.qr-pairing {
  display: grid;
  gap: 14px;
  justify-items: stretch;
  width: 100%;
}

.qr-code-shell {
  align-items: center;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  justify-self: center;
  max-width: 278px;
  padding: 12px;
  width: 100%;
}

.qr-code-image {
  display: block;
  height: auto;
  image-rendering: pixelated;
  max-height: 100%;
  max-width: 100%;
}

.qr-unavailable {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.qr-pairing-copy {
  text-align: center;
}

.qr-pairing-copy strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.invite-code-details {
  border-top: 1px solid var(--line);
  padding-top: 4px;
  width: 100%;
}

.invite-code-details summary {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  list-style: none;
  min-height: 38px;
}

.invite-code-details summary::-webkit-details-marker {
  display: none;
}

.invite-code-details[open] summary svg {
  transform: rotate(180deg);
}

.invite-code-details > div {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.invite-code-details textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  min-height: 92px;
}

.qr-scanner-modal {
  max-width: 520px;
}

.qr-scanner-preview {
  aspect-ratio: 4 / 3;
  background: #111820;
  border: 1px solid #34404d;
  border-radius: 8px;
  min-height: 260px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.qr-scanner-preview video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.qr-scan-target {
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(7, 12, 17, 0.28);
  left: 50%;
  max-height: 68%;
  max-width: 68%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 230px;
}

.qr-scan-status {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  min-height: 20px;
  text-align: center;
}

.qr-scanner-actions {
  justify-content: center;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

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

.member-list {
  display: grid;
  gap: 3px;
}

.member-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 50px;
  padding: 5px 0;
}

.member-row-actions {
  display: inline-flex;
  gap: 2px;
}

.member-row .icon-button,
.member-row-actions .icon-button {
  height: 34px;
  min-height: 34px;
  width: 34px;
}

.member-dot {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 50%;
  color: #2857bc;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

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

.member-row strong {
  font-size: 13px;
}

.member-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.device-list {
  display: grid;
  gap: 3px;
}

.device-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 48px;
}

.device-row .action-icon {
  height: 34px;
  width: 34px;
}

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

.device-row strong {
  font-size: 13px;
}

.device-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.setting-list {
  gap: 0;
}

.setting-list > h2 {
  margin-bottom: 10px;
}

.notification-settings > .section-heading {
  margin-bottom: 2px;
}

.section-heading .notification-state {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
}

.section-heading .notification-state.on {
  background: #e5f3ed;
  color: #126047;
}

.section-heading .notification-state.off {
  background: var(--panel-soft);
  color: var(--muted);
}

.section-heading .notification-state.blocked,
.section-heading .notification-state.needs-action {
  background: #fff0e3;
  color: #8a4519;
}

.notification-options[aria-disabled="true"] {
  opacity: 0.5;
}

.notification-test {
  margin-top: 10px;
}

.notification-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 10px 0 0;
}

.toggle-row {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 0;
}

.toggle-row + .toggle-row {
  border-top: 1px solid var(--line);
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 13px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.toggle-row input {
  accent-color: var(--accent);
  height: 21px;
  min-height: 21px;
  width: 21px;
}

.toggle-row.compact {
  min-height: 44px;
  padding: 5px 0;
}

.section-heading.subheading {
  margin-top: 4px;
}

.folder-assignment-list {
  display: grid;
  gap: 0;
}

.private-organization textarea {
  min-height: 84px;
  resize: vertical;
}

.wide-button {
  width: 100%;
}

.text-button,
.danger-link {
  background: transparent;
  border-color: transparent;
  justify-content: flex-start;
  min-height: 38px;
  padding: 4px 0;
}

.text-button {
  color: var(--blue);
}

.danger-link {
  color: var(--red);
}

.text-button:hover,
.danger-link:hover {
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
}

.danger-zone {
  background: var(--red-soft);
}

.settings-disclosure {
  padding: 0;
}

.settings-disclosure summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  min-height: 58px;
  padding: 12px 18px;
}

.settings-disclosure summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure summary span {
  align-items: center;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 9px;
}

.settings-disclosure[open] summary > svg {
  transform: rotate(180deg);
}

.disclosure-body {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.toast-stack {
  bottom: 16px;
  display: grid;
  gap: 8px;
  pointer-events: none;
  position: fixed;
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  z-index: 160;
}

.workspace-toast-stack {
  bottom: 82px;
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff;
  line-height: 1.35;
  padding: 11px 13px;
}

.modal-backdrop,
.incoming-call-backdrop {
  align-items: center;
  background: rgba(24, 33, 43, 0.56);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
}

.modal-backdrop {
  z-index: 140;
}

.modal-backdrop.visible,
.incoming-call-backdrop {
  display: flex;
}

.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  max-height: calc(100dvh - 36px);
  max-width: 540px;
  overflow-y: auto;
  padding: 20px;
  width: min(100%, 540px);
}

.compact-modal {
  max-width: 420px;
  text-align: center;
}

.folder-manager-modal,
.folder-picker-modal,
.member-manager-modal {
  text-align: left;
}

.folder-manager-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.folder-manager-row {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 32px minmax(0, 1fr) 34px 34px;
}

.folder-manager-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 6px;
  color: #2857bc;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.folder-manager-icon svg {
  height: 17px;
  width: 17px;
}

.folder-manager-row .icon-button {
  height: 34px;
  min-height: 34px;
  width: 34px;
}

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

.folder-picker-list {
  display: grid;
  gap: 5px;
  max-height: min(42vh, 340px);
  overflow-y: auto;
}

.folder-picker-row {
  align-items: center;
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  min-height: 52px;
  padding: 7px;
  text-align: left;
  width: 100%;
}

.folder-picker-row:hover,
.folder-picker-row.selected {
  background: var(--panel-soft);
  border-color: transparent;
}

.folder-picker-row.selected .folder-manager-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.folder-picker-row strong,
.folder-picker-row small {
  display: block;
  overflow-wrap: anywhere;
}

.folder-picker-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.folder-picker-state {
  color: var(--accent);
  display: inline-flex;
}

.folder-picker-state svg {
  height: 17px;
  width: 17px;
}

.folder-picker-create {
  margin-top: 2px;
}

.member-role-summary {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 44px;
}

.member-role-summary span {
  color: var(--muted);
  font-size: 12px;
}

.admin-permissions {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 0;
  padding: 8px 12px;
}

.admin-permissions legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
}

.device-link-modal {
  max-width: 580px;
}

.device-link-code {
  max-width: 420px;
}

.device-link-warning {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent-strong);
  display: flex;
  font-size: 12px;
  gap: 8px;
  padding: 10px 12px;
}

.device-link-warning svg {
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.modal-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.modal h2,
.modal p {
  margin: 0;
}

.modal h2 {
  font-size: 20px;
}

.modal p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 5px;
}

.modal textarea {
  min-height: 120px;
}

.modal-actions {
  justify-content: flex-end;
}

.modal-actions button {
  min-width: 96px;
}

.modal-danger-icon {
  align-items: center;
  background: var(--red-soft);
  border-radius: 50%;
  color: var(--red);
  display: inline-flex;
  height: 54px;
  justify-content: center;
  justify-self: center;
  width: 54px;
}

.modal-info-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 54px;
  justify-content: center;
  justify-self: center;
  width: 54px;
}

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

.recovery-words span {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  padding: 8px;
}

.logout-recovery-modal {
  grid-template-rows: minmax(0, 1fr) auto;
  max-width: 480px;
  overflow: hidden;
}

.logout-recovery-content {
  display: grid;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}

.logout-recovery-footer {
  display: grid;
  gap: 12px;
}

.logout-recovery-note,
.alert-inline {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  text-align: left;
}

.logout-recovery-note strong {
  color: var(--ink);
}

.logout-recovery-confirm {
  align-items: flex-start;
  display: flex;
  font-size: 13px;
  gap: 10px;
  line-height: 1.4;
  text-align: left;
}

.logout-recovery-confirm input {
  accent-color: var(--accent);
  flex: 0 0 auto;
  height: 18px;
  margin: 1px 0 0;
  min-height: 18px;
  width: 18px;
}

.logout-recovery-actions {
  flex-wrap: wrap;
}

.modal-danger-icon svg {
  height: 24px;
  width: 24px;
}

.incoming-call-backdrop {
  backdrop-filter: blur(8px);
  display: flex;
  z-index: 130;
}

.incoming-call {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-width: 360px;
  padding: 30px 24px 24px;
  text-align: center;
  width: min(100%, 360px);
}

.incoming-pulse {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 68px;
  justify-content: center;
  margin-bottom: 16px;
  width: 68px;
}

.incoming-pulse svg {
  height: 28px;
  width: 28px;
}

.call-kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.incoming-call h2 {
  font-size: 22px;
  margin: 5px 0 26px;
}

.incoming-actions {
  display: flex;
  gap: 52px;
}

.round-call-button,
.round-control {
  border-radius: 50%;
  height: 58px;
  min-height: 58px;
  padding: 0;
  width: 58px;
}

.round-call-button svg,
.round-control svg {
  height: 24px;
  width: 24px;
}

.round-call-button.decline,
.round-control.hangup {
  background: var(--red);
  border-color: var(--red);
}

.round-call-button.accept {
  background: var(--accent);
  border-color: var(--accent);
}

.call-overlay {
  background: #151c24;
  color: #fff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  inset: 0;
  position: fixed;
  z-index: 110;
}

.call-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 20px;
}

.call-header strong,
.call-header span {
  display: block;
}

.call-header span {
  color: #b8c2cd;
  font-size: 12px;
  margin-top: 3px;
}

.call-close {
  background: rgba(255, 255, 255, 0.1);
  border-color: transparent;
  color: #fff;
}

.call-media-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  min-height: 0;
  overflow: hidden;
  padding: 0 18px 16px;
  position: relative;
}

.remote-tile,
.local-tile {
  align-items: center;
  background: #232d38;
  border: 1px solid #34404d;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.remote-tile video,
.local-tile video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.remote-tile audio {
  display: none;
}

.tile-label {
  background: rgba(12, 17, 23, 0.66);
  border-radius: 6px;
  bottom: 10px;
  color: #fff;
  font-size: 12px;
  left: 10px;
  padding: 5px 8px;
  position: absolute;
}

.remote-tile.waiting {
  flex-direction: column;
  gap: 14px;
}

.remote-tile.waiting p {
  color: #c6d0da;
  margin: 0;
}

.call-avatar {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  font-size: 34px;
  font-weight: 800;
  height: 96px;
  justify-content: center;
  width: 96px;
}

.local-tile {
  bottom: 30px;
  height: min(25vh, 210px);
  position: absolute;
  right: 30px;
  width: min(25vw, 280px);
  z-index: 2;
}

.local-tile.voice {
  display: none;
}

.call-controls {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  min-height: 92px;
  padding: 14px 18px 20px;
}

.round-control {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  color: #fff;
}

.round-control:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: transparent;
}

.round-control.off {
  background: #fff;
  color: var(--ink);
}

@media (max-width: 720px) {
  html,
  body,
  .app-shell {
    height: 100dvh;
    overflow: hidden;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: 100dvh;
    overscroll-behavior-x: none;
    touch-action: pan-y pinch-zoom;
  }

  .workspace.mobile-list .rail {
    display: flex;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  .workspace.mobile-list .chat {
    display: none;
  }

  .workspace.mobile-chat .rail {
    display: none;
  }

  .workspace.mobile-chat .chat {
    display: grid;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  .rail {
    border-right: 0;
    height: 100dvh;
    overscroll-behavior-x: none;
  }

  .chat-list,
  .messages {
    overscroll-behavior-x: none;
  }

  .rail-header,
  .chat-header,
  .side-header {
    min-height: 60px;
    padding: 8px 10px;
  }

  .brand-mark.compact {
    flex-basis: 36px;
    height: 36px;
    width: 36px;
  }

  .rail-footer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .chat {
    grid-template-rows: 60px minmax(0, 1fr) auto auto;
    height: 100dvh;
    min-height: 0;
  }

  .mobile-back {
    display: inline-flex;
    height: 38px;
    min-height: 38px;
    width: 38px;
  }

  .chat-title {
    flex: 1 1 auto;
    gap: 7px;
  }

  .chat-title .avatar {
    height: 36px;
    width: 36px;
  }

  .chat-title > div > strong {
    font-size: 13px;
  }

  .chat-title > div > span {
    font-size: 11px;
  }

  .chat-tools {
    gap: 2px;
  }

  .chat-tools .icon-button {
    height: 38px;
    min-height: 38px;
    width: 38px;
  }

  .chat-tools svg {
    height: 18px;
    width: 18px;
  }

  .messages {
    gap: 4px;
    padding: 12px 10px 8px;
  }

  .message {
    max-width: 86%;
  }

  .message-actions {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: inline-flex !important;
    opacity: 1;
    padding: 0;
    pointer-events: auto;
    position: static;
    visibility: visible;
  }

  .message-actions button[data-action="delete-self"],
  .message-actions button[data-action="delete-all"] {
    display: none;
  }

  .message-actions button[data-action="copy-message"],
  .message-actions button[data-action="react"],
  .message-actions button[data-action="reply"],
  .message-actions button[data-action="edit-message"] {
    color: var(--muted);
    height: 26px;
    min-height: 26px;
    padding: 4px;
    width: 26px;
  }

  .message.mine .message-actions button[data-action="copy-message"],
  .message.mine .message-actions button[data-action="react"],
  .message.mine .message-actions button[data-action="reply"],
  .message.mine .message-actions button[data-action="edit-message"] {
    color: #fff;
  }

  .message-actions button[data-action="copy-message"] svg,
  .message-actions button[data-action="react"] svg,
  .message-actions button[data-action="reply"] svg,
  .message-actions button[data-action="edit-message"] svg {
    height: 14px;
    width: 14px;
  }

  .message.agent-rich {
    max-width: 96%;
    min-width: min(280px, 86%);
  }

  .message.agent-rich .message-body h1 {
    font-size: 18px;
  }

  .message.agent-rich .message-body h2 {
    font-size: 16px;
  }

  .rich-chart-canvas,
  .rich-table-chart {
    height: 250px;
    min-height: 220px;
    padding: 8px;
  }

  .rich-table-block th,
  .rich-table-block td,
  .rich-chart-data th,
  .rich-chart-data td {
    min-width: 88px;
    padding: 7px 8px;
  }

  .rich-table-block th:first-child,
  .rich-table-block td:first-child,
  .rich-chart-data th:first-child,
  .rich-chart-data td:first-child {
    min-width: 116px;
  }

  .voice-note-player {
    min-width: min(260px, 68vw);
  }

  .typing-row {
    padding: 0 12px 4px;
  }

  .composer {
    padding: 7px 8px max(8px, env(safe-area-inset-bottom));
  }

  .composer-row {
    align-items: center;
    gap: 5px;
  }

  .composer textarea {
    height: 40px;
    min-height: 40px;
    padding: 9px 12px;
  }

  .attachment-button,
  .voice-note-button,
  .send-button {
    height: 40px;
    min-height: 40px;
    width: 40px;
  }

  .mention-menu {
    bottom: calc(100% - 2px);
    left: 8px;
    width: calc(100% - 16px);
  }

  .side-panel {
    box-shadow: none;
    max-width: none;
    width: 100vw;
  }

  .panel-backdrop.visible {
    display: none;
  }

  .modal-backdrop,
  .incoming-call-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .modal,
  .incoming-call {
    max-height: calc(100dvh - 20px);
    max-width: none;
    padding: 20px 18px max(20px, env(safe-area-inset-bottom));
    width: 100%;
  }

  .modal-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .logout-recovery-modal {
    padding-bottom: 0;
  }

  .logout-recovery-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    margin: 0 -18px;
    padding: 12px 18px max(14px, env(safe-area-inset-bottom));
  }

  .logout-recovery-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logout-recovery-actions [data-modal-action="confirm-logout"] {
    grid-column: 1 / -1;
  }

  .qr-code-shell {
    max-width: 246px;
  }

  .device-link-code {
    max-width: min(82vw, 340px);
  }

  .qr-scanner-preview {
    aspect-ratio: 1;
    min-height: 0;
  }

  .incoming-call {
    padding-top: 28px;
  }

  .call-header {
    min-height: 62px;
    padding: 10px 12px;
  }

  .call-media-grid {
    grid-template-columns: 1fr;
    padding: 0 8px 10px;
  }

  .local-tile {
    bottom: 18px;
    height: 156px;
    right: 18px;
    width: 112px;
  }

  .call-controls {
    gap: 10px;
    min-height: 86px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .round-control {
    height: 54px;
    min-height: 54px;
    width: 54px;
  }

  .screen-control {
    display: none;
  }

  .split-actions,
  .button-row {
    flex-direction: column;
  }

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

@media (min-width: 721px) and (max-width: 980px) {
  .workspace {
    grid-template-columns: 290px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* QEYET v32 interaction system */
.inbox-filters {
  align-items: center;
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  padding: 0 12px 8px;
}

.inbox-filters.standard-filters {
  grid-template-columns: max-content max-content minmax(0, 1fr) max-content 30px 30px;
}

.inbox-filters.enterprise-filters {
  grid-template-columns: max-content max-content minmax(0, 1fr) max-content 30px;
}

.inbox-filter {
  background: transparent;
  border-color: transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  min-height: 30px;
  min-width: 0;
  overflow: hidden;
  padding: 4px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-filters .inbox-filter:nth-child(3) {
  width: 100%;
}

.inbox-filter:hover {
  background: var(--panel-soft);
  border-color: transparent;
  color: var(--ink);
}

.inbox-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.inbox-filter.icon-only {
  aspect-ratio: 1;
  padding: 0;
  width: 30px;
}

.inbox-filter svg {
  height: 15px;
  width: 15px;
}

.folder-tray {
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 12px;
}

.folder-tray-content {
  max-height: 0;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 180ms ease, opacity 120ms ease, padding 180ms ease;
}

.folder-tray.open .folder-tray-content {
  max-height: min(208px, 30vh);
  opacity: 1;
  padding-bottom: 8px;
}

.folder-tray-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 38px;
}

.folder-tray-header strong {
  font-size: 11px;
  text-transform: uppercase;
}

.folder-tray-disclosure {
  align-items: center;
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  justify-content: flex-start;
  min-height: 34px;
  min-width: 0;
  padding: 0;
}

.folder-tray-disclosure:hover {
  background: transparent;
  border-color: transparent;
  color: var(--accent-strong);
}

.folder-tray-disclosure svg {
  color: var(--muted);
  height: 14px;
  transition: transform 180ms ease;
  width: 14px;
}

.folder-tray.open .folder-tray-disclosure svg {
  transform: rotate(180deg);
}

.folder-tray-header .icon-button {
  height: 28px;
  min-height: 28px;
  width: 28px;
}

.folder-tray-list {
  display: grid;
  gap: 2px;
  max-height: min(200px, 28vh);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.folder-tray-item,
.folder-tray-empty {
  align-items: center;
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 9px;
  grid-template-columns: 18px minmax(0, 1fr);
  justify-items: start;
  min-height: 34px;
  min-width: 0;
  padding: 5px 8px;
  text-align: left;
  width: 100%;
}

.folder-tray-item span,
.folder-tray-empty span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tray-item svg,
.folder-tray-empty svg {
  height: 16px;
  width: 16px;
}

.folder-tray-item:hover,
.folder-tray-empty:hover {
  background: var(--panel-soft);
  border-color: transparent;
  color: var(--ink);
}

.folder-tray-item.active {
  background: var(--panel-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.chat-section-label {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 10px 10px 4px;
  text-transform: uppercase;
}

.chat-item.unread .chat-meta strong {
  font-weight: 800;
}

.chat-item.unread .chat-meta > span {
  color: var(--ink);
  font-weight: 600;
}

.chat-item.swiping {
  background: var(--accent-soft);
  border-color: #c5e7db;
}

.chat-pin {
  color: var(--muted);
  display: inline-flex;
  margin-right: 4px;
  vertical-align: -2px;
}

.chat-pin svg {
  height: 12px;
  width: 12px;
}

.call-list-item {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  justify-content: stretch;
  min-height: 58px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.call-list-item:hover {
  background: var(--panel-soft);
  border-color: transparent;
}

.call-list-item > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.call-list-item strong,
.call-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-list-item small {
  color: var(--muted);
  font-size: 11px;
}

.call-list-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.call-list-icon.missed {
  background: var(--red-soft);
  color: var(--red);
}

.chat {
  position: relative;
}

.connection-banner {
  align-items: center;
  background: #fff8e6;
  border: 1px solid #eedaa3;
  border-radius: 7px;
  color: #6d5513;
  display: flex;
  gap: 9px;
  left: 50%;
  min-height: 44px;
  padding: 7px 12px;
  position: absolute;
  top: 70px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  z-index: 8;
}

.connection-banner:hover {
  background: #fff4d6;
  border-color: #e6cd89;
}

.connection-banner > span {
  display: grid;
  gap: 1px;
  text-align: left;
}

.connection-banner strong {
  font-size: 12px;
}

.connection-banner small {
  font-size: 10px;
}

.space-status-banner {
  align-items: center;
  background: #edf2fa;
  border: 1px solid #cbd7e9;
  border-radius: 7px;
  color: #344d78;
  display: flex;
  font-size: 12px;
  font-weight: 650;
  gap: 8px;
  left: 50%;
  min-height: 40px;
  padding: 7px 12px;
  position: absolute;
  top: 70px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  z-index: 8;
}

.space-status-banner.revoked {
  background: #fff0f1;
  border-color: #efc3c7;
  color: #8d2f39;
}

.space-status-banner svg {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.composer-attachments {
  display: none;
  gap: 7px;
  margin: 0 auto;
  max-width: 980px;
  overflow-x: auto;
  padding: 1px;
  width: 100%;
}

.composer-attachments.visible {
  display: flex;
}

.composer-attachment {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  flex: 0 0 min(270px, 78vw);
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  padding: 5px;
}

.composer-attachment > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

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

.composer-attachment strong {
  font-size: 12px;
}

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

.composer-attachment .icon-button {
  height: 30px;
  min-height: 30px;
  width: 30px;
}

.composer-preview,
.composer-file-icon {
  align-items: center;
  background: #fff;
  border-radius: 6px;
  color: var(--blue);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  overflow: hidden;
  width: 42px;
}

.composer-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.message.swiping-reply {
  transition: none;
}

.message.swiping-reply::before {
  color: var(--blue);
  content: "\21A9";
  font-size: 22px;
  left: -34px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.message-state[role="button"] {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.message-state[role="button"]:hover,
.message-state[role="button"]:focus-visible {
  text-decoration-color: currentColor;
}

.message-highlight {
  animation: message-highlight 1.8s ease;
}

@keyframes message-highlight {
  0%, 100% { box-shadow: 0 1px 1px rgba(24, 33, 43, 0.04); }
  35% { box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.22); }
}

.primary-connect {
  background: var(--accent);
  border-color: var(--accent);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.primary-connect > span:nth-child(2),
.connect-options button > span:nth-child(2),
.attachment-options button > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.primary-connect small {
  color: rgba(255, 255, 255, 0.78);
}

.connect-options,
.attachment-options {
  display: grid;
  gap: 6px;
}

.connect-options button,
.attachment-options button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  padding: 11px;
  text-align: left;
  width: 100%;
}

.attachment-options button {
  grid-template-columns: 40px minmax(0, 1fr);
}

.connect-options button:hover,
.attachment-options button:hover {
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

.connect-options small,
.attachment-options small,
.primary-connect small {
  font-size: 11px;
}

.conversation-utilities {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 18px;
}

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

.conversation-utilities button {
  background: var(--panel-soft);
  border-color: transparent;
  color: var(--ink);
  display: grid;
  font-size: 11px;
  gap: 5px;
  justify-items: center;
  min-height: 64px;
  padding: 8px 4px;
}

.conversation-utilities button:hover {
  background: var(--accent-soft);
  border-color: transparent;
}

.conversation-utilities svg {
  color: var(--accent);
}

.privacy-summary {
  justify-items: center;
  padding: 24px 18px;
  text-align: center;
}

.privacy-shield,
.success-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 64px;
  justify-content: center;
  width: 64px;
}

.privacy-shield svg,
.success-icon svg {
  height: 28px;
  width: 28px;
}

.safety-card .verified-badge {
  background: var(--accent-soft);
  border-radius: 5px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 6px;
}

.safety-number {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  line-height: 1.5;
  min-height: 0;
  overflow-wrap: anywhere;
  padding: 9px;
  width: 100%;
}

.safety-number-large {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  padding: 14px;
  text-align: center;
}

.action-sheet {
  text-align: left;
}

.action-sheet-header {
  align-items: center;
  display: flex;
  gap: 10px;
}

.action-sheet-header span:last-child {
  min-width: 0;
}

.action-sheet-list {
  display: grid;
  gap: 2px;
}

.action-sheet-list button {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  justify-content: flex-start;
  min-height: 46px;
  width: 100%;
}

.action-sheet-list button:hover {
  background: var(--panel-soft);
  border-color: transparent;
}

.action-sheet-list .danger-row {
  color: var(--red);
}

.quick-reaction-row {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.quick-reaction-row button {
  background: var(--panel-soft);
  border-color: transparent;
  font-size: 20px;
  min-height: 44px;
  padding: 4px;
}

.delivery-timeline {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(3, 1fr);
}

.delivery-timeline span {
  background: var(--line);
  border-radius: 3px;
  height: 5px;
}

.delivery-timeline span.complete {
  background: var(--accent);
}

.delivery-time {
  color: var(--muted);
  text-align: center;
}

.search-modal,
.media-modal {
  max-width: 680px;
}

.modal-search {
  padding: 0;
}

.modal-search .search-icon {
  left: 12px;
  top: 12px;
}

.search-type-filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.search-type-filters button {
  background: var(--panel-soft);
  border-color: transparent;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  min-height: 32px;
  padding: 5px 9px;
}

.search-type-filters button.active {
  background: var(--ink);
  color: #fff;
}

.search-results {
  display: grid;
  max-height: min(54vh, 520px);
  overflow-y: auto;
}

.search-result {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  display: grid;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  justify-content: stretch;
  min-height: 58px;
  padding: 8px 4px;
  text-align: left;
}

.search-result:hover {
  background: var(--panel-soft);
}

.search-result > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.search-result small,
.search-result time {
  color: var(--muted);
  font-size: 10px;
}

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

.search-result-icon {
  align-items: center;
  background: var(--panel-soft);
  border-radius: 50%;
  color: var(--blue);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.shared-media-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: min(62vh, 620px);
  overflow-y: auto;
}

.shared-media-item {
  align-content: start;
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--ink);
  display: grid;
  min-width: 0;
  padding: 6px;
  text-align: left;
}

.shared-media-preview {
  align-items: center;
  aspect-ratio: 1;
  background: #e7ebef;
  border-radius: 5px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.shared-media-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.shared-media-item > span:last-child {
  display: grid;
  min-width: 0;
  padding: 6px 2px 2px;
}

.shared-media-item strong,
.shared-media-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-media-item strong {
  font-size: 11px;
}

.shared-media-item small {
  color: var(--muted);
  font-size: 9px;
}

.meeting-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 1fr);
}

.meeting-detail-row {
  align-items: center;
  background: var(--panel-soft);
  border-radius: 7px;
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  padding: 10px;
}

.meeting-detail-row span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.danger-text {
  color: var(--red) !important;
}

html[data-text-size="small"] {
  --user-message-size: 13px;
}

html[data-text-size="medium"] {
  --user-message-size: 14px;
}

html[data-text-size="large"] {
  --user-message-size: 16px;
}

html[data-text-size="extra-large"] {
  --user-message-size: 18px;
}

.message-body,
.composer textarea {
  font-size: var(--user-message-size, 14px);
}

body.high-contrast {
  --ink: #050709;
  --muted: #3f4852;
  --line: #aeb7c1;
  --line-strong: #778491;
  --accent: #006b49;
  --accent-strong: #004b34;
}

body.high-contrast .chat-item.active,
body.high-contrast .message {
  border-color: var(--line-strong);
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 720px) {
  .inbox-filters {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace-toast-stack {
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    width: auto;
  }

  .chat-list {
    padding-top: 0;
  }

  .connection-banner {
    top: 64px;
    width: calc(100% - 16px);
  }

  .connection-banner small {
    display: none;
  }

  .message-actions {
    display: none !important;
  }

  .message {
    touch-action: pan-y;
  }

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

  .composer-attachment {
    flex-basis: min(250px, 82vw);
  }

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

  .meeting-form-grid {
    grid-template-columns: 1fr;
  }

  .action-sheet {
    border-radius: 8px 8px 0 0;
    margin-bottom: -10px;
  }

  .search-modal,
  .media-modal {
    border-radius: 8px 8px 0 0;
    margin-bottom: -10px;
  }
}

@media (min-width: 721px) {
  .chat-list,
  .messages,
  .side-content {
    scrollbar-gutter: stable;
  }
}
