:root {
  --blue: #3390ec;
  --blue-dark: #2581d9;
  --ink: #182633;
  --muted: #81909c;
  --line: #edf0f2;
  --side: 348px;
  --wall: #e7eee7;
  --out: #e3ffc9;
  --radius: 14px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
  color: var(--ink);
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  background: #fff;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
textarea {
  outline: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8bc4fa;
  outline-offset: 3px;
}
input:focus-visible,
textarea:focus-visible {
  border-color: var(--blue) !important;
}
button {
  touch-action: manipulation;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--blue);
}
.icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #82909b;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-button:hover {
  background: #f0f4f7;
  color: var(--blue);
}
.primary {
  background: var(--blue);
  color: white;
  border-radius: 11px;
  padding: 13px 20px;
  font-weight: 600;
  transition: background 0.15s;
}
.primary:hover {
  background: var(--blue-dark);
}
.secondary {
  border-radius: 10px;
  padding: 12px 16px;
  background: #f1f5f8;
  color: #50718c;
  font-weight: 600;
}
.danger {
  color: #d65b60 !important;
}
.muted {
  color: var(--muted);
}
.form-error {
  color: #d9545f;
  font-size: 13px;
  line-height: 1.5;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.check-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #7d8b97;
}
.check-label input {
  width: 17px !important;
  height: 17px;
  margin: 0;
  accent-color: var(--blue);
  flex-shrink: 0;
}
.push-preview-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.push-preview-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}
.badge {
  background: var(--blue);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
}
/* Sign in */
.login-screen {
  --login-accent: #a6b5ff;
  height: 100dvh;
  overflow: auto;
  color-scheme: dark;
  color: #f3f5ff;
  background:
    linear-gradient(105deg, #080d1cf2 0%, #080d1cbd 37%, #080d1c24 72%, #080d1c69 100%),
    url('/assets/wall-space.webp') center 49% / cover no-repeat #080d1c;
}
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 410px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 7vw, 114px);
  width: min(100%, 1260px);
  min-height: 100%;
  margin-inline: auto;
  padding: max(32px, env(safe-area-inset-top)) max(36px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom)) max(36px, env(safe-area-inset-left));
}
.login-card {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 3.2vw, 40px);
  border: 1px solid #aabfff24;
  border-radius: 26px;
  background: linear-gradient(155deg, #141b32e8, #0b1022eb 76%);
  box-shadow: 0 24px 82px #01030780, inset 0 1px #d9e2ff0a;
}
.login-card h1 {
  margin: 0 0 32px;
  font-size: clamp(30px, 2.7vw, 37px);
  line-height: 1.09;
  letter-spacing: -0.045em;
  font-weight: 650;
}
.login-card h1 span {
  display: block;
  color: #e0e6fb;
  margin-top: 4px;
}
.login-card h1 strong {
  color: #b5c5ff;
  font-weight: 700;
}
.login-card form {
  display: grid;
  gap: 18px;
}
.login-download {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #a6b5ff35;
  border-radius: 14px;
  background: linear-gradient(110deg, #a6b5ff1a, #a6b5ff08 75%);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.login-download:hover {
  border-color: #a6b5ff80;
  background-color: #a6b5ff16;
}
.login-download:focus-visible {
  outline-color: var(--login-accent);
}
.login-download-icon {
  flex: none;
  border-radius: 9px;
}
.login-download-copy {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.login-download-copy strong {
  font-size: 15px;
  font-weight: 650;
}
.login-download-copy > span {
  color: #b6c1e3;
  font-size: 13px;
}
.login-download-arrow {
  display: grid;
  flex: 0 0 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #a6b5ff1a;
  color: var(--login-accent);
  font-size: 19px;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  .login-download {
    transition: none;
  }
}
:root[data-shell] .login-download {
  display: none;
}
.settings-download {
  color: inherit;
  text-decoration: none;
}
.login-screen .login-card label {
  color: #c4cde8;
  font-size: 14px;
  font-weight: 550;
}
.login-screen .login-card label > input:not([type='checkbox']) {
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #899bce46;
  border-radius: 11px;
  color: #f3f5ff;
  background: #091024b0;
  font-size: 16px;
}
.login-screen .login-card input:focus-visible {
  --blue: var(--login-accent);
  box-shadow: 0 0 0 3px #8b9af62c;
}
.login-screen .check-label {
  min-height: 26px;
  cursor: pointer;
}
.login-screen .check-label input {
  accent-color: var(--login-accent);
}
.login-screen .form-error,
.login-screen .field-error {
  color: #ff9fae;
}
.login-card .primary {
  min-height: 50px;
  border-radius: 11px;
  background: linear-gradient(105deg, #b4c2ff, #9aacf7 68%, #a9b7ff);
  color: #101831;
  font-weight: 700;
  box-shadow: 0 6px 24px #798df433;
}
.login-card .primary:hover:not(:disabled) {
  filter: brightness(1.08);
}
.login-scene {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 660px;
  aspect-ratio: 1;
  justify-self: center;
  background:
    radial-gradient(ellipse 48% 47% at 50% 51%, #525ce43b, #344cd81c 45%, transparent),
    radial-gradient(ellipse 43% 33% at 53% 63%, #698ffa2b, transparent);
}
.login-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* Labels and inputs shared with the rest of the app. */
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #647381;
}
label > input:not([type='checkbox']),
.field-input {
  border: 1px solid #dce4e9;
  border-radius: 10px;
  padding: 13px 14px;
  width: 100%;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: #9aa6ae;
}
/* App structure */
.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  /* The row is the screen, not the content: a long chat list scrolls inside the sidebar. */
  grid-template-rows: minmax(0, 1fr);
  max-width: 1800px;
  margin: auto;
  box-shadow: 0 0 40px #00000005;
}
.sidebar {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #dce4df;
  position: relative;
  z-index: 2;
}
.sidebar-header {
  height: 77px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.wordmark {
  font-weight: 750;
  font-size: 25px;
  letter-spacing: -1px;
  display: flex;
  gap: 3px;
  align-items: center;
  flex: 1;
}
.brand-dot {
  width: 5px;
  height: 5px;
  align-self: flex-end;
  background: var(--blue);
  border-radius: 50%;
  margin-bottom: 9px;
}
.sidebar-header .icon-button {
  width: 36px;
  height: 36px;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f2f4f6;
  border: 1px solid transparent;
  border-radius: 11px;
  margin: 0 20px;
  height: 43px;
  padding: 0 12px;
  color: #98a4ad;
}
.search-wrap:focus-within {
  border-color: #a8d1f9;
  background: #fff;
}
.search-wrap svg {
  width: 20px;
  height: 20px;
}
.search-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: none;
  font-size: 14px;
  color: var(--ink);
}
.chat-tabs {
  padding: 13px 18px 0;
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 24px;
  height: 57px;
  flex-shrink: 0;
}
.tab {
  font-size: 13px;
  font-weight: 600;
  padding: 0 2px 13px;
  position: relative;
  white-space: nowrap;
  color: #8b97a1;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab.active {
  color: var(--blue);
}
.tab.active:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
}
.tab span {
  font-size: 10px;
  padding: 2px 5px;
  background: #edf2f6;
  border-radius: 7px;
  color: #8c9ca9;
}
.tab.active span {
  background: #eaf4ff;
  color: var(--blue);
}
.chat-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: #dbe2e6 transparent;
}
.chat-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 12px;
  text-align: left;
  position: relative;
  min-height: 58px;
}
.chat-row .avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.chat-row .avatar svg {
  width: 21px;
  height: 21px;
}
.avatar.group {
  border-radius: 30%;
}
.chat-kind {
  display: inline-flex;
  color: var(--faint, #9aa6af);
  margin-right: -3px;
}
.chat-kind svg {
  width: 14px;
  height: 14px;
}
.chat-row.active .chat-kind {
  color: #dfe6ff;
}
.chat-row:hover {
  background: #f4f7f9;
}
.chat-row.active {
  background: #3390ec;
  color: white;
}
.avatar {
  height: 52px;
  width: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  background: #8cace9;
  letter-spacing: 0.2px;
  user-select: none;
}
.avatar svg {
  width: 25px;
  height: 25px;
}
.avatar.small {
  height: 42px;
  width: 42px;
  font-size: 16px;
}
.avatar.color-0 {
  background: linear-gradient(135deg, #64b0e9, #428ade);
}
.avatar.color-1 {
  background: linear-gradient(135deg, #b4a1ee, #8f7bd4);
}
.avatar.color-2 {
  background: linear-gradient(135deg, #f3bb7b, #e7946e);
}
.avatar.color-3 {
  background: linear-gradient(135deg, #87c9b1, #55af97);
}
.avatar.color-4 {
  background: linear-gradient(135deg, #e5a4b4, #ce7c9a);
}
.avatar.color-5 {
  background: linear-gradient(135deg, #99b7cd, #6c95b3);
}
.chat-content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.chat-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.chat-time {
  font-size: 10px;
  color: #9aa6af;
  white-space: nowrap;
}
.chat-preview {
  font-size: 12px;
  color: #93a0ab;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  line-height: 1.4;
}
.chat-preview .sender-prefix {
  color: #5c768a;
}
.chat-row.active .chat-time,
.chat-row.active .chat-preview,
.chat-row.active .sender-prefix {
  color: #d8edff;
}
.chat-row.active .badge {
  background: #fff;
  color: var(--blue);
}
.chat-row .badge {
  height: 19px;
  min-width: 19px;
  font-size: 10px;
}
.profile-bar {
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  min-height: 81px;
  flex-shrink: 0;
  background: #fff;
}
.profile-bar:hover {
  background: #fafcfd;
}
.profile-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.profile-text strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-text > span {
  font-size: 11px;
  color: #98a4ac;
}
.profile-bar > span:last-child {
  color: #a8b3ba;
}
.profile-bar svg {
  width: 19px;
}
.list-empty {
  padding: 55px 20px;
  text-align: center;
  color: #8d9ca7;
  font-size: 13px;
  line-height: 1.8;
}
.list-empty strong {
  display: block;
  color: #61788b;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
}
.list-empty > span {
  display: block;
}
.list-empty button {
  display: block;
  color: var(--blue);
  margin: 15px auto 0;
  font-weight: 600;
}
.conversation {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background-color: var(--wall);
  overflow: hidden;
}
.welcome {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  padding: 24px;
}
.welcome-emblem {
  display: block;
  width: 102px;
  height: 102px;
  border-radius: 23px;
  margin-top: -45px;
  margin-bottom: 29px;
  box-shadow: 0 10px 40px #05091730;
}
.welcome p {
  color: #839788;
  font-size: 14px;
  margin: 0 0 27px;
}
.welcome-button {
  font-size: 13px;
  color: #507d5d;
  border-radius: 20px;
  padding: 11px 19px;
  background: #ffffff8c;
  display: flex;
  gap: 24px;
  align-items: center;
}
.welcome-button:hover {
  background: white;
}
.welcome-bottom {
  position: absolute;
  bottom: 35px;
  color: #9bb29f;
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: 600;
}
.welcome-bottom span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.8px;
  margin-top: 9px;
}
.chat-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.conversation-header {
  height: 77px;
  background: #fff;
  border-bottom: 1px solid #e8ede9;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 29px;
  flex-shrink: 0;
}
.chat-heading {
  display: flex;
  gap: 13px;
  text-align: left;
  align-items: center;
  min-width: 0;
  flex: 1;
  padding: 0;
}
.chat-heading > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.chat-heading strong {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.chat-heading span span {
  font-size: 11px;
  color: #95a2ad;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.connection {
  width: 6px;
  height: 6px;
  background: #b3bec5;
  border-radius: 50%;
  margin-right: 7px;
}
.connection.online {
  background: #6fb797;
}
.connection.offline {
  background: #d8aa61;
}
.mobile-back {
  display: none;
}
.pinned-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffffee;
  padding: 11px 30px;
  border-bottom: 1px solid #dce6df;
  text-align: left;
  flex-shrink: 0;
  min-height: 58px;
  color: var(--blue);
}
.pinned-bar svg {
  width: 21px;
}
.pinned-bar > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
  border-left: 2px solid #68b0f4;
  padding-left: 10px;
}
.pinned-bar strong {
  font-size: 11px;
  font-weight: 600;
}
.pinned-bar span span {
  font-size: 12px;
  color: #6e8291;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: calc(100vw - var(--side) - 150px);
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 22px clamp(20px, 5vw, 80px) 18px;
  scrollbar-width: thin;
  scrollbar-color: #becfc3 transparent;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  overflow-anchor: none;
  outline: none;
}
.message-items {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 100%;
  justify-content: flex-end;
}
.date-divider {
  align-self: center;
  margin: 12px 0 18px;
  padding: 5px 13px;
  background: #88a18a65;
  color: #fff;
  border-radius: 18px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: 82%;
  align-self: flex-start;
  position: relative;
}
.message-row.own {
  align-self: flex-end;
  justify-content: flex-end;
}
.message-row .avatar {
  width: 29px;
  height: 29px;
  font-size: 10px;
  margin-bottom: 2px;
}
.message-bubble {
  padding: 10px 12px 7px;
  background: #fff;
  border-radius: 13px 13px 13px 4px;
  min-width: 92px;
  box-shadow: 0 1px 2px #47614a0a;
  position: relative;
  max-width: 100%;
}
.own .message-bubble {
  background: var(--out);
  border-radius: 13px 13px 4px 13px;
}
.message-author {
  font-weight: 600;
  font-size: 11px;
  color: #559ecf;
  margin-bottom: 5px;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.6;
  min-width: 50px;
}
.message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
  font-size: 9px;
  color: #9faeac;
  user-select: none;
  min-height: 12px;
}
.own .message-meta {
  color: #7f9e6d;
}
.message-meta svg {
  height: 13px;
  width: 13px;
  stroke-width: 1.6;
}
.message-photo {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 360px;
  min-height: 50px;
  min-width: 100px;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  margin: 0 0 5px;
  background: #e9eef0;
}
.photo-error {
  font-size: 11px;
  color: #8a9ca5;
  padding: 16px;
}
.message-deleted {
  font-style: italic;
  color: #98a49d;
  font-size: 12px;
  line-height: 1.5;
}
.message-actions {
  opacity: 0;
  position: absolute;
  top: 4px;
  right: -32px;
  width: 26px;
  height: 26px;
  background: #ffffffc9;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #6e8e7c;
}
.own .message-actions {
  left: -32px;
  right: auto;
}
.message-actions svg {
  width: 17px;
}
.message-row:hover .message-actions,
.message-actions:focus-visible {
  opacity: 1;
}
.message-row.highlight .message-bubble {
  box-shadow: 0 0 0 3px #3390ec80;
}
.load-older {
  display: block;
  background: #ffffffb3;
  border-radius: 20px;
  font-size: 11px;
  padding: 7px 16px;
  margin: 0 auto 22px;
  color: #6b8572;
}
.chat-empty {
  text-align: center;
  align-self: center;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 30px;
  color: #7d9683;
  background: #ffffff85;
  border-radius: 20px;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.chat-empty svg {
  width: 35px;
  height: 35px;
  color: #8fac96;
}
.chat-empty strong {
  font-weight: 500;
  color: #5b7963;
  font-size: 15px;
}
.compose-area {
  padding: 12px clamp(20px, 5vw, 80px) max(8px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  background: linear-gradient(transparent, #e7eee7aa);
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  background: white;
  border-radius: 14px;
  padding: 6px 7px 6px 8px;
  box-shadow: 0 2px 12px #5c81600c;
  max-width: 920px;
  margin: 0 auto;
}
.composer .icon-button {
  color: #9caab5;
}
.composer textarea {
  border: 0;
  resize: none;
  min-height: 42px;
  max-height: 160px;
  padding: 11px 4px 10px;
  flex: 1;
  line-height: 21px;
  font-size: 14px;
  background: transparent;
  min-width: 0;
}
.send-button {
  height: 42px;
  width: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  flex-shrink: 0;
}
.send-button:hover {
  background: var(--blue-dark);
}
.send-button svg {
  height: 22px;
  width: 22px;
  stroke-width: 1.7;
  transform: translateX(-1px);
}
.compose-hint {
  max-width: 920px;
  margin: 9px auto 0;
  text-align: center;
  color: #9aaa9d;
  font-size: 9px;
  letter-spacing: 0.1px;
}
.compose-hint span {
  margin: 0 7px;
}
.attachment-preview {
  max-width: 920px;
  margin: 0 auto 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
}
.attachment-preview > img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
}
.attachment-preview > span {
  min-width: 0;
  flex: 1;
}
.attachment-preview strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}
.attachment-preview .check-label {
  font-size: 11px !important;
}
.retry-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 920px;
  margin: 0 auto 8px;
  background: #fff6ec;
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
  color: #a47743;
}
.retry-bar span {
  flex: 1;
}
.retry-bar button {
  color: var(--blue);
  font-size: 12px;
}
.message-search-bar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 8px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.message-search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: #f2f5f7;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13px;
}
/* Menus and dialogs */
dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  max-width: min(440px, calc(100vw - 32px));
  width: 440px;
  max-height: 85dvh;
  color: var(--ink);
  box-shadow: 0 20px 90px #102f4b30;
  overflow: auto;
}
dialog::backdrop {
  background: #1c304c55;
  backdrop-filter: blur(4px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 19px 20px 10px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.modal-header h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.3px;
}
#modal-content {
  padding: 8px 24px 26px;
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.modal-description {
  font-size: 13px;
  line-height: 1.7;
  color: #8a99a5;
  margin: 0 0 18px;
}
.user-picker {
  max-height: 290px;
  overflow: auto;
  margin: 4px -10px;
  padding: 0 2px;
}
.user-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
}
.user-option:hover {
  background: #f4f7fa;
}
.user-option > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.user-option strong {
  font-size: 13px;
  font-weight: 600;
}
.user-option small {
  font-size: 11px;
  color: #9aa6af;
}
.user-option input {
  margin-left: auto;
  accent-color: var(--blue);
  width: 18px;
  height: 18px;
}
.section-label {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  color: #a0adb6;
  letter-spacing: 1px;
  margin: 20px 0 8px;
}
.menu-action {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 8px;
  text-align: left;
  width: 100%;
  font-size: 14px;
  border-radius: 10px;
}
.menu-action:hover {
  background: #f3f7fa;
}
.menu-action svg {
  color: #8c9da9;
  width: 22px;
}
.menu-action > span {
  flex: 1;
}
.menu-action small {
  font-size: 10px;
  color: #99a7b1;
}
.modal-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}
.profile-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 5px 0 24px;
}
.profile-info .avatar {
  width: 59px;
  height: 59px;
  font-size: 22px;
}
.profile-info strong {
  font-size: 17px;
}
.profile-info p {
  color: #94a1ab;
  font-size: 12px;
  margin: 7px 0 0;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.member-row > span:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.member-row strong {
  font-size: 13px;
  font-weight: 500;
}
.member-row small {
  font-size: 11px;
  color: #95a3ae;
}
.member-row .icon-button {
  width: 30px;
  height: 30px;
}
.member-row svg {
  width: 17px;
}
.status-label {
  display: inline-block;
  color: #96a5af;
  font-size: 11px;
}
.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #273c4eef;
  color: white;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 50;
  box-shadow: 0 5px 25px #22384e20;
  max-width: min(520px, calc(100vw - 30px));
  line-height: 1.5;
}
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #e7edf1;
  box-shadow: 0 6px 30px #26446120;
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  z-index: 30;
  max-height: 80dvh;
  overflow: auto;
}
.context-menu button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 13px;
  text-align: left;
  border-radius: 8px;
  font-size: 13px;
}
.context-menu button:hover {
  background: #f1f6fa;
}
.context-menu svg {
  height: 18px;
  width: 18px;
  color: #879cab;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.emoji-grid button {
  font-size: 26px;
  border-radius: 10px;
  padding: 10px 0;
  min-width: 0;
}
.emoji-grid button:hover {
  background: #eff6fc;
}
.photo-viewer {
  max-width: 90vw;
  width: auto;
  background: #15232ef5;
  color: #fff;
}
.photo-viewer .modal-header {
  background: transparent;
}
.photo-viewer #modal-content {
  padding: 0 18px 18px;
}
.photo-viewer img {
  max-width: calc(90vw - 36px);
  max-height: 72dvh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.modal-note {
  font-size: 11px;
  line-height: 1.7;
  color: #98a6b0;
}
.empty-search {
  font-size: 13px;
  color: #8a9aa7;
  text-align: center;
  padding: 24px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #fff6;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1450px) {
  :root {
    --side: 380px;
  }
  .sidebar-header {
    padding-left: 24px;
    padding-right: 24px;
  }
  .chat-row {
    padding: 8px 12px;
  }
  .chat-row .avatar {
    width: 46px;
    height: 46px;
  }
  .chat-name {
    font-size: 15px;
  }
  .chat-preview {
    font-size: 13px;
  }
}
@media (max-width: 1000px) {
  :root {
    --side: 310px;
  }
  .sidebar-header {
    padding-left: 14px;
    padding-right: 14px;
  }
  .chat-tabs {
    gap: 18px;
  }
  .chat-row {
    gap: 10px;
    padding: 7px 8px;
  }
  .chat-row .avatar {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }
  .chat-name {
    font-size: 13px;
  }
  .messages {
    padding-left: 24px;
    padding-right: 24px;
  }
  .compose-area {
    padding-left: 24px;
    padding-right: 24px;
  }
  .message-row {
    max-width: 86%;
  }
  .conversation-header {
    padding: 14px 20px;
  }
}
@media (max-width: 700px) {
  .login-screen {
    background:
      linear-gradient(180deg, #080d1c31 0%, #080d1c9c 44%, #080d1cf2 100%),
      url('/assets/wall-space.webp') center / cover no-repeat #080d1c;
  }
  .login-layout {
    grid-template-columns: minmax(0, 410px);
    grid-template-rows: auto auto;
    align-content: center;
    justify-content: center;
    gap: 0;
    padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
      max(26px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
  .login-scene {
    grid-row: 1;
    width: min(93%, clamp(175px, 42dvh, 330px));
    margin-block: -10px -14px;
  }
  .login-card {
    padding: 22px clamp(19px, 6vw, 30px) 24px;
    border-radius: 22px;
  }
  .login-card h1 {
    font-size: clamp(28px, 7.7vw, 37px);
    margin-bottom: 24px;
  }
  .login-card form {
    gap: 15px;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    height: 100%;
    border: 0;
  }
  .conversation {
    display: none;
  }
  .app-shell.chat-open .sidebar {
    display: none;
  }
  .app-shell.chat-open .conversation {
    display: block;
    height: 100%;
  }
  .sidebar-header {
    height: 68px;
    padding: 12px 18px;
  }
  .search-wrap {
    margin: 0 18px;
  }
  .chat-tabs {
    padding-left: 21px;
    gap: 28px;
  }
  .chat-list {
    padding: 6px 8px;
  }
  .chat-row {
    padding: 8px 12px;
    gap: 12px;
    border-radius: 12px;
  }
  .chat-row .avatar {
    width: 46px;
    height: 46px;
    font-size: 17px;
  }
  .chat-name {
    font-size: 15px;
  }
  .chat-preview {
    font-size: 13px;
  }
  .chat-time {
    font-size: 11px;
  }
  .profile-bar {
    padding: 14px 22px max(14px, env(safe-area-inset-bottom));
    min-height: 76px;
  }
  .conversation-header {
    height: 68px;
    padding: 10px 10px 10px 4px;
    gap: 3px;
  }
  .mobile-back {
    display: inline-flex;
  }
  .chat-heading {
    gap: 9px;
  }
  .chat-heading .avatar {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
  .chat-heading strong {
    font-size: 14px;
  }
  .chat-heading span span {
    font-size: 10px;
  }
  .header-actions {
    gap: 0;
  }
  .header-actions .icon-button {
    width: 34px;
  }
  .connection {
    margin-right: 5px;
    width: 5px;
    height: 5px;
  }
  .messages {
    padding: 15px 16px 12px;
  }
  .message-row {
    max-width: 88%;
    gap: 6px;
  }
  .message-row .avatar {
    width: 24px;
    height: 24px;
    font-size: 9px;
  }
  .message-text {
    font-size: 14px;
  }
  .message-actions {
    right: -25px;
    width: 24px;
    opacity: 0.6;
    background: transparent;
  }
  .own .message-actions {
    left: -25px;
  }
  .message-actions svg {
    width: 15px;
  }
  .message-bubble {
    padding: 9px 11px 6px;
  }
  .compose-area {
    padding: 9px 9px max(10px, env(safe-area-inset-bottom));
  }
  .composer {
    border-radius: 13px;
    padding: 5px;
    gap: 1px;
  }
  .composer textarea {
    font-size: 16px;
    padding-left: 5px;
  }
  .composer .icon-button {
    width: 36px;
  }
  .send-button {
    width: 39px;
    height: 39px;
    margin-bottom: 1px;
  }
  .compose-hint {
    display: none;
  }
  .pinned-bar {
    padding: 10px 18px;
    gap: 10px;
  }
  .pinned-bar span span {
    max-width: calc(100vw - 90px);
  }
  .message-photo {
    max-height: 300px;
  }
  .toast {
    bottom: 25px;
    font-size: 12px;
  }
  .attachment-preview {
    margin-bottom: 7px;
  }
  .message-search-bar {
    padding: 8px 12px;
  }
  .date-divider {
    font-size: 10px;
  }
  dialog {
    width: calc(100vw - 28px);
    border-radius: 16px;
  }
  .header-actions #chat-search-button {
    display: none;
  }
}
.user-option {
  flex-direction: row;
}
.message-photo:not([src]) {
  opacity: 0.35;
}
.avatar {
  overflow: hidden;
}
.avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-status {
  font-size: 0.8em;
  font-weight: 400;
  color: #7994a6;
  white-space: nowrap;
}
.chat-name .user-status {
  font-size: 10px;
}
.chat-row.active .user-status {
  color: #e1efff;
}
.profile-text .user-status {
  font-size: 10px;
}
.profile-photo-editor {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 0;
}
.profile-photo-editor > .avatar {
  height: 88px;
  width: 88px;
  font-size: 32px;
}
.profile-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.profile-photo-actions .secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 10px 13px;
}
.profile-photo-actions svg {
  width: 17px;
  height: 17px;
}
.profile-remove {
  font-size: 12px;
  color: #d66e75;
  padding: 0 5px;
}
.profile-photo-editor + .modal-note {
  margin: 4px 0 23px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
