:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --panel: #ffffff;
  --panel-soft: #f8faf7;
  --ink: #17201b;
  --muted: #657268;
  --line: #dfe6df;
  --brand: #0c7c66;
  --brand-strong: #075f4d;
  --brand-soft: #dff3ed;
  --chat-bg: #efeae2;
  --message-in: #ffffff;
  --message-out: #d9fdd3;
  --message-text: #111b21;
  --message-meta: #667781;
  --message-panel: #f0f2f5;
  --quote-bg: rgba(255, 255, 255, 0.5);
  --gold: #d18d2f;
  --danger: #b42318;
  --shadow: 0 20px 70px rgba(26, 43, 34, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(12, 124, 102, 0.1), transparent 38%),
    linear-gradient(315deg, rgba(209, 141, 47, 0.14), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    system-ui,
    sans-serif;
}

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

button {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 440px);
  gap: 40px;
  align-items: center;
  max-width: 1160px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  margin: 0 auto;
  padding: 40px 24px;
}

.auth-visual {
  position: relative;
  min-height: 520px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(7, 95, 77, 0.92), rgba(19, 32, 28, 0.96)),
    radial-gradient(circle at 74% 18%, rgba(209, 141, 47, 0.45), transparent 36%);
  box-shadow: var(--shadow);
}

.auth-visual::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
}

.cipher-card {
  position: absolute;
  left: 10%;
  top: 20%;
  display: flex;
  align-items: center;
  width: min(420px, 80%);
  gap: 22px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.cipher-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  background: #f6fffb;
  color: var(--brand-strong);
  border-radius: 8px;
  font-size: 36px;
  font-weight: 800;
}

.cipher-lines {
  display: grid;
  gap: 12px;
  flex: 1;
}

.cipher-lines span {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.cipher-lines span:nth-child(2) {
  width: 76%;
}

.cipher-lines span:nth-child(3) {
  width: 54%;
  background: rgba(209, 141, 47, 0.88);
}

.signal-grid {
  position: absolute;
  right: 9%;
  bottom: 14%;
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 10px;
}

.signal-grid span {
  display: grid;
  place-items: center;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-family: Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
}

.auth-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.brand-row,
.rail-brand,
.user-strip,
.chat-head,
.list-head {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 24px;
}

.brand-logo,
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.brand-logo.small {
  width: 36px;
  height: 36px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.avatar {
  background: #e4f3ef;
  color: var(--brand-strong);
}

.avatar.is-bot {
  background: #10251f;
  color: #d9fdd3;
}

.avatar.is-abnormal {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.22);
}

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

.avatar.mini {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

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

.brand-row h1 {
  font-size: 28px;
  line-height: 1.2;
}

.brand-row p,
.chat-head p,
.list-head p,
.user-strip p,
.conversation-copy small,
.message-meta,
.panel-label,
.conversation-meta span,
.conversation-meta small {
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-tab {
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
}

.auth-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 20px rgba(23, 32, 27, 0.08);
}

.auth-form,
.modal-panel form {
  display: none;
  gap: 15px;
}

.auth-form.active,
.modal-panel form,
.unlock-row {
  display: grid;
}

.app-version {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0.78;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.form-label {
  color: var(--muted);
  font-size: 13px;
}

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

input,
select {
  height: 44px;
  padding: 0 13px;
}

textarea {
  min-height: 44px;
  max-height: 130px;
  padding: 11px 12px;
  resize: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(12, 124, 102, 0.12);
}

.primary-button,
.ghost-button,
.icon-button,
.rail-button {
  border: 0;
  border-radius: 8px;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover,
.rail-button.active,
.icon-button:hover {
  background: var(--brand-strong);
  color: #fff;
}

.primary-button.compact {
  min-height: 40px;
  white-space: nowrap;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.ghost-button.danger {
  color: var(--danger);
}

.ghost-button.danger:hover {
  border-color: var(--danger);
  background: #fff6f4;
  color: var(--danger);
}

.icon-button,
.rail-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #ecf3ef;
  color: var(--brand-strong);
  font-weight: 800;
}

.chat-view {
  display: grid;
  grid-template-columns: 76px minmax(260px, 340px) minmax(0, 1fr) minmax(250px, 300px);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
}

.rail {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  overflow: hidden;
  padding: 18px 12px;
  background: #12211c;
  color: #fff;
}

.rail-brand {
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.rail-nav,
.rail-bottom {
  display: grid;
  justify-content: center;
  gap: 10px;
}

.rail-nav {
  align-content: start;
  padding-top: 42px;
}

.rail-button {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
}

.rail-button.is-secure {
  background: rgba(0, 168, 132, 0.28);
  color: #dff8ef;
}

.rail-button.is-locked {
  background: rgba(209, 141, 47, 0.9);
  color: #12211c;
}

.list-panel,
.detail-panel {
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
}

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

.list-head {
  justify-content: space-between;
  gap: 12px;
  padding: 22px 18px 14px;
}

.list-title-copy {
  display: none;
}

.list-head h2,
.chat-head h2,
.user-strip h2 {
  font-size: 20px;
}

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

.search-box {
  padding: 0 18px 14px;
}

.application-notice-panel {
  display: grid;
  gap: 8px;
  padding: 0 18px 12px;
}

.application-notice-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.application-notice-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(12, 124, 102, 0.16);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 24px rgba(17, 27, 33, 0.06);
}

.application-notice-card:hover {
  border-color: rgba(12, 124, 102, 0.36);
  box-shadow: 0 12px 30px rgba(17, 27, 33, 0.1);
}

.application-notice-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 900;
}

.application-notice-card.group .application-notice-icon {
  background: #fff2dc;
  color: #9a5f10;
}

.application-notice-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.application-notice-copy strong,
.application-notice-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-notice-copy small {
  color: var(--muted);
  font-size: 12px;
}

.application-notice-badge {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.conversation-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 10px 16px;
}

.conversation-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 68px;
  margin-bottom: 6px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.conversation-item:hover,
.conversation-item.active {
  background: #fff;
  box-shadow: 0 8px 30px rgba(23, 32, 27, 0.08);
}

.conversation-avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.conversation-avatar-wrap > .avatar {
  grid-area: 1 / 1;
}

.conversation-security-icon {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #f8faf7;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(23, 32, 27, 0.16);
}

.conversation-security-icon.is-locked {
  background: #10251f;
}

.conversation-security-icon.is-encrypted {
  background: var(--gold);
}

.conversation-security-icon.is-temporary {
  background: #d18d2f;
}

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

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

.conversation-time {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}

.conversation-side {
  display: grid;
  justify-items: end;
  align-self: stretch;
  gap: 5px;
  min-width: 42px;
}

.conversation-item.has-unread {
  background: #fff;
}

.conversation-item.has-unread .conversation-copy strong {
  color: var(--ink);
  font-weight: 900;
}

.conversation-item.has-unread .conversation-copy small {
  color: #2d3a34;
  font-weight: 700;
}

.conversation-unread-text {
  margin-right: 5px;
  color: #e53935;
  font-weight: 900;
}

.conversation-item.has-unread .conversation-time {
  color: #e53935;
  font-weight: 800;
}

.unread-badge {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.list-version {
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0.7;
}

.conversation-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.conversation-flags em,
.conversation-draft {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
}

.conversation-flags em {
  padding: 2px 6px;
  background: #e7f5ef;
  color: var(--brand-strong);
}

.conversation-draft {
  margin-right: 5px;
  color: #d18d2f;
}

.icon-button.has-unread,
.rail-button.has-unread {
  position: relative;
}

.icon-button.has-unread::after,
.rail-button.has-unread::after {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--message-panel);
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  content: attr(data-unread);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.list-empty,
.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--chat-bg);
}

.chat-head {
  position: relative;
  gap: 12px;
  min-height: 78px;
  padding: 16px 22px;
  border-bottom: 1px solid #d1d7db;
  background: var(--message-panel);
}

.chat-title-area {
  min-width: 0;
  flex: 1;
  cursor: default;
}

.chat-title-area h2,
.chat-title-area p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.chat-actions #voiceCallBtn,
.chat-actions #videoCallBtn,
.chat-actions #notifyBtn {
  display: none !important;
}

.chat-more-button {
  display: none;
}

.chat-more-button:not(.hidden) {
  display: grid;
  flex: 0 0 auto;
}

.chat-more-button.active {
  background: rgba(0, 168, 132, 0.12);
  color: var(--brand-strong);
}

.chat-more-menu {
  position: absolute;
  top: calc(100% - 8px);
  right: 18px;
  z-index: 35;
  display: grid;
  width: min(230px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(17, 27, 33, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(17, 27, 33, 0.18);
}

.chat-more-menu button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(17, 27, 33, 0.08);
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.chat-more-menu button:last-child {
  border-bottom: 0;
}

.chat-more-menu button:hover,
.chat-more-menu button:focus-visible {
  background: #f4f8f6;
}

.chat-more-menu strong {
  font-size: 14px;
}

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

.chat-more-menu .danger strong {
  color: var(--danger);
}

.sound-test-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ghost-button.compact {
  min-height: 34px;
  padding-inline: 12px;
  white-space: nowrap;
}

.messages {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 22px;
  background-color: var(--chat-bg);
  background-image:
    linear-gradient(30deg, rgba(17, 27, 33, 0.025) 12%, transparent 12.5%, transparent 87%, rgba(17, 27, 33, 0.025) 87.5%),
    linear-gradient(150deg, rgba(17, 27, 33, 0.025) 12%, transparent 12.5%, transparent 87%, rgba(17, 27, 33, 0.025) 87.5%);
  background-size: 34px 34px;
}

.unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 10px 0 16px;
  color: #008069;
  font-size: 12px;
  font-weight: 900;
}

.unread-divider::before,
.unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 128, 105, 0.22);
}

.unread-divider span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.12);
}

.message-history-loader {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.message-history-loader button {
  border: 1px solid rgba(17, 27, 33, 0.08);
  border-radius: 999px;
  padding: 7px 14px;
  color: #54656f;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 2px rgba(17, 27, 33, 0.06);
  cursor: pointer;
}

.message-history-loader button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  margin: 0 0 12px;
}

.message.mine {
  align-items: flex-end;
  margin-left: auto;
}

.message-content-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: fit-content;
  max-width: min(78%, 680px);
  min-width: 0;
}

.message.mine .message-content-row {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.message:not(.mine) .message-content-row {
  align-self: flex-start;
}

.message-stack {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.message.mine .message-stack {
  justify-items: end;
}

.message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  border-radius: 8px;
  background: #e4f3ef;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 27, 33, 0.08);
}

.message-avatar.is-bot {
  background: #10251f;
  color: #d9fdd3;
}

.message-avatar.is-abnormal {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.22);
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content-row .message-bubble,
.message-content-row .message-meta,
.message-content-row .message-reactions {
  max-width: 100%;
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  align-self: flex-start;
  width: fit-content;
  gap: 9px;
  row-gap: 2px;
  max-width: min(70%, 620px);
  min-width: 0;
  margin: 3px 6px 0;
  color: var(--message-meta);
  font-size: 11px;
  opacity: 1;
}

.message.mine .message-meta {
  align-self: flex-end;
  justify-content: flex-end;
}

.message:hover .message-meta {
  opacity: 1;
}

.message.mine .message-meta,
.message.local-sending .message-meta,
.message.local-failed .message-meta {
  opacity: 1;
}

.message.local-sending .message-bubble {
  opacity: 0.76;
}

.message.local-failed .message-bubble {
  outline: 1px solid rgba(180, 35, 24, 0.32);
}

.message-reply-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--message-meta);
  cursor: pointer;
  font: inherit;
}

.message-reply-button:hover {
  color: var(--brand-strong);
}

.message-recall-button {
  color: #b42318;
}

.message-reply-button.is-favorite {
  color: var(--gold);
  font-weight: 800;
}

.forwarded-mark {
  display: block;
  margin-bottom: 2px;
  color: var(--message-meta);
  font-size: 11px;
  font-style: italic;
}

.multi-select-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid rgba(17, 27, 33, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 16px rgba(17, 27, 33, 0.08);
}

.multi-select-bar span {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.message-select-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 6px 4px;
  border: 1px solid rgba(17, 27, 33, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
}

.message.mine .message-select-button {
  align-self: flex-end;
}

.message.selected .message-bubble {
  outline: 2px solid rgba(12, 124, 102, 0.32);
  outline-offset: 2px;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(70%, 620px);
  margin: 3px 6px 0;
}

.message.mine .message-reactions {
  align-self: flex-end;
  justify-content: flex-end;
}

.message-reactions button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(17, 27, 33, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #3b4a54;
  font-size: 12px;
}

.message-reactions button.active {
  border-color: rgba(12, 124, 102, 0.36);
  background: #e7f5ef;
  color: var(--brand-strong);
}

.recalled-message {
  color: var(--message-meta);
  font-size: 13px;
  font-style: italic;
}

.message-bubble.is-recalled {
  background: rgba(255, 255, 255, 0.72);
  color: var(--message-meta);
}

.message.mine .message-bubble.is-recalled {
  background: rgba(217, 253, 211, 0.68);
}

.message-status {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--message-meta);
  font: inherit;
  white-space: nowrap;
}

.message-status.sending::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}

.message-status.failed {
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
}

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

.message-bubble {
  position: relative;
  display: inline-block;
  align-self: flex-start;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-width: min(70%, 620px);
  padding: 5px 9px 6px;
  border: 0;
  border-radius: 7.5px;
  background: var(--message-in);
  color: var(--message-text);
  font-size: 14.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.message-bubble.is-text {
  display: inline-flex;
  align-items: center;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: fit-content !important;
  padding: 6px 11px !important;
  line-height: 1.35;
}

.message-text-content {
  display: block;
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
}

.message.mine .message-bubble {
  align-self: flex-end;
  border-color: transparent;
  background: var(--message-out);
  color: var(--message-text);
}

.message-bubble.encrypted {
  border-style: dashed;
}

.message-quote,
.composer-reply {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  background: var(--quote-bg);
  color: var(--message-text);
  white-space: normal;
}

.message-quote {
  margin-top: 6px;
  padding: 4px 7px;
  border-left: 0;
  border-radius: 4px;
  background: rgba(11, 20, 26, 0.08);
  color: #57656d;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.message-quote:hover {
  background: rgba(11, 20, 26, 0.13);
}

.message-quote span,
.composer-reply strong,
.composer-reply small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-quote span,
.composer-reply small {
  color: var(--message-meta);
  font-size: 13px;
}

.message-quote span {
  font-size: 12px;
}

.message-bubble.has-attachment,
.message-bubble.has-secret,
.message-bubble.has-special {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 0;
  max-width: min(360px, 70vw);
}

.message.mine .message-bubble.has-attachment,
.message.mine .message-bubble.has-secret,
.message.mine .message-bubble.has-special {
  background: var(--message-out);
  color: var(--message-text);
}

.burn-badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 241, 240, 0.9);
  color: #b42318;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.message.mine .burn-badge {
  justify-self: end;
}

.burn-badge.is-counting {
  background: #ffe5df;
  color: #a32012;
}

.burn-badge.is-burned {
  background: #e7f5ef;
  color: var(--brand-strong);
}

.burn-badge.is-waiting {
  background: rgba(240, 242, 245, 0.88);
  color: var(--message-meta);
}

.message-caption {
  color: inherit;
  white-space: pre-wrap;
}

.message-media {
  display: block;
  max-width: min(360px, 100%);
  max-height: 280px;
  border-radius: 8px;
  background: #0f1714;
  object-fit: contain;
}

.message-bubble.has-voice {
  display: block;
  gap: 0;
  padding: 0;
  max-width: min(240px, 70vw);
}

.message-bubble.has-voice .burn-badge {
  margin: 0 10px 8px;
}

.voice-card {
  position: relative;
  width: var(--voice-width, 128px);
  max-width: min(220px, 62vw);
}

.voice-message {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 7.5px;
  background: transparent;
  color: #20312a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.message.mine .voice-message {
  flex-direction: row-reverse;
  color: #173b29;
}

.voice-message:focus-visible {
  outline: 2px solid rgba(0, 168, 132, 0.32);
  outline-offset: -2px;
}

.voice-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.14);
}

.voice-icon::before {
  position: absolute;
  top: 5px;
  left: 7px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
  content: "";
}

.voice-message.playing .voice-icon::before {
  top: 5px;
  left: 5px;
  width: 7px;
  height: 8px;
  border: 0;
  border-right: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.voice-wave {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 3px;
  min-width: 24px;
}

.message.mine .voice-wave {
  justify-content: flex-end;
}

.voice-wave span {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.42;
}

.voice-wave span:nth-child(2) {
  height: 13px;
  opacity: 0.55;
}

.voice-wave span:nth-child(3) {
  height: 18px;
  opacity: 0.68;
}

.voice-message.playing .voice-wave span {
  animation: voice-wave 0.9s ease-in-out infinite;
}

.voice-message.playing .voice-wave span:nth-child(2) {
  animation-delay: 0.12s;
}

.voice-message.playing .voice-wave span:nth-child(3) {
  animation-delay: 0.24s;
}

.voice-duration {
  flex: 0 0 auto;
  min-width: 28px;
  color: rgba(32, 49, 42, 0.78);
  font-size: 12px;
  text-align: right;
}

.message.mine .voice-duration {
  color: rgba(23, 59, 41, 0.72);
  text-align: left;
}

.voice-burn-badge {
  display: block;
  margin: -2px 10px 8px;
  color: rgba(180, 35, 24, 0.78);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.message.mine .voice-burn-badge {
  text-align: right;
}

.voice-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@keyframes voice-wave {
  0%,
  100% {
    transform: scaleY(0.72);
  }

  50% {
    transform: scaleY(1.18);
  }
}

.file-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(0, 168, 132, 0.13);
  color: var(--brand-strong);
  font-weight: 800;
}

.file-copy {
  display: grid;
  min-width: 0;
}

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

.file-copy small {
  color: var(--message-meta);
}

.secure-attachment {
  min-width: min(280px, 70vw);
}

.secure-file-card {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.secure-file-card .ghost-button {
  min-height: 32px;
  padding-inline: 14px;
}

.secret-card {
  display: grid;
  gap: 10px;
}

.secret-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.secret-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #00a884;
  color: #fff;
  font-weight: 800;
}

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

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

.secret-copy small {
  color: var(--message-meta);
}

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

.secret-unlock-form input:invalid {
  box-shadow: none;
}

.secret-unlocked {
  padding-top: 2px;
  white-space: pre-wrap;
}

.special-card,
.poll-card,
.receipt-card,
.solitaire-card {
  display: grid;
  gap: 10px;
  width: max-content;
  min-width: 0;
  max-width: min(340px, 68vw);
}

.special-note {
  color: var(--message-meta);
  font-size: 13px;
}

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

.solitaire-head span {
  color: var(--message-meta);
  font-size: 12px;
  font-weight: 800;
}

.solitaire-card h3 {
  font-size: 15px;
  line-height: 1.45;
}

.solitaire-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.solitaire-entry {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.solitaire-entry > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.12);
  color: #008069;
  font-size: 12px;
  font-weight: 900;
}

.solitaire-entry div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.solitaire-entry strong {
  font-size: 13px;
}

.solitaire-entry p {
  white-space: pre-wrap;
}

.solitaire-empty {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--message-meta);
  font-size: 13px;
}

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

.solitaire-form textarea {
  min-height: 38px;
  max-height: 82px;
  border-color: rgba(134, 150, 160, 0.28);
  border-radius: 8px;
}

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

.poll-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(134, 150, 160, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--message-text);
  text-align: left;
  cursor: pointer;
}

.poll-option:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.poll-option.picked {
  border-color: #00a884;
  background: rgba(0, 168, 132, 0.12);
}

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

.read-count {
  color: var(--message-meta);
  font-size: 13px;
}

.mention {
  color: #027eb5;
  font-weight: 800;
}

.composer {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: 40px 40px minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px 16px 12px;
  border-top: 1px solid #d1d7db;
  background: var(--message-panel);
  overflow: visible;
}

.composer textarea {
  min-height: 42px;
  border-color: transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--message-text);
  box-shadow: none;
}

.composer textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.voice-hold-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #111b21;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(17, 27, 33, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.voice-hold-button:hover {
  background: #f7f8fa;
}

.voice-hold-button.pressing {
  background: #dfe4e8;
  color: #111b21;
  box-shadow: inset 0 0 0 1px rgba(17, 27, 33, 0.12);
}

.voice-hold-button.cancel {
  background: #fff1f0;
  color: #b42318;
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.22);
}

.voice-burn-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 58px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  color: #54656f;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(17, 27, 33, 0.08);
  cursor: pointer;
  user-select: none;
}

.voice-burn-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--danger);
}

.voice-burn-toggle:has(input:checked) {
  background: #fff1f0;
  color: var(--danger);
}

.text-burn-toggle {
  min-width: 52px;
}

.composer.is-voice-mode {
  grid-template-columns: 40px 40px minmax(160px, 1fr) auto;
}

.voice-record-tip {
  position: absolute;
  right: max(16px, 12%);
  bottom: calc(100% + 12px);
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(17, 27, 33, 0.9);
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 36px rgba(17, 27, 33, 0.22);
  pointer-events: none;
}

.voice-record-tip::after {
  position: absolute;
  right: 34px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: rotate(45deg);
  content: "";
}

.voice-record-tip strong,
.voice-record-tip span {
  position: relative;
  z-index: 1;
}

.voice-record-tip strong {
  font-size: 14px;
}

.voice-record-tip span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.voice-record-tip.cancel {
  background: rgba(180, 35, 24, 0.92);
}

.composer .icon-button {
  background: transparent;
  color: #54656f;
}

.composer .icon-button:hover {
  background: rgba(84, 101, 111, 0.08);
  color: #111b21;
}

.composer .primary-button {
  background: #00a884;
}

.composer .primary-button:hover {
  background: #008069;
}

.more-toggle {
  display: grid;
}

.composer-reply {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: #fff;
}

.clipboard-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(17, 27, 33, 0.08);
}

.clipboard-preview-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.clipboard-preview-copy strong,
.clipboard-preview-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.clipboard-preview-copy span {
  color: var(--message-meta);
  font-size: 12px;
}

.clipboard-preview-list {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, 48vw);
  overflow-x: auto;
  scrollbar-width: none;
}

.clipboard-preview-list::-webkit-scrollbar {
  display: none;
}

.clipboard-preview-item {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #e7f5ef;
}

.clipboard-preview-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.clipboard-preview-item small {
  position: absolute;
  right: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  overflow: hidden;
  border-radius: 999px;
  padding: 2px 5px;
  background: rgba(17, 27, 33, 0.7);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clipboard-preview-item .icon-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  min-height: 0;
  border-radius: 999px;
  background: rgba(17, 27, 33, 0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.composer.is-disabled {
  pointer-events: none;
  filter: grayscale(0.3);
}

.icon-button.active,
.icon-button.recording {
  background: var(--brand);
  color: #fff;
}

.icon-button.recording {
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.quick-action-panel {
  position: absolute;
  left: 16px;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  padding: 10px;
  border: 1px solid #d1d7db;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(11, 20, 26, 0.18);
}

.quick-action-panel button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  background: #f0f2f5;
  color: #111b21;
  text-align: left;
}

.quick-action-panel button:hover {
  background: rgba(0, 168, 132, 0.12);
}

.quick-action-panel button:disabled {
  opacity: 0.48;
}

.quick-action-panel strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #00a884;
  color: #fff;
  font-size: 14px;
}

.quick-action-panel button.recording strong {
  background: var(--danger);
}

.quick-action-panel span {
  min-width: 0;
  overflow: hidden;
  color: #3b4a54;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button.danger {
  background: var(--danger);
}

.emoji-picker {
  position: absolute;
  left: 18px;
  bottom: 76px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 38px);
  gap: 6px;
  padding: 10px;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(11, 20, 26, 0.16);
}

.mention-picker {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(100% - 8px);
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(11, 20, 26, 0.16);
  z-index: 30;
}

.mention-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.mention-option.active,
.mention-option:hover {
  border-color: transparent;
  background: #f0f2f5;
}

.mention-option span:last-child {
  display: grid;
  min-width: 0;
}

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

.mention-option small {
  color: var(--message-meta);
}

.emoji-picker button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f0f2f5;
  font-size: 20px;
}

.emoji-picker button:hover {
  background: rgba(0, 168, 132, 0.12);
}

.lock-panel {
  position: fixed;
  inset: 0 !important;
  z-index: 45;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  background: rgba(248, 250, 247, 0.94);
  backdrop-filter: blur(16px);
  text-align: center;
}

.lock-symbol {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background: #12211c;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.call-panel {
  position: absolute;
  inset: 78px 0 73px;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 19, 16, 0.62);
  backdrop-filter: blur(12px);
}

.call-window {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(420px, calc(100% - 12px));
  min-height: 330px;
  padding: 32px 22px 28px;
  border-radius: 12px;
  background: linear-gradient(180deg, #10201b 0%, #07110e 100%);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.call-copy {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.call-copy strong {
  font-size: 22px;
  line-height: 1.25;
}

.call-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.call-end-button {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(217, 45, 32, 0.34);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.call-end-button:hover {
  transform: translateY(-1px);
  background: #b42318;
  box-shadow: 0 16px 34px rgba(180, 35, 24, 0.38);
}

.call-end-button:active {
  transform: translateY(0) scale(0.96);
}

.call-answer-button,
.call-reject-button {
  min-width: 76px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.call-answer-button {
  background: #12b76a;
}

.call-reject-button {
  background: var(--danger);
}

.remote-video {
  width: 100%;
  max-height: 54vh;
  border-radius: 8px;
  background: #07110d;
  object-fit: contain;
}

.local-video {
  position: absolute;
  right: 18px;
  bottom: 74px;
  width: min(160px, 28%);
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: #07110d;
  object-fit: cover;
}

.unlock-row {
  grid-template-columns: minmax(190px, 280px) auto;
  gap: 10px;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-right: 0;
  border-left: 1px solid var(--line);
}

.user-strip {
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.user-strip > div:not(.avatar) {
  min-width: 0;
}

.user-strip h2,
.user-strip p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-edit-button {
  flex: 0 0 auto;
  margin-left: auto;
}

.status-block,
.detail-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.status-row strong {
  color: var(--ink);
}

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

.security-hub-panel {
  width: min(390px, 100%);
}

.security-hub-card {
  margin-top: 14px;
  background: var(--panel-soft);
}

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

.conversation-meta {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

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

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

.meta-chip-grid span,
.meta-section {
  min-width: 0;
  border: 1px solid rgba(17, 27, 33, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.meta-chip-grid span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.meta-chip-grid strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-section {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.meta-section p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.meta-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.meta-section-head strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.announcement-read {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.read-members {
  color: var(--muted);
  line-height: 1.5;
}

.group-log-list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.group-log-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.group-log-row strong {
  color: var(--ink);
  font-size: 13px;
}

.group-log-row small,
.group-log-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.meta-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag-list span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f5ef;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}

.meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.meta-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.meta-tabs button.active {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 1px 4px rgba(17, 27, 33, 0.08);
}

.meta-tab-panel {
  display: none;
  gap: 10px;
}

.meta-tab-panel.active {
  display: grid;
}

.meta-member-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.meta-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.meta-member-copy {
  display: grid;
  min-width: 0;
}

.meta-member-copy strong,
.meta-member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-member em,
.role-badge {
  color: var(--brand-strong);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.call-history-list {
  display: grid;
  gap: 7px;
}

.call-history-row {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.call-history-row small {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
  background: rgba(18, 33, 28, 0.46);
}

.modal-panel {
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.request-panel,
.device-list,
.forward-list,
.invite-result {
  display: grid;
  gap: 10px;
}

.request-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.request-list,
.device-list {
  display: grid;
  gap: 8px;
}

.request-row,
.device-row,
.forward-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(17, 27, 33, 0.08);
  border-radius: 8px;
  background: var(--panel-soft);
}

.request-row span,
.device-row span,
.forward-option span:last-child {
  display: grid;
  min-width: 0;
}

.request-row strong,
.device-row strong,
.forward-option strong,
.request-row small,
.device-row small,
.forward-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-row small,
.device-row small,
.forward-option small {
  color: var(--muted);
  font-size: 12px;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

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

.device-row.is-current strong {
  color: var(--brand-strong);
}

.forward-list {
  max-height: 340px;
  overflow: auto;
}

.forward-option {
  grid-template-columns: auto auto minmax(0, 1fr);
  cursor: pointer;
}

.invite-result {
  margin-top: 14px;
  justify-items: center;
  padding: 12px;
  border: 1px solid rgba(12, 124, 102, 0.18);
  border-radius: 8px;
  background: #f4fbf8;
}

.invite-result img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
}

.invite-result input {
  width: 100%;
  text-align: center;
}

.temp-invite-result strong {
  color: var(--brand-strong);
  font-size: 14px;
}

.temp-invite-panel {
  width: min(460px, 100%);
}

.temp-invite-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(12, 124, 102, 0.16);
  border-radius: 8px;
  background: #f4fbf8;
}

.temp-invite-summary strong {
  font-size: 18px;
}

.temp-invite-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.temp-invite-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

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

.history-modal-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  width: min(760px, 100%);
  overflow: hidden;
}

.history-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.history-search-form input,
.history-filter-row input,
.history-filter-row select {
  height: 38px;
}

.history-search-form .primary-button {
  min-width: 76px;
  min-height: 38px;
  padding-inline: 16px;
}

.favorite-scope-tabs,
.history-filter-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.favorite-scope-tabs::-webkit-scrollbar,
.history-filter-tabs::-webkit-scrollbar {
  display: none;
}

.favorite-scope-tabs button,
.history-filter-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  min-width: 58px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f8;
  color: #3b4a54;
  font-weight: 800;
  cursor: pointer;
}

.favorite-scope-tabs button.active,
.history-filter-tabs button.active {
  border-color: var(--brand);
  background: #e7f5ef;
  color: var(--brand-strong);
}

.history-filter-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid rgba(17, 27, 33, 0.07);
  border-radius: 8px;
  background: #f7f8f8;
}

.history-filter-row label {
  gap: 4px;
}

.history-filter-row label span {
  font-size: 12px;
}

.history-filter-row .ghost-button {
  align-self: end;
  min-height: 38px;
  padding-inline: 14px;
  background: #fff;
}

.history-summary {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.history-result-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.history-result-list > span {
  padding: 16px;
  border-radius: 8px;
  background: #f7f8f8;
  color: var(--muted);
  text-align: center;
}

.history-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(17, 27, 33, 0.08);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-result + .history-result {
  border-top-color: rgba(17, 27, 33, 0.04);
}

.history-result:hover {
  border-color: rgba(0, 128, 105, 0.35);
  background: #f4fbf8;
}

.history-date-divider {
  position: sticky;
  top: 0;
  z-index: 1;
  justify-self: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(240, 242, 245, 0.95);
  color: #54656f;
  font-size: 12px;
}

.history-thumb {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e7f5ef;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
}

.history-thumb.media {
  background: #eef1f2;
}

.history-thumb img,
.history-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-result-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-result-head,
.history-result-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.history-result-head {
  justify-content: space-between;
}

.history-result-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-result small {
  color: var(--muted);
  white-space: nowrap;
}

.history-result-body em {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.history-result p {
  margin: 0;
  min-width: 0;
  color: #3b4a54;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.history-result-list:has(.history-gallery-item) {
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  align-content: start;
  gap: 10px;
}

.history-result-list:has(.history-gallery-item) .history-date-divider {
  grid-column: 1 / -1;
}

.history-gallery-item {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-gallery-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-weight: 900;
}

.history-gallery-preview img,
.history-gallery-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-gallery-preview em {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(17, 27, 33, 0.68);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}

.history-gallery-preview.link {
  align-content: center;
  justify-items: start;
  padding: 10px;
}

.history-gallery-preview.link em {
  position: static;
  margin-bottom: 8px;
  background: var(--brand);
}

.history-gallery-preview.link small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.history-gallery-item > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

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

.history-load-more {
  width: 100%;
  margin-top: 12px;
}

.message-highlight .message-bubble {
  outline: 2px solid rgba(0, 168, 132, 0.34);
  outline-offset: 2px;
}

.modal-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.close-modal {
  background: #f4f2ed;
  color: var(--ink);
}

.switch-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-switch {
  padding: 8px 0;
}

.switch-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

.switch-row.is-disabled {
  opacity: 0.55;
}

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

.switch-row small {
  margin-top: 4px;
  color: var(--muted);
}

.member-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.manage-member-list {
  max-height: 280px;
}

.manage-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
}

.manage-member-row:hover {
  background: var(--panel-soft);
}

.member-copy {
  display: grid;
  min-width: 0;
}

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

.member-copy small {
  color: var(--muted);
}

.member-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-left: 37px;
}

.member-option {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 8px;
}

.member-option:hover {
  background: var(--panel-soft);
}

.member-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.member-option small,
.member-empty {
  color: var(--muted);
}

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

.settings-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.group-settings-form {
  gap: 12px;
}

.group-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.settings-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-section h3 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.settings-section textarea {
  min-height: 72px;
  resize: vertical;
}

.secret-manage-form {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.secret-manage-list,
.burn-details-list {
  display: grid;
  gap: 8px;
}

.secret-manage-item,
.burn-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.burn-detail-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.burn-detail-row.is-done em {
  color: var(--brand-strong);
}

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

.secret-manage-copy strong,
.secret-manage-copy small,
.burn-detail-row strong,
.burn-detail-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secret-manage-copy small,
.burn-detail-row small {
  color: var(--muted);
}

.secret-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.sticky-actions {
  position: sticky;
  bottom: -20px;
  margin: 0 -4px -4px;
  padding: 12px 4px 4px;
  background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0));
  justify-content: flex-end;
}

.help-text,
.form-help {
  color: var(--muted);
  line-height: 1.5;
}

.form-help {
  font-size: 12px;
}

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

.bot-test-result {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.bot-test-result.is-loading {
  color: var(--brand-strong);
}

.bot-test-result.is-success {
  color: var(--brand);
  font-weight: 700;
}

.bot-test-result.is-error {
  color: var(--danger);
  font-weight: 700;
}

.inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.locked-meta {
  display: grid;
  gap: 8px;
}

.scrambled {
  font-family: Consolas, monospace;
  letter-spacing: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #12211c;
  color: #fff;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 1100px) {
  .chat-view {
    grid-template-columns: 72px minmax(230px, 320px) minmax(0, 1fr);
  }

  .detail-panel {
    display: none;
  }
}

@media (max-width: 820px) {
  .auth-view {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-visual {
    min-height: 260px;
  }

  .signal-grid {
    grid-template-columns: repeat(3, 52px);
  }

  .chat-view {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: 42vh 58vh;
  }

  .rail {
    grid-row: 1 / 3;
    padding-inline: 8px;
  }

  .rail-button,
  .icon-button {
    width: 38px;
    height: 38px;
  }

  .list-panel {
    min-height: 0;
  }

  .chat-panel {
    grid-column: 2;
    min-height: 0;
  }

  .message {
    max-width: 100%;
  }

  .message-bubble,
  .message-meta {
    max-width: min(88%, 620px);
  }
}

@media (max-width: 560px) {
  .auth-view {
    padding: 16px;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    padding: 20px;
  }

  .chat-view {
    grid-template-columns: 1fr;
    grid-template-rows: 64px 35vh minmax(0, calc(65vh - 64px));
  }

  .rail {
    grid-row: 1;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    padding: 8px 10px;
  }

  .rail-brand,
  .rail-nav,
  .rail-bottom {
    display: flex;
    align-items: center;
    padding: 0;
  }

  .rail-nav {
    justify-content: center;
  }

  .list-panel,
  .chat-panel {
    grid-column: 1;
  }

  .list-panel {
    grid-row: 2;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-panel {
    grid-row: 3;
  }

  .list-head {
    padding-top: 12px;
  }

  .chat-head {
    min-height: 64px;
    padding: 10px 14px;
  }

  .chat-head .ghost-button {
    min-height: 32px;
    padding-inline: 10px;
  }

  .messages {
    padding: 14px;
  }

  .composer {
    grid-template-columns: 38px 38px minmax(120px, 1fr) auto;
  }

  .settings-grid,
  .group-settings-layout,
  .secret-manage-form,
  .inline-row {
    grid-template-columns: 1fr;
  }

  .unlock-row {
    grid-template-columns: 1fr;
  }

  .lock-panel {
    inset: 64px 0 114px;
  }

  .call-panel {
    inset: 64px 0 114px;
    padding: 12px;
  }

  .call-window {
    min-height: 300px;
    padding: 28px 18px 24px;
  }

  .call-end-button {
    width: 64px;
    height: 64px;
    font-size: 14px;
  }

  .local-video {
    right: 12px;
    bottom: 68px;
    width: 120px;
  }
}

.mobile-back {
  display: none;
}

@media (max-width: 760px) {
  .chat-view {
    grid-template-columns: 1fr !important;
    grid-template-rows: 56px minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .rail {
    grid-column: 1;
    grid-row: 1 !important;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    min-height: 0;
    padding: 8px 10px;
  }

  .rail-brand,
  .rail-nav,
  .rail-bottom {
    display: flex;
    align-items: center;
    padding: 0;
  }

  .rail-brand {
    flex-direction: row;
  }

  .rail-brand span {
    display: none;
  }

  .rail-nav {
    justify-content: center;
    gap: 8px;
  }

  .rail-bottom {
    justify-content: end;
    gap: 8px;
  }

  .rail-button,
  .icon-button {
    width: 36px;
    height: 36px;
  }

  .detail-panel {
    display: none;
  }

  .list-panel,
  .chat-panel {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    border-right: 0;
  }

  .chat-view:not(.is-chat-open) .chat-panel {
    display: none;
  }

  .chat-view.is-chat-open .list-panel {
    display: none;
  }

  .chat-view.is-chat-open .chat-panel {
    display: grid;
  }

  .mobile-back:not(.hidden) {
    display: grid;
    flex: 0 0 auto;
    font-size: 24px;
    line-height: 1;
  }

  .list-head {
    padding: 14px 12px 10px;
  }

  .list-head h2,
  .chat-head h2 {
    font-size: 17px;
  }

  .head-actions {
    gap: 6px;
  }

  .search-box {
    padding: 0 12px 10px;
  }

  .application-notice-panel {
    padding: 0 12px 10px;
  }

  .conversation-list {
    padding: 4px 8px 12px;
  }

  .conversation-item {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 62px;
    padding: 8px;
  }

  .conversation-avatar-wrap {
    width: 40px;
    height: 40px;
  }

  .conversation-security-icon {
    right: -5px;
    bottom: -5px;
    width: 19px;
    height: 19px;
    font-size: 10px;
  }

  .chat-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: auto;
    padding: 8px 10px;
  }

  .chat-more-button:not(.hidden) {
    display: grid;
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .chat-head .avatar {
    width: 38px;
    height: 38px;
  }

  .chat-title-area h2 {
    font-size: 16px;
  }

  .chat-title-area p {
    font-size: 12px;
  }

  .chat-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 2px 0;
    scrollbar-width: none;
  }

  .chat-actions::-webkit-scrollbar {
    display: none;
  }

  .chat-head .ghost-button.compact {
    min-height: 30px;
    padding-inline: 8px;
    flex: 0 0 auto;
    font-size: 12px;
  }

  .messages {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 10px calc(16px + env(safe-area-inset-right)) 8px calc(14px + env(safe-area-inset-left));
  }

  .message {
    max-width: 100%;
    margin-bottom: 10px;
  }

  .message-content-row {
    gap: 6px;
    max-width: calc(100% - 18px);
  }

  .message-avatar {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 12px;
  }

  .message.mine {
    margin-right: 7px;
  }

  .message:not(.mine) {
    margin-left: 7px;
  }

  .message-meta {
    gap: 6px;
    max-width: min(82%, calc(100% - 24px));
    opacity: 1;
    font-size: 10px;
    line-height: 1.45;
  }

  .message-bubble {
    max-width: min(82%, calc(100% - 24px));
    font-size: 14px;
  }

  .message-reactions {
    max-width: min(82%, calc(100% - 24px));
  }

  .multi-select-bar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .multi-select-bar span {
    flex: 1 0 100%;
  }

  .message-bubble.has-attachment,
  .message-bubble.has-secret,
  .message-bubble.has-special {
    max-width: min(300px, calc(100% - 24px));
  }

  .special-card,
  .poll-card,
  .receipt-card,
  .solitaire-card {
    max-width: min(300px, calc(100% - 24px));
  }

  .composer {
    grid-template-columns: 34px 34px minmax(0, 1fr) auto auto !important;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding: 8px calc(8px + env(safe-area-inset-right)) 8px calc(8px + env(safe-area-inset-left));
  }

  .composer.is-voice-mode {
    grid-template-columns: 34px 34px minmax(0, 1fr) auto !important;
  }

  .more-toggle {
    display: grid;
  }

  #attachToggle,
  #secretToggle,
  #specialToggle {
    display: none;
  }

  .composer .icon-button {
    width: 34px;
    height: 34px;
  }

  .composer textarea {
    min-width: 0;
    min-height: 38px;
    padding: 9px 10px;
    font-size: 14px;
  }

  .voice-hold-button {
    min-height: 38px;
    border-radius: 18px;
    font-size: 14px;
  }

  .voice-burn-toggle {
    min-width: 44px;
    min-height: 38px;
    padding: 0 8px;
    border-radius: 18px;
  }

  .text-burn-toggle {
    min-width: 42px;
  }

  .voice-record-tip {
    right: 16px;
    left: 16px;
    bottom: calc(100% + 10px);
    min-width: 0;
  }

  .composer .primary-button {
    grid-column: auto !important;
    min-height: 38px;
    padding-inline: 12px;
  }

  .composer-reply {
    grid-column: 1 / -1;
  }

  .clipboard-preview {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px;
  }

  .clipboard-preview-list {
    max-width: 100%;
  }

  .clipboard-preview-item {
    width: 56px;
    height: 56px;
  }

  .quick-action-panel {
    right: 8px;
    left: 8px;
    bottom: calc(100% + 8px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
  }

  .emoji-picker,
  .mention-picker {
    right: 8px;
    left: 8px;
    bottom: calc(100% - 4px);
  }

  .emoji-picker {
    grid-template-columns: repeat(5, 34px);
  }

  .modal-panel,
  .wide-modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    padding: 16px;
  }

  .settings-grid,
  .group-settings-layout,
  .secret-manage-form,
  .inline-row {
    grid-template-columns: 1fr;
  }

  .lock-panel,
  .call-panel {
    inset: 58px 0 56px;
  }
}

@media (max-width: 420px) {
  .composer {
    grid-template-columns: 34px 34px minmax(0, 1fr) auto auto !important;
  }

  .composer.is-voice-mode {
    grid-template-columns: 34px 34px minmax(0, 1fr) auto !important;
  }

  .composer textarea {
    grid-column: auto;
    grid-row: auto;
  }

  .composer .primary-button {
    grid-column: auto !important;
    grid-row: auto;
    min-width: 52px;
  }

  .lock-panel,
  .call-panel {
    inset: 58px 0 98px;
  }
}

@media (max-width: 620px) {
  .history-modal-panel {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .history-modal-panel header {
    margin-bottom: 10px;
  }

  .history-search-form {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 6px;
    margin-bottom: 7px;
  }

  .history-search-form input,
  .history-filter-row input,
  .history-filter-row select {
    height: 36px;
    padding-inline: 10px;
  }

  .history-search-form .primary-button {
    min-width: 0;
    min-height: 36px;
    padding-inline: 8px;
  }

  .favorite-scope-tabs,
  .history-filter-tabs {
    gap: 6px;
    margin-bottom: 7px;
  }

  .favorite-scope-tabs button,
  .history-filter-tabs button {
    min-height: 32px;
    min-width: 50px;
    padding: 5px 11px;
    font-size: 13px;
  }

  .history-filter-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 6px;
    margin-bottom: 7px;
    padding: 7px;
  }

  .history-filter-row label span {
    display: none;
  }

  .history-filter-row .ghost-button {
    min-height: 36px;
    padding-inline: 10px;
  }

  .history-summary {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .history-result {
    min-height: 54px;
    padding: 9px 10px;
  }
}

@media (max-width: 760px) {
  .chat-view.is-chat-open {
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .chat-view.is-chat-open .rail {
    display: none;
  }

  .chat-view.is-chat-open .chat-panel {
    grid-row: 1;
  }

  .chat-view.is-chat-open .chat-head {
    grid-template-columns: 34px 34px minmax(0, 1fr) 34px;
    min-height: 54px;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
    box-shadow: 0 1px 0 rgba(17, 27, 33, 0.08);
  }

  .chat-view.is-chat-open .chat-head .avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .chat-view.is-chat-open .chat-title-area {
    flex: 1 1 auto;
    min-width: 48px;
  }

  .chat-view.is-chat-open .chat-title-area p {
    display: none;
  }

  .chat-view.is-chat-open .chat-more-button:not(.hidden) {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: transparent;
    color: #54656f;
    font-size: 22px;
  }

  .chat-view.is-chat-open .chat-more-menu {
    top: calc(100% - 2px);
    right: calc(8px + env(safe-area-inset-right));
  }

  .chat-view.is-chat-open .chat-actions {
    grid-column: 1 / -1;
    width: 100%;
    flex: 0 1 auto;
    max-width: none;
    justify-content: flex-start;
    padding: 2px 0 0;
  }

  .chat-view.is-chat-open .chat-actions .icon-button {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(0, 168, 132, 0.1);
    color: #008069;
  }

  .chat-view.is-chat-open .chat-actions #notifyBtn {
    display: none !important;
  }

  .chat-view.is-chat-open .chat-actions .ghost-button.compact {
    display: none !important;
  }

  .chat-view.is-chat-open .mobile-back:not(.hidden) {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: transparent;
    color: #54656f;
  }

  .chat-view.is-chat-open .messages {
    overflow-x: hidden;
    padding: 10px calc(18px + env(safe-area-inset-right)) 8px calc(14px + env(safe-area-inset-left));
  }

  .chat-view.is-chat-open .message {
    max-width: 100%;
  }

  .chat-view.is-chat-open .message-content-row {
    max-width: calc(100% - 18px);
  }

  .chat-view.is-chat-open .message.mine {
    margin-right: 7px;
  }

  .chat-view.is-chat-open .message:not(.mine) {
    margin-left: 7px;
  }

  .chat-view.is-chat-open .composer {
    border-top: 0;
    padding: 7px calc(8px + env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
    background: rgba(240, 242, 245, 0.96);
    box-shadow: 0 -8px 24px rgba(17, 27, 33, 0.08);
  }

  .chat-view.is-chat-open .composer textarea {
    border-radius: 18px;
  }

  .chat-view.is-chat-open .composer .icon-button {
    border-radius: 999px;
  }

  .chat-view.is-chat-open .composer .primary-button {
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 128, 105, 0.2);
  }

  .chat-view.is-chat-open .lock-panel,
  .chat-view.is-chat-open .call-panel {
    inset: 54px 0 56px;
  }
}

@media (max-width: 420px) {
  .chat-view.is-chat-open .chat-actions {
    max-width: none;
  }

  .chat-view.is-chat-open .composer {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .chat-view.is-chat-open .lock-panel,
  .chat-view.is-chat-open .call-panel {
    inset: 54px 0 98px;
  }
}

.chat-panel > .lock-panel {
  inset: 0 !important;
  z-index: 45;
  min-height: 100dvh;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  .chat-view.is-chat-open .chat-panel > .lock-panel {
    inset: 0 !important;
    padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  }
}
