* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  background: #f4f6fb;
  color: #111827;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 18px;
}

header h1 {
  margin-bottom: 4px;
}

.card {
  background: white;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.hidden {
  display: none;
}

input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 15px;
}

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

button.secondary {
  background: #6b7280;
}

button.danger {
  background: #dc2626;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.small {
  font-size: 12px;
  color: #6b7280;
  overflow-wrap: anywhere;
}

.start-chat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.messages {
  height: 430px;
  overflow-y: auto;
  background: #f9fafb;
  border-radius: 14px;
  padding: 12px;
  margin: 14px 0;
  border: 1px solid #e5e7eb;
}

.msg {
  max-width: 78%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #e5e7eb;
  word-wrap: break-word;
}

.msg.me {
  margin-left: auto;
  background: #2563eb;
  color: white;
}

.msg img {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 6px;
}

.tick {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-top: 5px;
  text-align: right;
}

.composer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 650px) {
  .composer {
    grid-template-columns: 1fr 220px auto;
    align-items: center;
  }
}
