* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

button,
input,
textarea {
  font: inherit;
}

.page {
  min-height: 100vh;
  padding: 24px;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.auth-card {
  max-width: 460px;
  margin: 60px auto;
  padding: 24px;
}

.auth-card h1 {
  margin-top: 0;
}

.muted {
  color: #9ca3af;
}

.error-text {
  min-height: 20px;
  color: #fca5a5;
}

input,
textarea {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  color: #f9fafb;
  background: #0b1220;
  border: 1px solid #243041;
  border-radius: 12px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  margin-top: 12px;
  font-weight: 700;
}

button:hover {
  opacity: 0.95;
}

.secondary-btn {
  background: #374151;
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  min-height: calc(100vh - 48px);
}

.sidebar,
.chat {
  padding: 18px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.label {
  font-size: 12px;
  color: #9ca3af;
}

.me-label {
  font-size: 18px;
  font-weight: 700;
}

.panel {
  min-height: 0;
}

.panel-title {
  margin-bottom: 10px;
  font-weight: 700;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.list-item {
  padding: 12px;
  border-radius: 12px;
  background: #0b1220;
  border: 1px solid #1f2937;
  cursor: pointer;
}

.list-item:hover,
.list-item.active {
  border-color: #3b82f6;
  background: #0f1b31;
}

.item-title {
  font-weight: 700;
}

.item-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  font-size: 20px;
  font-weight: 700;
  padding-bottom: 14px;
  border-bottom: 1px solid #1f2937;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.message {
  max-width: 76%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #1f2937;
  line-height: 1.4;
}

.message.mine {
  margin-left: auto;
  background: #1d4ed8;
}

.message-meta {
  margin-bottom: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

.composer {
  border-top: 1px solid #1f2937;
  padding-top: 14px;
}

.empty-state {
  color: #9ca3af;
  padding: 18px 0;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .list {
    max-height: 180px;
  }

  .message {
    max-width: 92%;
  }
}
