:root {
  --bg: #f6f1e7;
  --paper: #fffdf8;
  --ink: #1f1c17;
  --muted: #6b6457;
  --line: #e2d9c7;
  --accent: #1f3a5f;
  --accent-ink: #ffffff;
  --mark: #ffe08a;
  --green: #2f7d4a; --green-bg: #e3f2e6;
  --yellow: #8a6a00; --yellow-bg: #fbf0c9;
  --red: #a33a2c; --red-bg: #f8e1dc;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f; --paper: #211e17; --ink: #ece6d8; --muted: #a59d8c; --line: #3a352a;
    --accent: #9cb8e0; --accent-ink: #111; --mark: #6b5414;
    --green: #8fd3a3; --green-bg: #1e3326; --yellow: #f0cf6a; --yellow-bg: #3a3116;
    --red: #f0a090; --red-bg: #3d211c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.tiny { max-width: 380px; padding-top: 32px; }
h1, h2, .brand, .sig, .salutation, .prose, .excerpt, .lede { font-family: var(--serif); }
h1 { font-weight: 600; font-size: clamp(30px, 6vw, 44px); line-height: 1.15; margin: 32px 0 12px; letter-spacing: -0.01em; }
h2 { font-weight: 600; font-size: 24px; line-height: 1.25; margin: 28px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* header / footer */
header.site { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand i { font-weight: 400; }
nav { display: flex; gap: 16px; align-items: center; font-size: 15px; }
nav a { color: var(--ink); text-decoration: none; }
nav a.cta { background: var(--accent); color: var(--accent-ink); padding: 6px 12px; border-radius: 6px; }
footer.site { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer.site a { color: var(--muted); }

/* home */
.hero { padding: 24px 16px 8px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--muted); margin: 32px 0 0; }
.lede { font-size: 21px; line-height: 1.5; color: var(--ink); }
.list { margin-top: 24px; display: grid; gap: 16px; }
.card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; }
.card:hover { border-color: var(--accent); }
.card .cover { position: absolute; inset: 0; }
.card h2 { margin: 4px 0 8px; }
.excerpt { font-size: 18px; margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 14px; margin: 0; }
.sig { font-style: italic; font-size: 18px; margin: 8px 0 0; }
.sig.big { font-size: 22px; margin-top: 24px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* buttons */
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
  padding: 11px 18px; font: 600 16px var(--sans); text-decoration: none; cursor: pointer; }
.button.secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.button.approve { background: var(--green); color: #fff; }
.button.reject { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
@media (prefers-color-scheme: dark) { .button.approve { color: #111; } }
.link, button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; margin-left: 12px; }
button.link { margin: 0; font-size: 14px; }

/* letter page */
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 24px clamp(18px, 5vw, 48px); margin-top: 24px; }
.paper h1 { margin-top: 8px; }
.salutation { font-size: 20px; margin: 16px 0 8px; }
.prose { font-size: 19px; line-height: 1.7; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1em; }
.back { margin-top: 16px; font-size: 15px; }

/* forms */
.summary { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 4px 20px 8px; margin: 16px 0 24px; }
.summary h2 { font-size: 20px; margin-top: 12px; }
.summary ul { padding-left: 20px; margin: 8px 0; }
.summary li { margin-bottom: 6px; }
.letter-form { display: grid; gap: 18px; }
.letter-form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.letter-form .hint, .opt { font-weight: 400; color: var(--muted); font-size: 14px; }
input, textarea { width: 100%; font: 17px/1.5 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea[name=body] { font: 19px/1.6 var(--serif); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.letter-form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.two { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.count { font-weight: 400; color: var(--muted); font-size: 13px; text-align: right; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 8px; }
.ok { background: var(--green-bg); color: var(--green); padding: 10px 14px; border-radius: 8px; }
.prose-page p, .prose-page li { font-family: var(--serif); font-size: 19px; }
.steps li { margin-bottom: 8px; }

/* editor */
.ed-head { display: flex; justify-content: space-between; align-items: baseline; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-size: 15px; }
.tabs a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tabs span { background: var(--line); border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.note { background: var(--yellow-bg); color: var(--ink); padding: 10px 14px; border-radius: 8px; font-size: 15px; }
.queue { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.queue a { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; color: var(--ink); text-decoration: none; }
.queue a:hover { border-color: var(--accent); }
.row1 { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line); color: var(--ink); }
.q-green, .r-low { background: var(--green-bg); color: var(--green); }
.q-yellow, .r-medium { background: var(--yellow-bg); color: var(--yellow); }
.q-red, .r-high, .spam, .err { background: var(--red-bg); color: var(--red); }
.chip.wait { background: var(--line); color: var(--muted); }
.reason { margin: 4px 0; font-size: 15px; }
.first { margin: 4px 0 0; color: var(--muted); font-family: var(--serif); font-size: 16px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } .col-side { order: -1; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 16px; margin-bottom: 16px; }
.panel h2 { font-size: 19px; margin: 14px 0 10px; }
.actions form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.actions .button { flex: 1; text-align: center; }
.score { margin-bottom: 14px; }
.score p { margin: 6px 0 0; font-size: 15px; }
.phrases { padding-left: 18px; margin: 8px 0 0; font-size: 15px; }
.phrases li { margin-bottom: 6px; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.editbox { margin-top: 16px; }
.editbox summary { cursor: pointer; color: var(--accent); }
.st-published { color: var(--green); } .st-rejected { color: var(--red); }
