* { box-sizing: border-box; }

body {
  font-family: sans-serif;
  background: #f0f0f0;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background: #4b6cb7;
  color: white;
  padding: 1em;
  text-align: center;
  font-size: 1.5em;
  border-radius: 10px;
  margin-bottom: 10px;
}

#status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 0.5em;
  background: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 10px;
  font-size: 0.9em;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ccc;
  border-top: 3px solid #4b6cb7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#chat {
  flex: 1;
  padding: 1em;
  overflow-y: auto;
  background: white;
  border-radius: 10px;
  margin-bottom: 10px;
  min-height: 200px;
}

#chat div {
  margin-bottom: 0.5em;
  padding: 8px;
  border-radius: 6px;
  font-size: 1em;
  word-break: break-word;
  white-space: pre-wrap;
}

.own-message {
  background: #e3f2fd;
  text-align: right;
  white-space: pre-wrap;
}

.partner-message {
  background: #f1f8e9;
  text-align: left;
  white-space: pre-wrap;
}

#form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#input {
  padding: 0.7em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 8px;
}

button {
  flex: 1;
  padding: 0.7em;
  font-size: 1em;
  background: #4b6cb7;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background: #3953a4;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

footer a {
  color: #4b6cb7;
  text-decoration: none;
  margin: 0 8px;
}

footer a:hover {
  text-decoration: underline;
}
