:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --primary: #f6821f;   /* Cloudflare orange */
  --primary-dark: #d96e15;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --danger: #e53e3e;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  padding: 24px 16px;
}

.container {
  max-width: 680px;
  margin: 0 auto;
}

header { text-align: center; margin-bottom: 32px; }
header h1 { font-size: 2rem; font-weight: 700; }
header .subtitle { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* Form card */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.form-card h2 { font-size: 1.1rem; margin-bottom: 16px; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .15s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

button[type="submit"]:hover { background: var(--primary-dark); }
button[type="submit"]:disabled { background: #ccc; cursor: not-allowed; }

/* Toast */
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: .9rem;
  text-align: center;
  margin-bottom: 16px;
  transition: opacity .3s;
}

.toast.success { background: #c6f6d5; color: #276749; }
.toast.error   { background: #fed7d7; color: #9b2c2c; }
.toast.hidden  { display: none; }

/* Messages section */
.messages-section h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Message card */
.message-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.message-body { flex: 1; min-width: 0; }

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.author { font-weight: 600; font-size: .95rem; }

.time { color: var(--muted); font-size: .8rem; }

.content { font-size: .95rem; word-break: break-word; }

.delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.delete-btn:hover { color: var(--danger); background: #fff5f5; }

/* Empty / loading states */
.loading, .empty {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  font-size: .95rem;
}
