:root {
  --app-height: 100vh;
  --bg: #f5f8ee;
  --bg-strong: #eef4df;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.72);
  --line: #dbe6c4;
  --line-strong: #c7de82;
  --text: #1f2714;
  --muted: #6f7c5d;
  --lime: #b8ea39;
  --lime-strong: #9fd11e;
  --lime-soft: #eef8cf;
  --shadow: 0 24px 70px rgba(93, 115, 55, 0.12);
  --shadow-soft: 0 16px 30px rgba(93, 115, 55, 0.1);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(184, 234, 57, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(184, 234, 57, 0.12), transparent 20%),
    linear-gradient(180deg, #f8fbf2 0%, #f2f6e8 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

body::before {
  top: -90px;
  left: -60px;
  width: 240px;
  height: 240px;
  background: rgba(184, 234, 57, 0.2);
}

body::after {
  right: -80px;
  bottom: -70px;
  width: 260px;
  height: 260px;
  background: rgba(204, 235, 118, 0.22);
}

button,
input {
  font: inherit;
}

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

.hidden {
  display: none;
}

.muted {
  color: var(--muted);
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #d8f57d, var(--lime));
  color: #23300a;
  font-size: 22px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 28px rgba(184, 234, 57, 0.25);
}

.logo.large,
.avatar.large {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 28px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f0f7d8, #ffffff);
  color: #50652a;
  border: 1px solid rgba(199, 222, 130, 0.5);
  font-weight: 800;
}

.auth-body,
.app-body {
  position: relative;
  z-index: 1;
}

.app-body {
  overflow: hidden;
}

.auth-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.auth-card,
.messenger-layout,
.drawer,
.empty-card {
  background: var(--surface-soft);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(219, 230, 196, 0.8);
  box-shadow: var(--shadow);
}

.auth-card {
  border-radius: var(--radius-xl);
  padding: 40px;
  width: min(100%, 460px);
}

.auth-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

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

.auth-tab,
.ghost-btn,
.icon-btn,
.primary-btn,
.search,
.composer input {
  border: 1px solid transparent;
  outline: none;
  transition: 0.2s ease;
}

.auth-tab,
.ghost-btn,
.icon-btn {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.auth-tab {
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.auth-tab.active,
.ghost-btn,
.primary-btn {
  background: linear-gradient(145deg, #eef8cd, #daf381);
  border-color: var(--line-strong);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form.hidden {
  display: none;
}

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

.field span {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.search,
.composer input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.field input:focus,
.search:focus,
.composer input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(184, 234, 57, 0.14);
}

.primary-btn {
  border: 0;
  cursor: pointer;
  color: #243008;
  font-weight: 800;
  border-radius: 16px;
  padding: 15px 18px;
  box-shadow: 0 16px 30px rgba(184, 234, 57, 0.22);
}

.primary-btn.compact {
  padding: 13px 14px;
  white-space: nowrap;
}

.form-message {
  min-height: 24px;
  margin-top: 16px;
  color: #9a3a3a;
  font-size: 14px;
}

.auth-switch {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5b6f2f;
  font-weight: 700;
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px;
}

.install-popup {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 31, 14, 0.34);
  backdrop-filter: blur(10px);
}

.install-popup.hidden {
  display: none;
}

.install-popup-card {
  width: min(100%, 420px);
  padding: 28px 24px;
  border-radius: 28px;
  display: grid;
  gap: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 230, 196, 0.9);
  box-shadow: var(--shadow);
}

.install-popup-card .logo {
  margin: 0 auto;
}

.install-popup strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
}

.install-popup p {
  color: var(--muted);
  line-height: 1.55;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.install-drawer {
  max-width: 420px;
}

.install-steps {
  display: grid;
  gap: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.messenger-layout {
  width: min(1440px, 100%);
  height: calc(100vh - 48px);
  margin: 0 auto;
  border-radius: 34px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px minmax(320px, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(252, 254, 248, 0.92), rgba(245, 248, 237, 0.92));
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-head,
.chat-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-badge,
.chat-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-name-button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.chat-name-button h2 {
  transition: color 0.2s ease;
}

.chat-name-button:hover h2 {
  color: #5a6f2c;
}

.sidebar-head p {
  color: var(--muted);
}

.sidebar-actions {
  padding: 0 24px 18px;
  display: grid;
  gap: 12px;
}

.chat-list,
.messages,
.user-results {
  overflow-y: auto;
  scrollbar-width: none;
}

.chat-list::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.user-results::-webkit-scrollbar {
  display: none;
}

.chat-list {
  flex: 1;
  padding: 0 14px 20px;
}

.calls-sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(252, 254, 248, 0.92), rgba(245, 248, 237, 0.92));
  display: none;
  flex-direction: column;
  min-height: 0;
}

.call-history-list {
  flex: 1;
}

.call-history-item .chat-title-row h3 {
  text-transform: none;
}

.call-history-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(184, 234, 57, 0.18);
  color: #40541d;
  font-weight: 800;
}

.call-history-item.incoming .call-history-icon {
  background: rgba(255, 232, 214, 0.88);
  color: #9a5e2a;
}

.chat-list-item,
.user-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin: 4px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.chat-list-item:hover,
.chat-list-item.active,
.user-row:hover {
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.chat-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.chat-list-item h3,
.user-row h3 {
  font-size: 15px;
  line-height: 1.2;
}

.chat-list-item p,
.user-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.unread {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime);
  color: #223008;
  font-weight: 800;
  font-size: 12px;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(184, 234, 57, 0.09), transparent 18%),
    linear-gradient(180deg, rgba(251, 253, 248, 0.96), rgba(246, 248, 239, 0.96));
}

.chat-header {
  border-bottom: 1px solid var(--line);
}

.mobile-back-btn {
  display: none;
  flex: 0 0 auto;
}

.messages {
  flex: 1;
  min-height: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.composer {
  padding: 18px 24px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.composer input {
  flex: 1;
  background: rgba(255, 255, 255, 0.92);
}

.composer .hidden {
  display: none;
}

.recording-indicator {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff7b6b;
  flex: 0 0 auto;
}

.recording-waves {
  height: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.recording-wave {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: #ff927f;
  transform-origin: center;
  transition: height 0.08s linear, opacity 0.08s linear;
  opacity: 0.7;
}

.recording-hint {
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-indicator.cancel {
  border-color: rgba(255, 120, 100, 0.45);
  color: #b04a3d;
}

.recording-indicator.cancel .recording-wave {
  background: #d97768;
}

#voiceButton.recording {
  background: linear-gradient(145deg, #ffe2b8, #ff9f7a);
  border-color: rgba(255, 120, 100, 0.45);
}

.send-btn,
.icon-btn,
.ghost-btn {
  cursor: pointer;
}

.send-btn,
.icon-btn {
  width: 50px;
  height: 50px;
  border-radius: 16px;
}

.icon-btn,
.ghost-btn {
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.ghost-btn {
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.ghost-btn:disabled,
.icon-btn:disabled,
.send-btn:disabled,
.primary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.send-btn {
  border: 0;
  background: linear-gradient(145deg, #d7f57d, var(--lime));
  color: #213008;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(184, 234, 57, 0.22);
}

.message-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-group.you {
  align-items: flex-end;
}

.message-date {
  align-self: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(184, 234, 57, 0.15);
  color: var(--muted);
  font-size: 12px;
}

.message-bubble {
  max-width: min(72%, 560px);
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.message-group.you .message-bubble {
  background: linear-gradient(145deg, #e3f89d, #c6ee55);
  border-color: rgba(184, 234, 57, 0.4);
}

.message-author {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.message-attachments {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.message-image {
  width: min(100%, 320px);
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(199, 222, 130, 0.5);
}

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

.message-meta {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
}

.empty-card {
  width: min(100%, 360px);
  padding: 28px;
  border-radius: 28px;
  text-align: center;
}

.empty-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  background: rgba(31, 39, 20, 0.16);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  width: min(420px, 100%);
  height: 100%;
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(252, 254, 247, 0.98), rgba(243, 247, 233, 0.98));
}

.drawer-backdrop.open .drawer {
  transform: translateX(0);
}

.drawer-head,
.drawer-body {
  padding: 24px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  overflow-y: auto;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 28, 12, 0.52);
  backdrop-filter: blur(16px);
}

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

.call-card {
  width: min(100%, 360px);
  padding: 32px 24px;
  border-radius: 32px;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(219, 230, 196, 0.9);
  box-shadow: var(--shadow);
}

.call-card .avatar {
  margin: 0 auto 16px;
}

.call-card .muted {
  margin-top: 8px;
}

.call-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.call-action {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.call-action.accept {
  background: linear-gradient(145deg, #d7f57d, var(--lime));
  color: #213008;
}

.call-action.reject,
.call-action.end {
  background: #ffefe9;
  color: #a34337;
}

.mobile-tabbar {
  display: none;
}

.mobile-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  cursor: pointer;
  padding: 0;
}

.mobile-tab.active {
  color: #1f2714;
}

.mobile-tab-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 230, 196, 0.9);
  box-shadow: var(--shadow-soft);
  font-size: 18px;
}

.mobile-tab.active .mobile-tab-icon {
  background: linear-gradient(145deg, #e3f89d, #c6ee55);
  border-color: rgba(184, 234, 57, 0.45);
  color: #213008;
}

.mobile-tab-label {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-card {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}

.drawer-body .auth-form {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

.settings-toggle-row {
  margin-top: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-toggle-row strong {
  display: block;
  margin-bottom: 4px;
}

.settings-toggle {
  width: 62px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  position: relative;
  background: #d8e1c6;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.settings-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
  transition: transform 0.2s ease;
}

.settings-toggle.active {
  background: linear-gradient(145deg, #d7f57d, var(--lime));
}

.settings-toggle.active .settings-toggle-thumb {
  transform: translateX(26px);
}

.settings-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.profile-card h3 {
  margin-top: 14px;
}

.profile-bio {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--lime-soft);
  color: #53652b;
  font-size: 13px;
  border: 1px solid rgba(184, 234, 57, 0.24);
}

.user-results {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: calc(100vh - 220px);
}

@media (min-width: 961px) {
  .calls-sidebar {
    display: none !important;
  }

  .messenger-layout {
    grid-template-columns: 340px minmax(320px, 1fr) !important;
  }
}

@media (max-width: 960px) {
  html,
  body,
  .app-body {
    height: var(--app-height);
    overflow: hidden;
  }

  .app-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    padding: 0;
    min-height: var(--app-height);
    height: var(--app-height);
    overflow: hidden;
  }

  .install-popup {
    padding: 16px;
    align-items: end;
  }

  .install-popup-card {
    width: 100%;
    border-radius: 24px;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .install-popup strong {
    font-size: 22px;
  }

  .install-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 26px;
    background: rgba(28, 33, 20, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
  }

  .mobile-tabbar.hidden {
    display: none;
  }

  .messenger-layout {
    width: 100%;
    height: var(--app-height);
    border-radius: 0;
    grid-template-columns: 1fr;
    position: relative;
  }

  .sidebar,
  .calls-sidebar,
  .chat-panel {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    height: var(--app-height);
    overflow: hidden;
  }

  .sidebar {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .calls-sidebar {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .messenger-layout.mobile-show-list .sidebar {
    display: flex;
  }

  .messenger-layout.mobile-show-list .calls-sidebar,
  .messenger-layout.mobile-show-list .chat-panel {
    display: none;
  }

  .messenger-layout.mobile-show-chat .sidebar {
    display: none;
  }

  .messenger-layout.mobile-show-chat .calls-sidebar {
    display: none;
  }

  .messenger-layout.mobile-show-chat .chat-panel {
    display: flex;
  }

  .messenger-layout.mobile-show-calls .sidebar,
  .messenger-layout.mobile-show-calls .chat-panel {
    display: none;
  }

  .messenger-layout.mobile-show-calls .calls-sidebar {
    display: flex;
  }

  .chat-header {
    padding: 18px 20px;
  }

  .mobile-back-btn {
    display: inline-flex;
  }

  .chat-header-actions {
    margin-left: auto;
  }

  .ghost-btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  .messages {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px 20px;
  }

  .composer {
    flex: 0 0 auto;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    background: linear-gradient(180deg, rgba(246, 248, 239, 0.72), rgba(246, 248, 239, 0.96));
  }

  .message-bubble {
    max-width: min(86%, 560px);
  }
}

@media (max-width: 640px) {
  .auth-page {
    padding: 14px;
  }

  .app-shell {
    padding: 0;
  }

  .auth-card,
  .sidebar-head,
  .chat-header,
  .drawer-head,
  .drawer-body {
    padding: 20px;
  }

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

  .sidebar-actions {
    padding: 0 16px 16px;
  }

  .chat-list {
    padding: 0 10px calc(18px + 96px + env(safe-area-inset-bottom, 0px));
  }

  .chat-list-item,
  .user-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    margin: 4px 6px;
    padding: 12px;
  }

  .chat-list-item .avatar,
  .user-row .avatar,
  .chat-header .avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .chat-title-row,
  .chat-person {
    min-width: 0;
  }

  .chat-list-item h3,
  .chat-name-button h2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-list-item p,
  #chatMeta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .messages,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .messages {
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .chat-header {
    gap: 10px;
  }

  .chat-person {
    min-width: 0;
    flex: 1;
  }

  .chat-header-actions {
    flex: 0 0 auto;
  }

  .chat-header .ghost-btn {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .composer {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: end;
  }

  .composer input,
  .recording-indicator {
    min-width: 0;
    padding: 13px 14px;
  }

  .recording-indicator {
    gap: 8px;
    font-size: 13px;
  }

  .recording-hint {
    display: none;
  }

  .send-btn,
  .icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .message-bubble {
    max-width: 100%;
    padding: 14px 15px;
  }

  .message-image,
  .message-audio {
    width: 100%;
  }

  .drawer {
    width: 100%;
    border-left: 0;
  }

  .call-overlay {
    padding: 18px;
  }

  .call-card {
    width: 100%;
    max-width: 340px;
    padding: 28px 20px;
  }

  .call-actions {
    flex-wrap: wrap;
  }
}
