:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #16171a;
  --muted: #62656c;
  --line: #e3e0d8;
  --accent: #b3122e;
  --accent-ink: #ffffff;
  --warn-bg: #fff3d6;
  --warn-ink: #7a5200;
  --ok: #1f8a4c;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121315;
    --surface: #1b1c1f;
    --text: #ecebe7;
    --muted: #a0a2a8;
    --line: #2e3034;
    --accent: #ff4d6a;
    --accent-ink: #121315;
    --warn-bg: #3a2e12;
    --warn-ink: #f3cf7a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-top { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 20px 16px 12px; }
.logo { font: 700 34px/1 var(--serif); letter-spacing: .08em; text-decoration: none; color: var(--accent); }
.logo.small { font-size: 20px; }
.logo span { font: 500 13px var(--sans); letter-spacing: 0; color: var(--muted); }
.tagline { color: var(--muted); font-size: 14px; }
.catnav { border-top: 3px solid var(--text); }
.catnav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav a { padding: 10px 12px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.catnav a:hover { color: var(--accent); }

/* Lists */
.section-title { font: 700 28px/1.2 var(--serif); margin: 28px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.card-img img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card-body { padding: 16px; }
.card h2 { font: 700 20px/1.3 var(--serif); margin: 4px 0 8px; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card-lead { grid-column: 1 / -1; }
.card-lead h2 { font-size: 30px; }
.summary { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.kicker { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; }
time, .byline { color: var(--muted); font-size: 13px; }
.pager { display: flex; justify-content: space-between; margin: 32px 0; }
.empty { color: var(--muted); }

/* Article */
.story { max-width: 720px; margin: 32px auto; }
.story h1 { font: 700 38px/1.15 var(--serif); margin: 8px 0 12px; }
.standfirst { font-size: 20px; color: var(--muted); margin: 0 0 12px; }
.hero { margin: 20px 0; border-radius: 6px; }
.story-body { font: 19px/1.7 var(--serif); }
.story-body h2, .story-body h3 { font-family: var(--sans); margin-top: 1.6em; }
.story-body blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding-left: 16px; color: var(--muted); }
.sources { margin-top: 36px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.sources h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.sources ul { margin: 0; padding-left: 20px; font-size: 15px; }
.disclosure { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 16px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 16px 0; color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  .logo { font-size: 28px; }
  .story h1 { font-size: 30px; }
  .card-lead h2 { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
}

/* Admin */
.admin { font-size: 15px; }
.admin-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-bar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.admin-bar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.admin-main { padding-top: 20px; padding-bottom: 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px; margin-bottom: 20px; }
.panel h1, .panel h2 { margin: 0 0 12px; font-size: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inline { display: inline; }
.btn { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--accent); }
.btn.small { font-size: 13px; padding: 4px 10px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: 4px; font: 15px/1.5 var(--sans); padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); }
textarea[name=body_md] { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.tip-form { display: grid; gap: 10px; }
.tip-form input, .tip-form textarea { margin: 0; }
.tip-form .btn { justify-self: start; }
.review .tag { margin-left: 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.login { max-width: 360px; margin: 60px auto; }
.list { width: 100%; border-collapse: collapse; }
.list td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.actions { text-align: right; }
.actions .inline, .actions .btn { margin-left: 4px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--accent); font-weight: 600; }
.notice { background: var(--surface); border-left: 4px solid var(--ok); padding: 10px 14px; border-radius: 4px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs a { padding: 4px 12px; border-radius: 14px; text-decoration: none; font-size: 13px; border: 1px solid var(--line); }
.tabs a.active { background: var(--text); color: var(--bg); }
.source-list { list-style: none; margin: 0 0 8px; padding: 0; }
.source-list li { padding: 6px 0; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--accent); }
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.checklist { padding-left: 20px; }
.prewrap { white-space: pre-wrap; }
@media (max-width: 860px) {
  .edit-layout { grid-template-columns: 1fr; }
  .list td.nowrap { white-space: normal; }
}
