:root {
  --bg: #f5f6f8;
  --fg: #1c1e21;
  --accent: #2563eb;
  --border: #dcdfe4;
  --unread: #eef3ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}
header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: white;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { font-weight: 600; }
nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav a, .user a { color: var(--accent); text-decoration: none; }
nav a:hover, .user a:hover { text-decoration: underline; }
.user { margin-left: auto; color: #555; }
main { max-width: 900px; margin: 0 auto; padding: 20px; }
h1 { font-size: 1.4rem; }
table.message-list { width: 100%; border-collapse: collapse; background: white; }
table.message-list th, table.message-list td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.message-list tr.unread { font-weight: 600; background: var(--unread); }
table.message-list a { color: inherit; text-decoration: none; }
.empty { color: #777; }
.message-view { background: white; padding: 20px; border-radius: 6px; }
.message-view .meta { color: #555; margin-bottom: 16px; font-size: 0.9rem; }
.message-view pre.body {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 20px;
}
form label { display: block; margin-bottom: 12px; }
form input[type=text], form input[type=email], form input[type=password], form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  margin-top: 4px;
}
button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}
button.danger { background: #dc2626; }
.login-box { max-width: 360px; margin: 60px auto; background: white; padding: 24px; border-radius: 6px; }
.flashes { list-style: none; padding: 10px 14px; margin: 0 0 16px; background: #fff3cd; border: 1px solid #ffe08a; border-radius: 4px; }
.compose-form, .mailbox-form { background: white; padding: 20px; border-radius: 6px; margin-bottom: 20px; }
.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input[type=text] { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 4px; }
.search-form a { align-self: center; color: var(--accent); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; background: #eee; color: #555; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.pending { background: #fef3c7; color: #92400e; }
.message-view .actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.message-view .actions .button { background: var(--accent); color: white; padding: 8px 14px; border-radius: 4px; text-decoration: none; font-size: 0.95rem; }
.attachments { margin-bottom: 16px; padding: 10px; background: #f5f6f8; border-radius: 4px; }
.attachments ul { margin: 6px 0 0; padding-left: 20px; }
.hint { color: #666; font-size: 0.85rem; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; margin: 0; }
.receipt-banner { background: #eef3ff; border: 1px solid #bcd2ff; padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.receipt-banner button { padding: 6px 12px; font-size: 0.9rem; }
