@charset "UTF-8";
:root {
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Noto Sans",
    sans-serif;
  color: #23334b;
  background: #edf4fb;
  font-synthesis: none;
  --accent: #1479db;
  --accent-soft: #e8f3ff;
  --accent-rgb: 20, 121, 219;
  --green: #57b53a;
  --text: #23334b;
  --muted: #6f8097;
  --line: #dce6f0;
  --surface: #fff;
  --surface-alt: #f5f8fc;
  --canvas: #f0f6fc;
  --shadow: 0 18px 60px #133a6d12;
  --radius: 16px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button {
  border: 0;
  background: none;
}
a {
  color: var(--accent);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #56a6f4;
  outline-offset: 3px;
}
button:focus:not(:focus-visible) {
  outline: none;
}
button svg {
  flex-shrink: 0;
}
input,
select,
textarea {
  color: var(--text);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 1.15rem;
  font-weight: 650;
}
h3 {
  font-size: 1rem;
}
small {
  color: var(--muted);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
svg {
  vertical-align: middle;
  flex-shrink: 0;
}
img {
  max-width: 100%;
}
.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-button.active,
.icon-button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-button.danger {
  color: #d84d5e;
}
.icon-button.danger:hover {
  background: #fdebed;
}
.primary,
.secondary,
.danger-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 11px 17px;
  font-weight: 600;
  min-height: 42px;
}
.primary {
  background: linear-gradient(180deg, #278fe7, var(--accent));
  color: #fff;
  box-shadow: 0 4px 10px #1479db22;
}
.primary:hover {
  filter: brightness(1.05);
}
.secondary {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--text);
}
.secondary:hover {
  background: var(--accent-soft);
}
.danger-button {
  background: #e55362;
  color: white;
}
.text-button {
  color: var(--accent);
  padding: 6px 0;
  text-align: left;
}
.muted {
  color: var(--muted);
}
.flex {
  display: flex;
  align-items: center;
}
.gap {
  gap: 10px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  padding: 11px 12px;
  width: 100%;
  font-weight: 400;
  outline-offset: 1px;
  min-height: 44px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}
.field input::placeholder,
.field textarea::placeholder {
  color: #93a0b2;
}
.field textarea {
  resize: vertical;
  min-height: 80px;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.45;
}
.checkbox input {
  accent-color: var(--accent);
  margin-top: 4px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.field-help {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 650;
  white-space: nowrap;
}
.error-box {
  background: #fff0f1;
  border: 1px solid #f7c6cc;
  color: #a62f41;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.notice-box {
  background: var(--accent-soft);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.6;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid #ffffff70;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.blue {
  border-color: var(--line);
  border-top-color: var(--accent);
}

/* Sign-in: familiar sky, restrained glass, original blue/green people mark. */
.login-screen {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
  background:
    radial-gradient(ellipse at 20% 5%, #fff 0, transparent 45%),
    radial-gradient(ellipse at 95% 85%, #d5eafd 0, transparent 50%),
    linear-gradient(130deg, #edf8ff, #f6f9fd 60%, #e4f2ff);
}
.login-top {
  padding: 25px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.brand {
  display: flex;
  gap: 9px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  font-size: 1.12rem;
  letter-spacing: -0.5px;
}
.brand img {
  width: 39px;
  height: 39px;
}
.brand-sub {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}
.login-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8vw;
  padding: 30px 5vw 60px;
  max-width: 1320px;
  width: 100%;
  margin: auto;
}
.login-hero {
  max-width: 540px;
  flex: 1;
  padding-bottom: 20px;
}
.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}
.hero-eyebrow:before {
  content: "";
  width: 25px;
  height: 2px;
  background: var(--green);
}
.hero-logo {
  width: 170px;
  height: 170px;
  margin: 0 0 22px -16px;
}
.login-hero h1 {
  font-size: clamp(2.4rem, 4.2vw, 4.15rem);
  letter-spacing: -2.8px;
  font-weight: 650;
  line-height: 1.08;
}
.login-hero h1 span {
  color: var(--accent);
}
.login-hero > p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 22px;
  max-width: 410px;
}
.hero-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
  font-size: 0.76rem;
  color: #57728e;
}
.hero-features span {
  display: flex;
  gap: 7px;
  align-items: center;
}
.hero-features svg {
  color: #3faa6c;
}
.login-card {
  background: #ffffffd9;
  border: 1px solid #ffffff;
  border-radius: 22px;
  box-shadow:
    0 20px 65px #326a9d15,
    0 1px 3px #326a9d09;
  backdrop-filter: blur(20px);
  width: 380px;
  flex-shrink: 0;
  padding: 30px;
}
.login-card h2 {
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.6px;
}
.login-card .subheading {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
  margin: 7px 0 26px;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.login-submit {
  margin-top: 3px;
  width: 100%;
  min-height: 46px;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 50px;
}
.password-field button {
  position: absolute;
  right: 3px;
  top: 4px;
}
.connection-details {
  font-size: 0.79rem;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  color: var(--muted);
}
.connection-details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.connection-details .field {
  margin-top: 15px;
}
.connection-details button {
  font-size: 0.79rem;
}
.login-footer {
  padding: 18px 5vw 25px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  color: var(--muted);
  font-size: 0.71rem;
}
.login-footer button {
  font-size: inherit;
  color: var(--muted);
}
.lab-note {
  background: #fff8e5;
  border: 1px solid #efdfad;
  border-radius: 9px;
  padding: 10px 12px;
  color: #7c6023;
  font-size: 0.75rem;
  line-height: 1.6;
}
.lab-note code {
  font: inherit;
  font-weight: 650;
}
.alpha-label {
  color: #72869b;
  font-size: 0.68rem;
  letter-spacing: 0.4px;
}

/* Main window */
.messenger {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.app-topbar {
  height: 53px;
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(180deg, #f6fbff, #edf5fc);
  border-bottom: 1px solid var(--line);
}
.app-topbar .brand {
  font-size: 1rem;
}
.app-topbar .brand img {
  width: 32px;
  height: 32px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-network {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--muted);
  padding-right: 8px;
}
.top-network:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: var(--green);
}
.top-network.disconnected:before {
  background: #e7a43d;
}
.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.sidebar {
  width: 322px;
  min-width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.profile-card {
  padding: 24px 20px 18px;
  background: linear-gradient(150deg, #f4fbff 0, #ecf5ff 70%, #f5fbf9 100%);
  position: relative;
  border-bottom: 1px solid #e7eff7;
}
.profile-main {
  display: flex;
  align-items: center;
  gap: 13px;
}
.profile-details {
  min-width: 0;
  flex: 1;
}
.profile-name {
  font-size: 1.03rem;
  font-weight: 650;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
  padding: 0;
}
.profile-name:hover {
  color: var(--accent);
}
.profile-psm {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 180px;
}
.status-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  margin-top: 6px;
  position: relative;
}
.status-select select {
  border: 0;
  background: transparent;
  padding: 3px 20px 3px 0;
  color: var(--muted);
  font-size: inherit;
  cursor: pointer;
  max-width: 150px;
}
.avatar {
  height: 40px;
  width: 40px;
  border-radius: 13px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(
    145deg,
    hsl(var(--avatar-hue) 65% 90%),
    hsl(var(--avatar-hue) 55% 82%)
  );
  box-shadow: inset 0 0 0 1px #00000007;
  color: hsl(var(--avatar-hue) 40% 35%);
  font-weight: 600;
  letter-spacing: -0.5px;
}
.avatar-initials {
  font-size: 0.88rem;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.avatar.large {
  height: 62px;
  width: 62px;
  border-radius: 18px;
  box-shadow:
    0 2px 6px #2d689c13,
    inset 0 0 0 1px #ffffff80;
  border: 3px solid white;
}
.avatar.large .avatar-initials {
  font-size: 1.25rem;
}
.avatar.xlarge {
  width: 90px;
  height: 90px;
  border-radius: 25px;
}
.avatar.xlarge .avatar-initials {
  font-size: 1.7rem;
}
.avatar.small {
  height: 33px;
  width: 33px;
  border-radius: 10px;
}
.avatar.small .avatar-initials {
  font-size: 0.75rem;
}
.presence {
  position: absolute;
  width: 11px;
  height: 11px;
  bottom: -1px;
  right: -1px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #a7b2c1;
}
.presence.NLN {
  background: #5fbc3b;
}
.presence.BSY,
.presence.PHN {
  background: #e45765;
}
.presence.AWY,
.presence.IDL,
.presence.BRB,
.presence.LUN {
  background: #eab645;
}
.presence.HDN {
  background: #a8b5c5;
}
.presence.blocked {
  background: #db5a66;
}
.presence.NLN:after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: #ffffff40;
}
.search-box {
  margin: 18px 17px 12px;
  display: flex;
  gap: 9px;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  color: #8091a6;
}
.search-box input {
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.78rem;
  min-width: 0;
  width: 100%;
}
.search-box:focus-within {
  border-color: var(--accent);
}
.sidebar-tabs {
  display: flex;
  margin: 0 17px 12px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.sidebar-tabs button {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  padding: 9px 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.sidebar-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.sidebar-list {
  overflow: auto;
  flex: 1;
  padding: 0 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: #cddbea transparent;
}
.group-heading {
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #8795a6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 7px;
  width: 100%;
  text-align: left;
}
.group-heading .count {
  margin-left: auto;
  font-size: 0.67rem;
  letter-spacing: 0;
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 5px;
}
.group-heading[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}
.contact-row {
  position: relative;
  border-radius: 11px;
  display: flex;
  align-items: center;
  margin: 2px 0;
  transition: background 0.15s;
  min-height: 61px;
}
.contact-row.active {
  background: var(--accent-soft);
}
.contact-row:hover {
  background: var(--surface-alt);
}
.contact-row.active:hover {
  background: var(--accent-soft);
}
.contact-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
  text-align: left;
  padding: 10px;
}
.contact-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text);
}
.contact-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 172px;
}
.contact-psm {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 4px;
  max-width: 169px;
}
.contact-main .avatar {
  width: 37px;
  height: 37px;
  border-radius: 11px;
}
.contact-row.offline .avatar {
  filter: saturate(0.5);
  opacity: 0.72;
}
.contact-row.offline .contact-name {
  color: #8794a5;
}
.contact-menu {
  width: 28px;
  height: 30px;
  opacity: 0;
  margin-right: 4px;
}
.contact-row:hover .contact-menu,
.contact-menu:focus-visible {
  opacity: 1;
}
.unread-pill {
  margin-right: 10px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}
.sidebar-bottom {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.sidebar-bottom .text-button {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}
.sidebar-footer {
  font-size: 0.63rem;
  color: #8a99ab;
  padding: 0 18px 10px;
}
.empty-roster {
  padding: 25px 15px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}
.chat-area {
  flex: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--canvas);
  position: relative;
}
.chat-header {
  background: var(--surface);
  height: 84px;
  min-height: 84px;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.chat-title {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-status {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 350px;
}
.chat-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.chat-actions .icon-button {
  color: #7b8ea4;
}
.chat-actions .icon-button:hover {
  color: var(--accent);
}
.mobile-back {
  display: none;
}
.conversation-content {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.message-list {
  padding: 28px clamp(20px, 3vw, 48px) 18px;
  overflow: auto;
  flex: 1;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #ccd9e8 transparent;
  position: relative;
}
.wallpaper-clouds .message-list {
  background:
    radial-gradient(ellipse at 90% 2%, #dfedfcaa, transparent 50%),
    radial-gradient(ellipse at 5% 90%, #eaf5fba6, transparent 50%);
}
.wallpaper-grid .message-list {
  background-image:
    linear-gradient(#2f7ac908 1px, transparent 1px),
    linear-gradient(90deg, #2f7ac908 1px, transparent 1px);
  background-size: 24px 24px;
}
.wallpaper-none .message-list {
  background: var(--surface-alt);
}
.chat-date {
  text-align: center;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #93a2b5;
  font-size: 0.65rem;
  margin: 1px 0 27px;
}
.chat-date:before,
.chat-date:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 17px;
  position: relative;
}
.message-row.outgoing {
  justify-content: flex-end;
}
.message-row .avatar {
  margin-bottom: 2px;
}
.message-column {
  max-width: min(75%, 620px);
  min-width: 95px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}
.outgoing .message-column {
  align-items: flex-end;
}
.message-sender {
  font-size: 0.68rem;
  font-weight: 600;
  color: #7388a0;
  margin: 0 0 6px 3px;
}
.message-bubble {
  border-radius: 15px 15px 15px 4px;
  padding: 12px 16px;
  background: var(--surface);
  box-shadow: 0 2px 4px #1b3b5c04;
  border: 1px solid #e1eaf5a8;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  position: relative;
}
.outgoing .message-bubble {
  background: #e3f0ff;
  border-color: #d5e7fb;
  border-radius: 15px 15px 4px 15px;
  color: #21415f;
}
.message-bubble a {
  word-break: break-word;
}
.message-meta {
  font-size: 0.59rem;
  color: #99a7b8;
  margin: 5px 3px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.message-meta .failed {
  color: #d2515f;
}
.message-meta .uncertain {
  color: #b57b2d;
}
.message-actions {
  position: absolute;
  top: -4px;
  right: 0;
  transform: translateY(-100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  padding: 2px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 12px #203c5e0a;
  z-index: 3;
}
.message-row:hover .message-actions,
.message-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.message-actions .icon-button {
  height: 25px;
  width: 28px;
  border-radius: 5px;
}
.system-message {
  font-size: 0.71rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 16px auto 22px;
  color: #7a8fa5;
  text-align: center;
  line-height: 1.7;
}
.system-message.nudge {
  color: #7181a0;
}
.system-message.nudge svg {
  color: #e3b044;
}
.new-conversation {
  text-align: center;
  margin: 25px auto 35px;
  max-width: 380px;
}
.new-conversation .avatar {
  margin-bottom: 12px;
}
.new-conversation h3 {
  font-weight: 600;
  margin-bottom: 7px;
}
.new-conversation p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.7;
}
.typing-line {
  height: 25px;
  min-height: 25px;
  color: var(--muted);
  font-size: 0.69rem;
  padding: 3px 28px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.typing-dots {
  display: flex;
  gap: 3px;
}
.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 100%;
  background: #90a3ba;
  animation: typing 1.1s infinite;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
.composer {
  margin: 0 22px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 5px 20px #20426906;
  position: relative;
}
.composer:focus-within {
  border-color: #aacded;
  box-shadow: 0 0 0 3px #2088f508;
}
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 7px 10px 0;
}
.format-button {
  height: 27px;
  width: 27px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.format-button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.font-select {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  max-width: 130px;
  cursor: pointer;
}
.color-input {
  width: 25px;
  height: 24px;
  padding: 3px;
  border: 0;
  border-radius: 5px;
  background: none;
  cursor: pointer;
}
.format-separator {
  height: 14px;
  width: 1px;
  background: var(--line);
  margin: 0 5px;
}
.message-input {
  border: 0;
  outline: 0 !important;
  width: 100%;
  min-height: 66px;
  max-height: 180px;
  resize: none;
  background: transparent;
  padding: 11px 15px 5px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.composer-bottom {
  padding: 4px 9px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.composer-tools {
  display: flex;
  gap: 1px;
}
.composer-tools .icon-button {
  height: 31px;
  width: 32px;
  border-radius: 7px;
  color: #8897ab;
}
.composer-tools .icon-button:hover {
  color: var(--accent);
}
.send-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.char-count {
  font-size: 0.6rem;
  color: #9ba7b7;
}
.char-count.invalid {
  color: #cf4b5b;
}
.send-button {
  border-radius: 9px;
  background: var(--accent);
  color: white;
  height: 34px;
  padding: 0 15px;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.send-button:hover {
  filter: brightness(1.05);
}
.composer-hint {
  font-size: 0.6rem;
  color: #9aa8b9;
  padding: 0 27px 12px;
  margin-top: -10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.offline-notice {
  font-size: 0.73rem;
  padding: 9px 20px;
  background: #fff8e7;
  color: #8d7240;
  display: flex;
  align-items: center;
  gap: 8px;
}
.connection-banner {
  padding: 8px 20px;
  background: #fff3d6;
  color: #836328;
  font-size: 0.75rem;
  text-align: center;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.connection-banner button {
  font-weight: 650;
  text-decoration: underline;
}
.conversation-search {
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
}
.conversation-search input {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 8px 10px;
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
}
.welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center, #f9fcff, #f0f6fc 70%);
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.welcome-inner {
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.welcome-logo {
  width: 130px;
  height: 130px;
  opacity: 0.96;
  margin-bottom: 16px;
}
.welcome .eyebrow {
  font-size: 0.67rem;
  color: #97a8bd;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 650;
  margin-bottom: 17px;
}
.welcome h1 {
  font-size: 2.05rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -1.1px;
  color: #344d69;
}
.welcome h1 span {
  color: var(--accent);
}
.welcome p {
  font-size: 0.84rem;
  line-height: 1.8;
  color: #7c90a7;
  margin: 18px auto 25px;
  max-width: 335px;
}
.welcome .secondary {
  font-size: 0.77rem;
  background: #ffffffa0;
}
.welcome-footer {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #9aaabd;
  font-size: 0.65rem;
}
.welcome:before,
.welcome:after {
  content: "";
  position: absolute;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  border: 1px solid #dce9f780;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.welcome:after {
  width: 790px;
  height: 790px;
  border-color: #dce9f740;
}
.history-previous {
  font-size: 0.73rem;
  color: var(--accent);
  display: block;
  margin: 0 auto 22px;
  padding: 7px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.app-statusbar {
  height: 25px;
  min-height: 25px;
  padding: 0 15px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #91a0b2;
  background: var(--surface);
  font-size: 0.6rem;
  gap: 10px;
}
.app-statusbar span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-indicator {
  width: 5px;
  height: 5px;
  background: #6cbd48;
  border-radius: 50%;
}
.empty-search {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 35px 10px;
}

/* Popovers, dialogs, history, settings, calls and peer activities */
.popover {
  position: fixed;
  z-index: 40;
  min-width: 195px;
  max-width: calc(100vw - 20px);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 10px 40px #14365e20;
}
.menu-item {
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border-radius: 7px;
  font-size: 0.79rem;
}
.menu-item:hover {
  background: var(--surface-alt);
}
.menu-item.danger {
  color: #d14e5d;
}
.menu-item svg {
  color: var(--muted);
}
.popover-separator {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}
.emoji-picker {
  width: 300px;
  padding: 14px;
}
.emoji-picker h3 {
  font-size: 0.79rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.emoji-grid button {
  font-size: 1.35rem;
  padding: 5px;
  border-radius: 7px;
}
.emoji-grid button:hover {
  background: var(--accent-soft);
}
.modal {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 100px #102b4e45;
  max-width: min(540px, calc(100vw - 30px));
  width: 100%;
  max-height: 88vh;
  overflow: auto;
}
.modal::backdrop {
  background: #182d4655;
  backdrop-filter: blur(4px);
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-heading h2 {
  font-size: 1rem;
  font-weight: 650;
}
.modal-body {
  padding: 22px;
}
.modal-subtitle {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 18px;
}
.modal.wide {
  max-width: min(780px, calc(100vw - 30px));
}
.modal.about {
  text-align: center;
}
.about .modal-body > img {
  width: 100px;
  height: 100px;
  margin: 2px 0 15px;
}
.about h3 {
  font-size: 1.5rem;
  letter-spacing: -0.8px;
  margin-bottom: 5px;
}
.about p {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
  margin: 15px 0;
}
.about small {
  font-size: 0.68rem;
  line-height: 1.7;
  display: block;
}
.about-links {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 18px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.settings-section {
  margin-top: 23px;
}
.settings-section > h3 {
  font-size: 0.81rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.settings-section .checkbox {
  margin-bottom: 14px;
}
.accent-options {
  display: flex;
  gap: 9px;
  margin-top: 7px;
}
.accent-options button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  outline: 1px solid var(--line);
}
.accent-options button.active {
  outline: 2px solid var(--accent);
}
.profile-edit-avatar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 23px;
}
.file-choice {
  display: none;
}
.toast-region {
  position: fixed;
  right: 20px;
  bottom: 35px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(410px, calc(100vw - 30px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  box-shadow: 0 7px 35px #17365326;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 12px 10px 12px 14px;
  border-radius: 11px;
  font-size: 0.78rem;
  line-height: 1.6;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast > span {
  flex: 1;
}
.toast > svg {
  color: var(--accent);
}
.toast.error {
  border-left-color: #d45261;
}
.toast.error > svg {
  color: #d45261;
}
.toast button:not(.icon-button) {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
}
.toast .icon-button {
  width: 26px;
  height: 26px;
}
.history-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  max-height: 45vh;
  overflow: auto;
}
.history-result {
  text-align: left;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: 9px;
}
.history-result:hover {
  background: var(--accent-soft);
}
.history-result strong {
  font-size: 0.78rem;
  display: block;
  margin-bottom: 5px;
}
.history-result p {
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.history-result small {
  font-size: 0.65rem;
  display: block;
  margin-top: 6px;
}
.group-management {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.83rem;
}
.file-card {
  width: 270px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 5px #173e6f05;
}
.file-top {
  display: flex;
  gap: 11px;
  align-items: center;
}
.file-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  width: 38px;
  height: 42px;
  flex-shrink: 0;
}
.file-name {
  font-size: 0.77rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}
.file-meta {
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 4px;
}
.file-card .form-actions {
  margin-top: 12px;
  gap: 7px;
}
.file-card .form-actions button {
  padding: 7px 10px;
  min-height: 31px;
  font-size: 0.7rem;
}
.file-card progress {
  width: 100%;
  height: 5px;
  accent-color: var(--accent);
  margin: 13px 0 0;
}
.file-card img {
  border-radius: 8px;
  margin-top: 12px;
  max-height: 240px;
  object-fit: contain;
  display: block;
}
.file-card audio {
  width: 100%;
  height: 34px;
  margin-top: 12px;
}
.file-state {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}
.file-state.failed {
  color: #cb4b5b;
}
.recording-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  z-index: 2;
  padding: 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.recording-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e35f70;
  animation: recording 1s infinite;
}
.ink-canvas {
  background: white;
  width: 100%;
  aspect-ratio: 640/360;
  border: 1px solid var(--line);
  border-radius: 10px;
  touch-action: none;
  display: block;
}
.ink-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.call-panel {
  background: #101e32;
  color: #eaf3ff;
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  margin: 12px 22px 0;
  max-height: 360px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.call-panel video.remote {
  width: 100%;
  max-height: 285px;
  object-fit: contain;
  background: #0a1626;
}
.call-panel video.local {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 100px;
  max-height: 90px;
  object-fit: cover;
  border-radius: 8px;
  transform: scaleX(-1);
  box-shadow: 0 4px 10px #0003;
}
.call-audio-display {
  text-align: center;
  padding: 24px;
}
.call-audio-display .avatar {
  margin-bottom: 10px;
}
.call-label {
  font-size: 0.77rem;
  color: #b8cde4;
  margin-top: 7px;
}
.call-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: #101e32;
  width: 100%;
}
.call-controls .icon-button {
  color: white;
  background: #ffffff14;
  width: 37px;
  height: 37px;
  border-radius: 50%;
}
.call-controls .danger {
  background: #dc4d60;
}
.incoming-call {
  text-align: center;
  padding: 25px;
}
.incoming-call .avatar {
  margin: 5px auto 20px;
}
.incoming-call p {
  margin: 9px auto;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.incoming-call .form-actions {
  justify-content: center;
  margin-top: 25px;
}
.game-panel {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
  max-height: 380px;
  overflow: auto;
}
.game-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.game-heading h3 {
  font-size: 0.86rem;
}
.game-status {
  font-size: 0.75rem;
  color: var(--muted);
}
.game-board {
  display: grid;
  gap: 5px;
  background: #2786d1;
  border-radius: 10px;
  padding: 9px;
  width: 280px;
  max-width: 100%;
  margin: 10px auto;
}
.game-cell {
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5f0fb;
  box-shadow: inset 0 2px 3px #173d6940;
}
.game-cell.player1 {
  background: #ffcf4b;
}
.game-cell.player2 {
  background: #f06678;
}
.game-cell:hover:not(:disabled) {
  outline: 2px solid white;
}
.tic-board {
  background: var(--line);
  width: 210px;
  gap: 3px;
}
.tic-board .game-cell {
  border-radius: 4px;
  font-size: 1.6rem;
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}
.wizz {
  animation: wizz 0.45s ease-in-out;
}
.reaction-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 5rem;
  transform: translate(-50%, -50%);
  animation: reaction 1.6s ease-out forwards;
  z-index: 10;
  pointer-events: none;
}

/* Themes and accessibility */
[data-accent="green"] {
  --accent: #279967;
  --accent-rgb: 39, 153, 103;
  --accent-soft: #e5f6ed;
}
[data-accent="violet"] {
  --accent: #8258c8;
  --accent-rgb: 130, 88, 200;
  --accent-soft: #f0eafa;
}
[data-accent="rose"] {
  --accent: #c94685;
  --accent-rgb: 201, 70, 133;
  --accent-soft: #fceaf2;
}
[data-theme="dark"] {
  --text: #e0eaf6;
  --muted: #91a3ba;
  --line: #2a3a51;
  --surface: #172438;
  --surface-alt: #1c2b40;
  --canvas: #101c2d;
  --accent-soft: #203d5e;
  --shadow: 0 18px 60px #0003;
  color-scheme: dark;
  background: var(--canvas);
  color: var(--text);
}
[data-theme="dark"] .app-topbar {
  background: linear-gradient(#1c2c42, #19283d);
}
[data-theme="dark"] .profile-card {
  background: linear-gradient(135deg, #1e344c, #1a2a40);
}
[data-theme="dark"] .welcome {
  background: radial-gradient(ellipse at center, #1b2b42, #121f30 75%);
}
[data-theme="dark"] .welcome h1 {
  color: #d5e4f4;
}
[data-theme="dark"] .welcome:before,
[data-theme="dark"] .welcome:after {
  border-color: #2d425940;
}
[data-theme="dark"] .message-bubble {
  border-color: #27384e;
}
[data-theme="dark"] .outgoing .message-bubble {
  background: #203e61;
  color: #dcecff;
  border-color: #2b4b70;
}
[data-theme="dark"] .wallpaper-clouds .message-list {
  background:
    radial-gradient(ellipse at 90% 2%, #192e4725, transparent 50%),
    radial-gradient(ellipse at 5% 90%, #17354930, transparent 50%);
}
[data-theme="dark"] .login-screen {
  background:
    radial-gradient(ellipse at 20% 5%, #1c3551, transparent 60%), #101b2c;
}
[data-theme="dark"] .login-card {
  background: #17273be8;
  border-color: #31455d;
}
[data-theme="dark"] .hero-features {
  color: #90a9c4;
}
[data-theme="dark"] .avatar.large {
  border-color: #28405a;
}
[data-theme="dark"] .lab-note,
[data-theme="dark"] .offline-notice,
[data-theme="dark"] .connection-banner {
  background: #3b3221;
  border-color: #655230;
  color: #e5cc94;
}
[data-theme="dark"] .error-box {
  background: #3d2430;
  border-color: #6f3648;
  color: #f0a4b4;
}
.compact .contact-row {
  min-height: 50px;
}
.compact .contact-main {
  padding: 7px 10px;
}
.compact .contact-main .avatar {
  width: 32px;
  height: 32px;
}
.compact .contact-psm {
  font-size: 0.65rem;
}
.compact .sidebar {
  width: 290px;
}
.compact .message-row {
  margin-bottom: 12px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
@keyframes toast-in {
  from {
    transform: translateY(7px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes wizz {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-5px, 2px);
  }
  40% {
    transform: translate(5px, -2px);
  }
  60% {
    transform: translate(-4px, -1px);
  }
  80% {
    transform: translate(3px, 2px);
  }
}
@keyframes reaction {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.5);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.9);
  }
}
@keyframes recording {
  50% {
    opacity: 0.3;
  }
}
@media (min-width: 1500px) {
  .sidebar {
    width: 350px;
  }
  .message-list {
    padding-left: 6vw;
    padding-right: 6vw;
  }
  .composer {
    margin-left: 5vw;
    margin-right: 5vw;
  }
  .chat-header {
    padding-left: 35px;
    padding-right: 35px;
  }
}
@media (max-width: 900px) {
  .login-inner {
    gap: 5vw;
  }
  .login-hero h1 {
    font-size: 2.8rem;
  }
  .login-hero > p {
    font-size: 0.88rem;
  }
  .login-hero {
    max-width: 350px;
  }
  .hero-logo {
    width: 130px;
    height: 130px;
  }
  .hero-features {
    gap: 12px;
    font-size: 0.7rem;
  }
  .login-card {
    width: 355px;
    padding: 25px;
  }
  .sidebar {
    width: 290px;
    min-width: 250px;
  }
  .chat-header {
    padding: 12px 17px;
  }
  .chat-actions {
    gap: 1px;
  }
  .chat-actions .icon-button {
    width: 32px;
  }
  .chat-status {
    max-width: 200px;
  }
  .message-column {
    max-width: 85%;
  }
  .composer {
    margin-left: 15px;
    margin-right: 15px;
  }
  .composer-hint {
    padding-left: 18px;
    padding-right: 18px;
  }
  .contact-name span {
    max-width: 155px;
  }
  .contact-psm {
    max-width: 155px;
  }
}
@media (max-width: 700px) {
  .login-top {
    padding: 18px 23px;
  }
  .login-inner {
    padding: 10px 20px 30px;
    display: block;
  }
  .login-hero {
    max-width: none;
    padding: 0;
    text-align: center;
    margin: 0 auto 25px;
  }
  .hero-eyebrow,
  .hero-features {
    display: none;
  }
  .hero-logo {
    width: 94px;
    height: 94px;
    margin: 0 auto 10px;
  }
  .login-hero h1 {
    font-size: 2rem;
    letter-spacing: -1px;
  }
  .login-hero > p {
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 12px auto 0;
    max-width: 300px;
  }
  .login-card {
    width: 100%;
    max-width: 390px;
    margin: auto;
    padding: 24px;
    border-radius: 17px;
  }
  .login-card h2 {
    font-size: 1.25rem;
  }
  .login-card .subheading {
    margin-bottom: 20px;
  }
  .login-footer {
    padding: 15px 22px 23px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.65rem;
  }
  .login-footer > span {
    width: 100%;
    text-align: center;
  }
  .login-top .brand {
    font-size: 1rem;
  }
  .login-top .brand img {
    width: 32px;
    height: 32px;
  }
  .app-topbar {
    height: 48px;
    min-height: 48px;
    padding: 0 14px;
  }
  .app-topbar .brand {
    font-size: 0.91rem;
  }
  .top-network {
    font-size: 0.62rem;
    max-width: 135px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .app-body {
    position: relative;
  }
  .sidebar,
  .compact .sidebar {
    width: 100%;
    min-width: 100%;
    border-right: 0;
  }
  .profile-card {
    padding: 19px 20px;
  }
  .profile-name {
    max-width: 250px;
  }
  .profile-psm {
    max-width: 260px;
  }
  .contact-main {
    gap: 13px;
    padding: 11px 12px;
  }
  .contact-main .avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .contact-name {
    font-size: 0.9rem;
  }
  .contact-name span {
    max-width: 65vw;
  }
  .contact-psm {
    font-size: 0.75rem;
    max-width: 65vw;
  }
  .contact-row {
    min-height: 67px;
  }
  .contact-menu {
    opacity: 1;
  }
  .sidebar-list {
    padding-left: 12px;
    padding-right: 12px;
  }
  .search-box {
    padding: 11px 12px;
  }
  .search-box input {
    font-size: 0.85rem;
  }
  .sidebar-tabs {
    gap: 25px;
  }
  .sidebar-tabs button {
    font-size: 0.85rem;
  }
  .sidebar-footer {
    display: none;
  }
  .sidebar-bottom {
    padding: 11px 17px;
  }
  .chat-area {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 5;
  }
  .messenger.chat-open .chat-area {
    display: flex;
  }
  .messenger.chat-open .sidebar {
    visibility: hidden;
  }
  .chat-header {
    height: 70px;
    min-height: 70px;
    padding: 10px 10px 10px 5px;
    gap: 7px;
  }
  .mobile-back {
    display: inline-flex;
    width: 30px;
  }
  .chat-header > .avatar {
    height: 36px;
    width: 36px;
    border-radius: 11px;
  }
  .chat-title {
    font-size: 0.89rem;
  }
  .chat-status {
    font-size: 0.66rem;
    max-width: 160px;
  }
  .chat-actions .icon-button {
    width: 31px;
    height: 33px;
  }
  .chat-actions .icon-button svg {
    width: 18px;
  }
  .chat-actions .desktop-tool {
    display: none;
  }
  .message-list {
    padding: 22px 14px 12px;
  }
  .message-bubble {
    font-size: 0.87rem;
    padding: 11px 14px;
  }
  .message-column {
    max-width: 85%;
  }
  .message-row > .avatar {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }
  .message-row > .avatar .avatar-initials {
    font-size: 0.62rem;
  }
  .message-row {
    gap: 7px;
  }
  .message-actions {
    display: none;
  }
  .composer {
    margin: 0 10px 10px;
    border-radius: 12px;
  }
  .format-toolbar {
    padding: 5px 8px 0;
  }
  .font-select {
    max-width: 100px;
  }
  .message-input {
    min-height: 60px;
    font-size: 0.91rem;
    padding: 10px 12px 5px;
  }
  .composer-tools .icon-button {
    width: 31px;
  }
  .composer-tools .desktop-tool {
    display: none;
  }
  .composer-hint {
    display: none;
  }
  .send-button {
    padding: 0 11px;
    font-size: 0.74rem;
  }
  .char-count {
    font-size: 0.55rem;
  }
  .typing-line {
    padding-left: 18px;
    font-size: 0.66rem;
    height: 23px;
    min-height: 23px;
  }
  .app-statusbar {
    display: none;
  }
  .toast-region {
    right: 10px;
    bottom: 15px;
    max-width: calc(100vw - 20px);
  }
  .modal {
    max-width: calc(100vw - 20px);
    max-height: 90dvh;
  }
  .modal-heading {
    padding: 15px 17px;
  }
  .modal-body {
    padding: 19px;
  }
  .settings-grid {
    gap: 13px;
  }
  .welcome {
    display: none;
  }
  .file-card {
    width: 260px;
  }
  .call-panel {
    margin: 8px 10px 0;
    max-height: 240px;
  }
  .call-panel video.remote {
    max-height: 175px;
  }
  .call-panel video.local {
    width: 70px;
    max-height: 60px;
  }
  .game-panel {
    max-height: 290px;
    padding: 12px;
  }
  .game-board {
    width: 210px;
    gap: 4px;
    padding: 7px;
  }
  .offline-notice {
    font-size: 0.69rem;
    padding: 8px 13px;
  }
  .connection-banner {
    padding: 7px 12px;
    font-size: 0.7rem;
  }
  .conversation-search {
    padding: 9px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  button,
  input,
  select,
  textarea,
  .message-bubble,
  .contact-row.active,
  .avatar {
    border: 1px solid CanvasText;
  }
  .presence {
    forced-color-adjust: none;
  }
  .primary,
  .send-button {
    background: Highlight;
    color: HighlightText;
  }
  .avatar-initials {
    color: CanvasText;
  }
  .game-cell.player1 {
    background: Highlight;
  }
  .game-cell.player2 {
    background: CanvasText;
  }
}
