:root {
  --bg: #f6f1e7;
  --paper: #fffdf8;
  --ink: #1d2433;
  --muted: #6b6558;
  --line: #e4dccb;
  --accent: #1f3a6b;
  --accent-soft: #e8edf6;
  --gold: #b08a3e;
  --gold-soft: #f6efdf;
  --ok: #2f6b3f;
  --danger: #a33b2f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 36, 51, .05), 0 6px 20px rgba(29, 36, 51, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Source Sans 3", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }
.bh { text-align: right; color: var(--muted); font-size: 13px; padding-top: 14px; }
header.hero { text-align: center; padding: 28px 0 24px; }
.hero h1 {
  font-family: "Frank Ruhl Libre", Georgia, serif;
  font-weight: 700; font-size: clamp(30px, 6vw, 44px); line-height: 1.15;
  margin: 0 0 8px; color: var(--accent);
}
.hero p { margin: 0 auto; max-width: 520px; color: var(--muted); }
.ornament { color: var(--gold); letter-spacing: 6px; margin: 14px 0 0; font-size: 14px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
h2 { font-family: "Frank Ruhl Libre", Georgia, serif; font-size: 22px; margin: 0 0 14px; }

label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input[type=text], textarea {
  width: 100%; font: inherit; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 110px; }
.field { margin-bottom: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 18px;
  background: var(--accent); color: #fff; transition: filter .15s, transform .05s;
}
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.ok { background: var(--ok); }
button.danger { background: transparent; color: var(--danger); border-color: #e7c9c4; }
button.small { padding: 6px 12px; font-size: 14px; }

.notice { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 15px; }
.notice.ok { background: #e7f2ea; color: var(--ok); }
.notice.err { background: #f7e6e3; color: var(--danger); }
.hidden { display: none !important; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.list { display: grid; gap: 14px; margin-top: 14px; }
.msg .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.msg .author { font-weight: 700; color: var(--ink); font-size: 15px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply {
  margin-top: 14px; padding: 12px 14px;
  background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0;
}
.reply .who { font-size: 13px; font-weight: 700; color: var(--gold); margin-bottom: 2px; }
.reply .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161f; --paper: #1a2030; --ink: #ebe6da; --muted: #a39d8f; --line: #2c3447;
    --accent: #8fb0ea; --accent-soft: #23314d; --gold: #d6b26a; --gold-soft: #2a2618;
    --ok: #7cc48f; --danger: #ec8d80;
  }
  input[type=text], textarea { background: #141927; }
  button, .btn { color: #10141c; }
  button.ghost, button.danger { color: var(--ink); }
  button.danger { color: var(--danger); border-color: #5a2f2a; }
  .notice.ok { background: #1d3325; } .notice.err { background: #3a1f1c; }
}
.hero .he { font-family: "Frank Ruhl Libre", Georgia, serif; color: var(--gold); font-size: 20px; margin: -2px 0 12px; }
