* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --page: #f5f6f7;
  --surface: #ffffff;
  --text: #30363d;
  --muted: #7b8490;
  --line: #e7eaee;
  --accent: #607d96;
  --accent-hover: #506d86;
  --soft: #f0f3f5;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
.page { width: min(760px, calc(100% - 32px)); margin: 48px auto; }
.topbar, .section-heading, .compose-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar { margin-bottom: 28px; }
h1 { margin: 2px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.4px; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; margin: 0 0 18px; box-shadow: 0 2px 8px rgba(25, 35, 45, .025);
}
.status-time { margin: 12px 0 0; color: var(--accent); font-size: 23px; font-weight: 600; letter-spacing: -.3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.notice { padding: 11px 14px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #53616d; }
.button {
  border: 1px solid var(--accent); border-radius: 7px; background: var(--accent);
  color: white; padding: 9px 15px; font: inherit; font-size: 13px; cursor: pointer;
  transition: background .15s ease;
}
.button:hover { background: var(--accent-hover); }
.button-quiet { color: #596571; background: transparent; border-color: var(--line); }
.button-quiet:hover { color: var(--text); background: var(--soft); }
.compose { margin-top: 18px; }
textarea {
  display: block; width: 100%; min-height: 104px; resize: vertical;
  padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: #fcfcfd; color: var(--text); font: inherit; outline: none;
}
textarea:focus { border-color: #9aafc0; box-shadow: 0 0 0 3px rgba(96, 125, 150, .10); }
textarea::placeholder { color: #a0a8b0; }
.compose-footer { margin-top: 10px; }
.message-list { display: grid; gap: 10px; margin-top: 20px; }
.message { padding: 14px 15px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; }
.message-body { margin: 0 0 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-meta { margin: 0; color: var(--muted); font-size: 11px; }
.read-state { color: #657f91; }
.empty-state { margin: 20px 0 0; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
  .page { margin: 24px auto; }
  .panel { padding: 18px; }
  .topbar { align-items: flex-start; }
}

.messages-section { margin-top: 4px; }
.messages-open-form { width: 100%; margin: 0; }
.messages-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 17px; text-align: left; list-style: none;
}
.message-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: rgba(255,255,255,.18); font-size: 11px;
}
.toggle-indicator { margin-left: auto; font-size: 20px; line-height: 1; font-weight: 400; }
.messages-panel { margin-top: 10px; }
.messages-panel .compose { margin-top: 0; }
.message-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.delete-form { margin: 0; }
.delete-button {
  padding: 3px 7px; border: 0; background: transparent; color: #8b9299;
  font: inherit; font-size: 11px; cursor: pointer; border-radius: 5px;
}
.delete-button:hover { color: #9b5555; background: #f8f1f1; }
@media (max-width: 520px) {
  .message-bottom { align-items: flex-start; }
  .delete-button { white-space: nowrap; }
}


/* Login page uses the same restrained visual style as the dashboard. */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.login-wrap { width: min(420px, 100%); }
.login-panel { padding: 30px; margin: 0; }
.login-panel h1 { margin-bottom: 0; }
.login-intro { margin: 8px 0 22px; font-size: 13px; }
.login-form { display: grid; gap: 8px; }
.login-form label { margin-top: 5px; color: #596571; font-size: 12px; font-weight: 600; }
.login-form input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fcfcfd; color: var(--text); font: inherit; outline: none; }
.login-form input:focus { border-color: #9aafc0; box-shadow: 0 0 0 3px rgba(96, 125, 150, .10); }
.login-submit { width: 100%; margin-top: 12px; }
.login-error { margin: 0 0 16px; }
