@font-face {
  font-family: "Manrope";
  src: url("/static/assets/fonts/Manrope-VariableFont_wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Fira Code";
  src: url("/static/assets/fonts/FiraCode-VariableFont_wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sans: "Manrope", sans-serif;
  --mono: "Fira Code", monospace;
  --bg-1: #dce8f4;
  --bg-2: #edf4fb;
  --bg-3: #f7f1ea;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(245, 249, 252, 0.82);
  --panel-muted: rgba(255, 255, 255, 0.62);
  --text: #16324a;
  --muted: #667d95;
  --line: rgba(89, 113, 141, 0.14);
  --accent: #2e7be7;
  --accent-2: #63b5ff;
  --accent-3: #3fd0b0;
  --danger: #d95959;
  --bubble: rgba(255, 255, 255, 0.96);
  --bubble-self-1: #d8eaff;
  --bubble-self-2: #cae0ff;
  --shadow: 0 30px 80px rgba(50, 79, 111, 0.16);
  --shadow-soft: 0 16px 40px rgba(50, 79, 111, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

body[data-theme="dark"] {
  --bg-1: #15202b;
  --bg-2: #1a2633;
  --bg-3: #233142;
  --panel: rgba(20, 29, 40, 0.76);
  --panel-strong: rgba(24, 35, 49, 0.92);
  --panel-soft: rgba(30, 42, 57, 0.86);
  --panel-muted: rgba(35, 48, 64, 0.72);
  --text: #eaf2fb;
  --muted: #aebccd;
  --line: rgba(174, 188, 205, 0.12);
  --accent: #6c9fff;
  --accent-2: #83bcff;
  --accent-3: #66d1b6;
  --bubble: rgba(35, 48, 64, 0.94);
  --bubble-self-1: #355b8b;
  --bubble-self-2: #426b9b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.22);
}

body[data-theme="dark"]::before {
  opacity: 0.18;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(98, 181, 255, 0.22), transparent 28%),
    radial-gradient(circle at 83% 15%, rgba(63, 208, 176, 0.16), transparent 26%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2) 44%, var(--bg-3));
  color: var(--text);
  font-family: var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  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: 28px 28px;
  opacity: 0.34;
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.ambient {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.42;
  pointer-events: none;
  animation: floaty 18s ease-in-out infinite;
}

.ambient-one {
  top: -8rem;
  right: -10rem;
  background: rgba(46, 123, 231, 0.18);
}

.ambient-two {
  bottom: -12rem;
  left: -12rem;
  background: rgba(63, 208, 176, 0.12);
  animation-delay: -6s;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  width: min(1440px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  margin: 16px auto;
}

.sidebar,
.conversation-panel,
.modal-card,
.auth-card {
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow);
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 0;
  padding: 18px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.sidebar-top,
.conversation-header,
.composer,
.call-stage {
  padding-left: 24px;
  padding-right: 24px;
}

.sidebar-top,
.conversation-header,
.call-stage-top,
.call-controls,
.composer-box,
.modal-head,
.quick-action-row,
.settings-split,
.settings-profile-head {
  display: flex;
  align-items: center;
}

.sidebar-top,
.conversation-header,
.modal-head,
.call-stage-top {
  justify-content: space-between;
  gap: 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark,
.avatar-chip,
.avatar-large,
.profile-avatar,
.contact-image {
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark {
  width: 54px;
  height: 54px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 32px rgba(46, 123, 231, 0.26);
}

.brand-mark.with-logo {
  background-color: transparent;
  background-image: url("/static/brand/scodit-favicon-192.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 50%;
  box-shadow: 0 14px 30px rgba(46, 123, 231, 0.16);
}

body[data-theme="dark"] .brand-mark.with-logo {
  background-color: transparent;
  box-shadow: 0 16px 34px rgba(4, 8, 14, 0.34);
}

.brand-caption {
  margin-bottom: 4px;
  white-space: nowrap;
  font-size: 0.54rem;
  letter-spacing: 0.1em;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

h1 {
  font-size: 1.08rem;
  line-height: 1.15;
}

.icon-button,
.send-button,
.modal-primary-button,
.quick-create button,
.theme-toggle button,
.settings-submit,
.composer-link,
.reaction-pill,
.message-tool,
.tabbar-button,
.call-control-button {
  border: 0;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.icon-button,
.send-button,
.call-control-button {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.icon-button {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(46, 123, 231, 0.08);
}

.icon-button svg,
.send-button svg,
.call-control-button svg,
.tabbar-icon svg,
.meta-icon svg,
.message-tool svg,
.attachment-tile svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.icon-button.accent,
.send-button,
.quick-create button,
.modal-primary-button,
.settings-submit,
.theme-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(46, 123, 231, 0.24);
}

.icon-button:hover,
.send-button:hover,
.quick-create button:hover,
.modal-primary-button:hover,
.composer-link:hover,
.reaction-pill:hover,
.message-tool:hover,
.tabbar-button:hover,
.call-control-button:hover {
  transform: translateY(-1px);
}

.icon-button.subtle {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-only {
  display: none;
}

.mobile-only span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.search-field,
.message-bubble,
.day-divider,
.modal-card,
.auth-card,
.toast,
.empty-chat-card,
.settings-card,
.settings-hero,
.contact-card,
.chat-card,
.settings-shortcut,
.picker-card,
.theme-toggle,
.tabbar {
  border-radius: var(--radius-lg);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.search-field svg {
  width: 18px;
  height: 18px;
  fill: var(--muted);
}

.search-field input,
.quick-create input,
.settings-field input,
.settings-field select,
.contact-create-grid input,
.contact-create-grid textarea,
.group-title-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.sidebar-list::-webkit-scrollbar,
.messages-scroll::-webkit-scrollbar,
.modal-scroll::-webkit-scrollbar {
  width: 10px;
}

.sidebar-list::-webkit-scrollbar-thumb,
.messages-scroll::-webkit-scrollbar-thumb,
.modal-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(100, 123, 147, 0.24);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.contact-card,
.chat-card,
.settings-shortcut,
.picker-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel-muted);
  border: 1px solid rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.contact-card.active,
.chat-card.active,
.settings-shortcut.active,
.picker-card.active {
  background: linear-gradient(135deg, rgba(226, 239, 255, 0.92), rgba(241, 249, 255, 0.88));
  border-color: rgba(46, 123, 231, 0.2);
}

.picker-card.is-disabled {
  opacity: 0.76;
}

.picker-card.is-disabled input {
  cursor: not-allowed;
}

body[data-theme="dark"] .contact-card.active,
body[data-theme="dark"] .chat-card.active,
body[data-theme="dark"] .settings-shortcut.active,
body[data-theme="dark"] .picker-card.active {
  background: linear-gradient(135deg, rgba(52, 83, 118, 0.9), rgba(36, 61, 88, 0.88));
}

body[data-theme="dark"] .settings-shortcut {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .settings-shortcut strong {
  color: rgba(243, 247, 255, 0.96);
}

body[data-theme="dark"] .settings-shortcut .contact-note {
  color: rgba(195, 208, 224, 0.92);
}

body[data-theme="dark"] .settings-shortcut .meta-icon {
  background: rgba(108, 159, 255, 0.16);
  color: #8ebaff;
}

body[data-theme="dark"] .settings-shortcut.active {
  background: linear-gradient(135deg, rgba(96, 121, 149, 0.28), rgba(72, 94, 119, 0.4));
  border-color: rgba(156, 188, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(156, 188, 255, 0.08);
}

body[data-theme="dark"] .settings-shortcut.active strong {
  color: #f4f8ff;
}

body[data-theme="dark"] .settings-shortcut.active .contact-note {
  color: rgba(224, 233, 245, 0.92);
}

body[data-theme="dark"] .settings-shortcut.active .meta-icon {
  background: rgba(108, 159, 255, 0.22);
  color: #9ec2ff;
}

.contact-card-main,
.chat-card-main {
  min-width: 0;
}

.contact-card-main {
  display: grid;
  gap: 4px;
}

.contact-card-title,
.chat-card-title,
.chat-card-preview,
.contact-card-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-card-title,
.chat-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.inline-indicator {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.inline-indicator svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.contact-card-subtitle,
.chat-card-preview,
.contact-card-side,
.chat-card-side,
.header-copy span,
.message-footer,
.settings-card p,
.empty-chat-card p,
.field-note,
.contact-note {
  color: var(--muted);
  line-height: 1.46;
}

.contact-card-role {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.contact-card-side,
.chat-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.avatar-chip {
  width: 52px;
  height: 52px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.avatar-chip.group {
  border-radius: 18px;
}

.avatar-chip img,
.avatar-large img,
.profile-avatar img,
.contact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.presence-dot,
.call-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.presence-dot {
  background: var(--accent-3);
  box-shadow: 0 0 0 6px rgba(63, 208, 176, 0.16);
}

.call-indicator {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(46, 123, 231, 0.14);
}

.badge {
  min-width: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  min-height: 88px;
  height: 88px;
  max-height: 88px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.42);
  align-self: end;
  overflow: hidden;
}

.tabbar-button {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  width: 100%;
  min-height: 72px;
  height: 72px;
  max-height: 72px;
  padding: 10px 8px;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  overflow: hidden;
}

.tabbar-button.active {
  color: var(--accent);
  background: rgba(46, 123, 231, 0.1);
  box-shadow: inset 0 0 0 1px rgba(46, 123, 231, 0.08);
}

.tabbar-button.active .tabbar-icon {
  transform: translateY(-2px) scale(1.04);
}

.tabbar-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  transition: transform 200ms ease, background 200ms ease;
}

.tabbar-button.active .tabbar-icon {
  background: rgba(46, 123, 231, 0.14);
}

.tabbar-button span:last-child {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.conversation-header {
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.header-left,
.header-actions,
.header-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-copy {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.header-copy strong {
  font-size: 1.04rem;
}

.header-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-chip,
.header-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 0.84rem;
}

.meta-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(46, 123, 231, 0.1);
  color: var(--accent);
}

.call-stage {
  margin: 18px 24px 0;
  padding-top: 20px;
  padding-bottom: 20px;
  background:
    linear-gradient(155deg, rgba(22, 37, 54, 0.96), rgba(32, 68, 105, 0.88)),
    radial-gradient(circle at top, rgba(98, 181, 255, 0.16), transparent 45%);
  color: #f5f9ff;
  border-radius: 28px;
}

.call-stage.hidden {
  display: none;
}

.call-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
}

.call-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.call-tile {
  position: relative;
  min-height: 184px;
  padding: 14px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.call-tile video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(8, 15, 24, 0.66);
}

.call-tile.self video {
  transform: scaleX(-1);
}

.avatar-large {
  width: 76px;
  height: 76px;
  font-size: 1.24rem;
}

.call-tile .avatar-large {
  margin-bottom: 12px;
}

.call-tile-footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(12, 18, 29, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.call-controls {
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.call-control-button {
  display: grid;
  place-items: center;
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.12);
}

.call-control-button.is-off {
  opacity: 0.62;
}

.call-control-button.danger {
  background: linear-gradient(135deg, #d95d5d, #f28181);
}

.quick-action-row {
  gap: 12px;
  flex-wrap: wrap;
}

.message-stage {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.messages-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 22px 26px 156px;
}

.messages,
.settings-screen {
  min-height: 100%;
}

.messages {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  padding-bottom: 0;
}

.message-empty-prompt {
  min-height: min(42vh, 360px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.message-empty-prompt strong {
  color: var(--text);
  font-size: 1.08rem;
}

.message-empty-prompt span {
  max-width: 340px;
  line-height: 1.5;
}

.settings-screen {
  display: grid;
  gap: 18px;
  width: 100%;
  margin: 0;
  align-content: start;
  justify-items: stretch;
  padding-bottom: 28px;
}

.settings-screen.hidden {
  display: none !important;
}

.day-divider {
  align-self: center;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-soft);
}

.message-row {
  display: flex;
}

.message-row.self {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(72%, 560px);
  padding: 12px 14px 10px;
  background: var(--bubble);
  box-shadow: var(--shadow-soft);
}

.message-row.self .message-bubble {
  background: linear-gradient(155deg, var(--bubble-self-1), var(--bubble-self-2));
}

.message-bubble.system {
  align-self: center;
  padding: 10px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
}

.message-author {
  margin-bottom: 6px;
  font-size: 0.84rem;
  font-weight: 800;
}

.message-text,
.deleted-copy {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.42;
}

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

.message-voice,
.message-attachment,
.attachment-meta,
.voice-topline,
.voice-waveform,
.message-actions,
.message-reactions,
.reaction-picker {
  display: flex;
}

.message-voice,
.message-attachment {
  flex-direction: column;
  gap: 10px;
}

.voice-topline {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-waveform {
  align-items: flex-end;
  gap: 4px;
  min-height: 36px;
}

.voice-waveform span {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
}

.message-voice audio {
  width: min(340px, 100%);
}

.voice-label,
.attachment-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.message-attachment img {
  width: min(360px, 100%);
  max-height: 260px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.attachment-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.attachment-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(46, 123, 231, 0.12);
  color: var(--accent);
}

.attachment-meta {
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

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

.message-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.74rem;
}

.message-status {
  font-weight: 700;
  color: var(--accent);
}

.message-reactions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
}

.reaction-pill.active {
  background: rgba(46, 123, 231, 0.16);
  color: var(--accent);
}

.message-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.message-tool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

.reaction-picker {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.reaction-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
}

.empty-chat {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.empty-chat.hidden {
  display: none;
}

.empty-chat-card {
  width: min(440px, 100%);
  padding: 30px;
  text-align: center;
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.empty-illustration {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.8rem;
}

.composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin-top: 0;
  flex-shrink: 0;
  padding-top: 14px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 -10px 24px rgba(22, 39, 60, 0.06);
  z-index: 2;
}

.composer.hidden {
  display: none;
}

.composer-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-meta {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.84rem;
}

.composer-link {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(46, 123, 231, 0.08);
}

.composer-box {
  gap: 12px;
  margin-top: 10px;
  padding: 12px 12px 12px 14px;
  background: rgba(233, 239, 247, 0.96);
  border: 1px solid rgba(189, 202, 220, 0.92);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.composer-box:focus-within {
  background: rgba(248, 251, 255, 0.98);
  border-color: rgba(46, 123, 231, 0.5);
  box-shadow:
    0 0 0 4px rgba(46, 123, 231, 0.12),
    0 12px 28px rgba(46, 123, 231, 0.1);
}

.composer textarea {
  flex: 1;
  min-height: 24px;
  max-height: 150px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  line-height: 1.5;
}

.composer textarea:disabled {
  opacity: 0.65;
}

.send-button {
  display: grid;
  place-items: center;
}

.overlay,
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 19, 29, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.overlay.hidden,
.modal-shell.hidden {
  display: none;
}

.auth-card,
.modal-card {
  width: min(860px, calc(100vw - 40px));
  padding: 22px;
}

.modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(88vh, 860px);
  overflow: hidden;
}

.modal-head {
  align-items: flex-start;
}

.modal-head > div {
  display: grid;
  gap: 6px;
}

.modal-head h3 {
  line-height: 1.18;
}

.auth-card {
  width: min(760px, calc(100vw - 48px));
}

.auth-card p {
  margin-top: 8px;
  color: var(--muted);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.auth-brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.auth-brand-copy {
  min-width: 0;
}

.auth-brand-copy h2 {
  margin: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
  padding: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.auth-tab {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px rgba(46, 123, 231, 0.2);
}

.auth-flow {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field input {
  min-height: 54px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 123, 231, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.auth-field input:focus {
  border-color: rgba(46, 123, 231, 0.5);
  box-shadow: 0 0 0 4px rgba(46, 123, 231, 0.12);
  background: rgba(248, 251, 255, 0.98);
}

.auth-label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
}

.auth-inline-link {
  justify-self: start;
  margin-top: -4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible {
  color: var(--accent-2);
}

.phone-input-shell,
.settings-phone-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(46, 123, 231, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.phone-input-shell input,
.settings-phone-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.country-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 78px;
  padding-right: 12px;
  border-right: 1px solid rgba(46, 123, 231, 0.12);
  font-weight: 800;
  color: var(--text);
}

.flag-ru {
  width: 20px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(22, 50, 74, 0.08);
  background: linear-gradient(180deg, #ffffff 0 33%, #2157d9 33% 66%, #de3a3a 66% 100%);
}

.auth-status,
.settings-note-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.auth-status strong,
.settings-note-card strong {
  font-size: 0.94rem;
}

.auth-status span,
.settings-note-card span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auth-actions button:last-child {
  min-width: 180px;
  border-radius: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.profile-choices,
.picker-list,
.settings-form,
.contact-create-grid,
.theme-preview-grid {
  display: grid;
  gap: 12px;
}

.profile-choices {
  margin-top: 18px;
}

.quick-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

.quick-create input,
.settings-field input,
.settings-field select,
.contact-create-grid input,
.contact-create-grid textarea,
.group-title-input {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(46, 123, 231, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .search-field,
body[data-theme="dark"] .tabbar,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .auth-tabs,
body[data-theme="dark"] .composer-box,
body[data-theme="dark"] .phone-input-shell,
body[data-theme="dark"] .settings-phone-shell,
body[data-theme="dark"] .auth-field input,
body[data-theme="dark"] .quick-create input,
body[data-theme="dark"] .settings-field input,
body[data-theme="dark"] .settings-field select,
body[data-theme="dark"] .contact-create-grid input,
body[data-theme="dark"] .contact-create-grid textarea,
body[data-theme="dark"] .group-title-input,
body[data-theme="dark"] .attachment-tile,
body[data-theme="dark"] .reaction-pill,
body[data-theme="dark"] .message-tool,
body[data-theme="dark"] .reaction-option,
body[data-theme="dark"] .settings-switch-profile,
body[data-theme="dark"] .auth-status,
body[data-theme="dark"] .settings-note-card,
body[data-theme="dark"] .contact-profile-line,
body[data-theme="dark"] .toast-action-button.neutral {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(174, 188, 205, 0.12);
  box-shadow: none;
}

body[data-theme="dark"] .icon-button.subtle {
  background: rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .auth-field input:focus {
  border-color: rgba(114, 164, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(92, 143, 238, 0.16);
}

body[data-theme="dark"] .auth-inline-link {
  color: #8ebaff;
}

body[data-theme="dark"] .auth-tab {
  color: rgba(225, 234, 246, 0.7);
}

body[data-theme="dark"] .composer-box:focus-within {
  border-color: rgba(114, 164, 255, 0.42);
  box-shadow:
    0 0 0 4px rgba(92, 143, 238, 0.16),
    0 12px 28px rgba(7, 14, 26, 0.34);
}

body[data-theme="dark"] .message-bubble.system,
body[data-theme="dark"] .day-divider,
body[data-theme="dark"] .call-tile-footer {
  background: rgba(255, 255, 255, 0.08);
}

.contact-create-grid textarea {
  min-height: 100px;
  padding-top: 14px;
  resize: vertical;
}

.modal-body {
  margin-top: 18px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.modal-section {
  display: grid;
  gap: 16px;
}

.group-settings-stack {
  display: grid;
  gap: 18px;
}

.modal-scroll {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.modal-section-title {
  font-size: 1rem;
  line-height: 1.3;
}

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

.picker-card input {
  width: 18px;
  height: 18px;
}

.contact-search-results {
  gap: 12px;
}

.contact-search-card {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 16px 18px;
  border-radius: 24px;
  align-items: center;
}

.contact-search-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.contact-search-card .avatar-chip {
  justify-self: start;
}

.contact-search-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.contact-search-copy strong {
  line-height: 1.24;
}

.contact-search-card .contact-note {
  line-height: 1.48;
}

.direct-chat-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
}

.direct-chat-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direct-chat-card .avatar-chip {
  justify-self: start;
}

.direct-chat-copy {
  gap: 4px;
}

.direct-chat-copy strong {
  line-height: 1.22;
}

.direct-chat-copy .contact-note {
  margin: 0;
}

.direct-chat-copy .contact-note.subtle {
  font-size: 0.92rem;
  color: var(--muted);
}

.modal-primary-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 40px));
}

.toast {
  padding: 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: var(--shadow-soft);
}

.toast.invite {
  padding: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 255, 0.88));
}

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

.toast-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(46, 123, 231, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toast p {
  margin-top: 6px;
  color: var(--muted);
}

.toast-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.toast-action-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toast-action-button.neutral {
  background: rgba(46, 123, 231, 0.08);
  color: var(--text);
}

.toast-action-button.success {
  color: #fff;
  background: linear-gradient(135deg, #3fb58f, #57d6ad);
}

.toast-action-button.danger {
  color: #fff;
  background: linear-gradient(135deg, #d45d69, #f0818a);
}

.toast-action-button.icon-only {
  width: 46px;
  padding: 0;
  border-radius: 14px;
}

.toast-action-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

body[data-theme="dark"] .toast.invite {
  background: linear-gradient(160deg, rgba(29, 41, 56, 0.96), rgba(23, 33, 45, 0.94));
}

.settings-hero {
  width: 100%;
  box-sizing: border-box;
  padding: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(239, 245, 252, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.48);
}

body[data-theme="dark"] .settings-hero {
  background: linear-gradient(160deg, rgba(26, 38, 53, 0.92), rgba(21, 31, 44, 0.84));
}

body[data-theme="dark"] .settings-avatar-button:hover .profile-avatar,
body[data-theme="dark"] .settings-avatar-button:focus-visible .profile-avatar {
  box-shadow: 0 20px 40px rgba(5, 10, 18, 0.34);
}

body[data-theme="dark"] .settings-avatar-clear {
  background: rgba(28, 39, 53, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(245, 248, 255, 0.92);
  box-shadow: 0 14px 26px rgba(4, 8, 14, 0.34);
}

body[data-theme="dark"] .settings-avatar-clear:hover,
body[data-theme="dark"] .settings-avatar-clear:focus-visible {
  background: rgba(34, 47, 63, 0.98);
  color: #8ebaff;
}

.settings-profile-head {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.settings-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.settings-avatar-button {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 30px;
  cursor: pointer;
}

.settings-avatar-button .profile-avatar {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.settings-avatar-button:hover .profile-avatar,
.settings-avatar-button:focus-visible .profile-avatar {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(35, 66, 120, 0.18);
  filter: saturate(1.04);
}

.settings-avatar-button:focus-visible {
  outline: none;
}

.settings-avatar-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(22, 50, 74, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(31, 54, 96, 0.12);
}

.settings-avatar-clear:hover,
.settings-avatar-clear:focus-visible {
  background: rgba(244, 248, 255, 1);
  color: var(--accent);
}

.settings-avatar-clear:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(46, 123, 231, 0.14), 0 12px 26px rgba(31, 54, 96, 0.12);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  font-size: 2rem;
  flex-shrink: 0;
}

.settings-profile-copy strong {
  display: block;
  font-size: clamp(1.65rem, 2vw, 2.2rem);
}

.settings-profile-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
}

.settings-switch-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 230px);
  min-height: 82px;
  padding: 0 26px;
  border-radius: 28px;
  border: 1px solid rgba(46, 123, 231, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.settings-main-card {
  display: grid;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.contact-profile-modal {
  gap: 18px;
}

.contact-profile-hero,
.contact-profile-actions {
  display: flex;
  align-items: center;
}

.contact-profile-hero {
  gap: 18px;
}

.contact-profile-avatar {
  width: 84px;
  height: 84px;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.contact-profile-copy {
  display: grid;
  gap: 8px;
}

.contact-profile-copy strong {
  font-size: 1.5rem;
}

.contact-profile-copy span,
.contact-profile-label {
  color: var(--muted);
}

.contact-profile-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(100, 123, 147, 0.12);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.contact-profile-status.online {
  background: rgba(63, 208, 176, 0.14);
  color: #169a7b;
}

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

.contact-profile-line {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.contact-profile-actions {
  justify-content: flex-start;
}

body[data-theme="dark"] .contact-profile-status.online {
  color: #69d7ba;
}

.settings-section-stack {
  display: grid;
  gap: 16px;
}

.settings-card {
  padding: 22px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: var(--shadow-soft);
}

.settings-card p {
  margin-top: 6px;
}

.settings-form {
  margin-top: 16px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 700;
}

.theme-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.56);
}

.theme-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
}

.theme-preview-grid {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-preview {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.5);
}

.theme-preview.light {
  background: linear-gradient(160deg, #fefefe, #eef5fb);
  color: #16324a;
}

.theme-preview.dark {
  background: linear-gradient(160deg, #233245, #17212c);
  color: #edf4ff;
}

.theme-preview.auto {
  background: linear-gradient(135deg, #fbfdff 0%, #eef5fb 44%, #dbe6f1 58%, #223243 100%);
  color: #16324a;
}

.theme-preview strong {
  display: block;
}

.theme-preview small {
  display: block;
  margin-top: 6px;
  opacity: 0.74;
}

.settings-submit {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 18px;
}

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

.group-avatar-panel,
.toggle-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--panel-muted);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.group-avatar-panel {
  gap: 18px;
  align-items: center;
}

.group-avatar-shell {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.group-avatar-button {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 22px;
  cursor: pointer;
}

.group-avatar-button .avatar-chip.group {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.group-avatar-button:hover .avatar-chip.group,
.group-avatar-button:focus-visible .avatar-chip.group {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(35, 66, 120, 0.18);
  filter: saturate(1.04);
}

.group-avatar-button:focus-visible {
  outline: none;
}

.group-avatar-panel .avatar-chip.group {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 1.05rem;
}

.group-avatar-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(22, 50, 74, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(31, 54, 96, 0.12);
}

.group-avatar-clear:hover,
.group-avatar-clear:focus-visible {
  background: rgba(244, 248, 255, 1);
  color: var(--accent);
}

.group-avatar-clear:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(46, 123, 231, 0.14), 0 12px 26px rgba(31, 54, 96, 0.12);
}

.group-avatar-copy,
.toggle-card-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.group-avatar-copy strong,
.toggle-card-copy strong,
.settings-shortcut strong {
  line-height: 1.24;
}

.group-avatar-copy span,
.toggle-card-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.group-members-note {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.58;
}

.group-members-block {
  display: grid;
  gap: 14px;
}

.group-members-block-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.group-members-list {
  gap: 12px;
  display: grid;
}

.group-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 24px;
  background: var(--panel-muted);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.group-member-row.current {
  background: linear-gradient(135deg, rgba(78, 116, 169, 0.38), rgba(61, 95, 142, 0.32));
  border-color: rgba(121, 162, 228, 0.2);
}

.group-member-row.available {
  background: rgba(255, 255, 255, 0.03);
}

.group-member-row .avatar-chip {
  justify-self: start;
}

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

.group-member-copy strong {
  line-height: 1.28;
}

.group-member-row .contact-note {
  line-height: 1.5;
}

.group-member-action {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
}

.group-member-action svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.group-member-action.remove {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(247, 250, 255, 0.92);
}

.group-member-action.add {
  color: #eef6ff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 26px rgba(46, 123, 231, 0.22);
}

.group-member-action:hover,
.group-member-action:focus-visible {
  transform: translateY(-1px);
}

.group-member-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(46, 123, 231, 0.14);
}

body[data-theme="dark"] .group-avatar-button:hover .avatar-chip.group,
body[data-theme="dark"] .group-avatar-button:focus-visible .avatar-chip.group {
  box-shadow: 0 20px 40px rgba(5, 10, 18, 0.34);
}

body[data-theme="dark"] .group-avatar-clear {
  background: rgba(28, 39, 53, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(245, 248, 255, 0.92);
  box-shadow: 0 14px 26px rgba(4, 8, 14, 0.34);
}

body[data-theme="dark"] .group-avatar-clear:hover,
body[data-theme="dark"] .group-avatar-clear:focus-visible {
  background: rgba(34, 47, 63, 0.98);
  color: #8ebaff;
}

body[data-theme="dark"] .group-members-block-title {
  color: rgba(239, 245, 255, 0.96);
}

body[data-theme="dark"] .group-member-row {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .group-member-row.available {
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] .group-member-action {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(240, 246, 255, 0.94);
}

body[data-theme="dark"] .group-member-action.remove:hover,
body[data-theme="dark"] .group-member-action.remove:focus-visible {
  background: rgba(217, 89, 89, 0.2);
  color: #ffd8d8;
}

.toggle-card {
  justify-content: space-between;
  text-align: left;
}

.toggle-card-copy {
  flex: 1;
  text-align: left;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 62px;
  height: 36px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.toggle-switch span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(42, 67, 96, 0.18);
  transition: transform 180ms ease, background 180ms ease;
}

.toggle-switch.active {
  background: rgba(46, 123, 231, 0.22);
}

.toggle-switch.active span {
  transform: translateX(26px);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

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

.contact-image {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.contact-note {
  font-size: 0.82rem;
}

.hidden {
  display: none !important;
}

@keyframes floaty {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, 18px, 0);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .message-bubble {
    max-width: 82%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  body {
    overflow: auto;
  }

  .modal-shell {
    padding: 12px;
  }

  .modal-card {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: calc(100vw - 18px);
    height: auto;
    min-height: calc(100vh - 18px);
    margin: 9px auto;
  }

  .sidebar {
    position: fixed;
    inset: 10px 10px auto 10px;
    z-index: 20;
    max-height: calc(100vh - 20px);
    transform: translateY(-110%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateY(0);
  }

  .mobile-only {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }

  .conversation-panel {
    min-height: calc(100vh - 18px);
  }

  .settings-profile-head,
  .group-avatar-panel,
  .toggle-card {
    flex-direction: column;
    align-items: stretch;
  }

  .conversation-header,
  .composer,
  .call-stage {
    padding-left: 18px;
    padding-right: 18px;
  }

  .messages-scroll {
    padding-left: 18px;
    padding-right: 18px;
  }

  .settings-screen,
  .settings-hero,
  .settings-main-card {
    width: 100%;
  }

  .auth-brand {
    align-items: flex-start;
  }

  .message-bubble {
    max-width: 90%;
  }

  .quick-create {
    grid-template-columns: 1fr;
  }

  .contact-profile-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding-right: 2px;
  }

  .auth-actions {
    flex-direction: column;
  }

  .auth-actions button:last-child {
    width: 100%;
    min-width: 0;
  }

  .settings-profile-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-switch-profile {
    width: 100%;
  }

  .theme-preview-grid {
    grid-template-columns: 1fr;
  }
}
