.auth-dialog:not([open]) { display: none !important; }
.access-note { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
#resendButton { width: 100%; margin-top: 8px; padding: 7px; border: 0; background: transparent; color: #008069; font-size: 11px; cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 2px; }
#installButton, #profileButton, #logoutButton { padding: 6px 8px; border-radius: 6px; background: transparent; color: #008069; font-size: 11px; font-weight: bold; }
#installButton:hover, #profileButton:hover, #logoutButton:hover { background: #00a8841c; }
.sidebar-close {
  display: none;
}

html, body { height: 100%; }
body { min-height: 100dvh; overflow: hidden; }
:root {
  --green: #0f2a44;
  --dark: #07111d;
  --side: #ffffff;
  --head: #edf2f7;
  --ink: #101820;
  --muted: #64748b;
  --line: #d7dee8;
  --paper: #eef2f5;
  --sent: #dbeafe;
  --security-gold: #c8a24a;
}
body {
  background: linear-gradient(180deg,#07111d 0 96px,#0f2a44 96px 125px,#e8edf0 125px);
}
body.auth-locked {
  background: radial-gradient(circle at top,#183b5a 0,#07111d 48%,#03080d 100%);
}
body.auth-locked .app {
  display: none !important;
}
.auth-intro {
  background: linear-gradient(145deg,#07111d,#0f2a44) !important;
  align-content: center;
  text-align: center;
}
.auth-intro h1 {
  margin-top: 14px;
}
.auth-symbol,
.me b,
.avatar {
  background: linear-gradient(145deg,#0f2a44,#07111d) !important;
  box-shadow: inset 0 0 0 2px #c8a24a44;
}
.private {
  background: #edf5f6 !important;
  border-left: 4px solid var(--security-gold);
}
.primary,
.composer button[type="submit"] {
  background: linear-gradient(135deg,#0f2a44,#123b5d) !important;
}
.call-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #c8a24a22;
  color: #0f2a44;
  font-size: 17px;
}
.call-button:hover {
  background: #c8a24a44;
}
.call-button[hidden] {
  display: none !important;
}
.app {
  height: min(930px, calc(100dvh - 38px));
  min-height: 0;
  max-height: calc(100dvh - 38px);
}
.sidebar,
.chat {
  min-height: 0;
  overflow: hidden;
}
.sidebar header,
.chat-header,
.composer {
  flex: 0 0 auto;
}
.chat-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.sidebar-foot {
  flex: 0 0 auto;
  margin: 10px 16px 15px;
}
.conversation-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f0f2f5;
}
.conversation-item .conversation {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
}
.conversation-menu-button,
.conversation-delete {
  flex: 0 0 auto;
  padding: 0 10px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  font-weight: bold;
}
.conversation-menu-button:hover,
.conversation-delete:hover {
  background: #eef2f6;
}
.chat-flags {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 8px;
  color: #64748b;
  font-style: normal;
}
.chat-badge,
.unread-badge {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #edf2f7;
  color: #0f2a44;
  font-size: 11px;
  font-weight: 800;
}
.unread-badge {
  padding: 0 6px;
  background: #c8a24a;
  color: #07111d;
}
.message-sender {
  display: block;
  margin-bottom: 3px;
  color: #008069;
  font-size: 11px;
}
.message.out .message-sender {
  color: #54656f;
}
.managed-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 700px) {
  html,
  body { width: 100%; overflow: hidden; }
  .app {
    width: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(88vw, 360px);
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 12px 0 35px #0005;
  }
  .app.open .sidebar {
    transform: translateX(0);
  }
  .app.open .chat::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    background: #07111d99;
  }
  .conversation-delete {
    padding: 0 8px;
  }
  .chat-header {
    padding: 0 10px;
    gap: 8px;
    position: relative;
    z-index: 1;
  }
  .mobile-button,
  .sidebar-close {
    display: grid !important;
    width: 40px;
    height: 40px;
    place-items: center;
    flex: 0 0 40px;
    border-radius: 10px;
    background: #0f2a44 !important;
    color: #fff !important;
    font-size: 22px;
    line-height: 1;
  }
  .sidebar-close {
    margin-left: 4px;
  }
  .chat-header > div {
    min-width: 0;
    flex: 1;
  }
  .chat-header strong,
  .chat-header small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #notificationsButton {
    display: none;
  }
  .messages {
    padding: 14px 10px 12px;
  }
  .message {
    max-width: 92%;
  }
  .composer {
    gap: 7px;
    padding: 8px;
  }
  .composer-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .composer button[type="submit"] {
    padding: 0 12px;
    min-height: 40px;
  }
  .composer textarea {
    min-width: 0;
    font-size: 16px;
  }
  .auth-dialog {
    width: min(94vw, 430px);
    max-height: 92dvh;
    overflow-y: auto;
  }
  .auth-intro {
    min-height: 150px;
  }
}
