* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

input, textarea {
  user-select: text;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0b0f17;
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 540px;
}

.card {
  background: #131a26;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  background: #0b0f17;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #f9fafb;
  font-size: 0.95rem;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: #3b82f6;
}

.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  flex: 1;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #1f2937;
  color: #e5e7eb;
  flex: 1;
}

.btn-secondary:hover {
  background: #374151;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
  background: #1f2937;
  color: #e5e7eb;
}

.full {
  width: 100%;
}

.panel {
  border-top: 1px solid #1f2937;
  padding-top: 16px;
  margin-top: 8px;
}

.hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 12px;
}

.error {
  margin-top: 12px;
  padding: 10px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #1f2937;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 18px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.chat-shell {
  background: #131a26;
  border: 1px solid #1f2937;
  border-radius: 12px;
  height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-badge {
  font-size: 0.88rem;
  color: #d1d5db;
}

.member-badge {
  font-size: 0.78rem;
  background: #1f2937;
  color: #9ca3af;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.knock-queue {
  background: #172030;
  border-bottom: 1px solid #1f2937;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}

.knock-info {
  display: flex;
  flex-direction: column;
}

.knock-msg {
  color: #9ca3af;
  font-size: 0.78rem;
}

.knock-btns {
  display: flex;
  gap: 6px;
}

.messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
}

.msg-self {
  align-self: flex-end;
  background: #2563eb;
  color: #ffffff;
}

.msg-other {
  align-self: flex-start;
  background: #1f2937;
  color: #f3f4f6;
}

.msg-sender {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-bottom: 2px;
}

.msg-system {
  align-self: center;
  font-size: 0.78rem;
  color: #9ca3af;
  background: transparent;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #1f2937;
}

.chat-form input {
  flex: 1;
  padding: 10px 12px;
  background: #0b0f17;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #f9fafb;
  outline: none;
}

.chat-form button {
  flex: 0 0 auto;
}
