body {
  min-height: 100vh;
  margin: 0;
  background: #eef2f7;
  color: #16202a;
}

.app-shell {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 32px 0;
}

.auth-panel,
.main-panel {
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(31, 42, 55, 0.08);
  padding: 24px;
}

.auth-panel {
  max-width: 460px;
  margin: 8vh auto 0;
}

.brand-row,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-row {
  justify-content: flex-start;
}

.brand-icon {
  width: 52px;
  height: 52px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.25rem;
}

.brand-row p,
.eyebrow,
.user-item small,
.bubble small {
  color: #65758b;
}

.eyebrow {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

.form-message {
  min-height: 24px;
  margin-top: 14px;
  font-size: 0.92rem;
}

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

.user-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  text-align: left;
}

.user-item:hover {
  background: #eef6ff;
  border-color: #8ec5ff;
}

.avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
}

.user-item strong,
.user-item small {
  display: block;
}

.chat-panel {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.chat-title {
  flex: 1;
  text-align: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
}

.message {
  display: flex;
}

.message.sent {
  justify-content: flex-end;
}

.message.received {
  justify-content: flex-start;
}

.bubble {
  max-width: min(72%, 560px);
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  overflow-wrap: anywhere;
}

.message.sent .bubble {
  background: #dbeafe;
  border-color: #bfdbfe;
}

.bubble p {
  margin-bottom: 4px;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.empty-state {
  padding: 16px;
  color: #65758b;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  .auth-panel,
  .main-panel {
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .chat-panel {
    height: 100vh;
  }

  .panel-header {
    gap: 8px;
    align-items: flex-start;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions .btn {
    width: 100%;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 86%;
  }
}
