:root {
  color-scheme: light;
  --paper: #f2f4f7;
  --ink: #273444;
  --muted: #64748b;
  --accent: #1767b1;
  --line: #dce2e9;
  --surface: #fff;
  --danger: #b3363d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 Baskerville, "Baskerville Old Face", Georgia, "Times New Roman", serif;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: #104b83; }
header { border-bottom: 1px solid #145b9c; background: var(--accent); color: white; }
.nav { max-width: 1120px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 32px; }
.brand { font-size: 25px; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
nav a { font-size: 14px; text-decoration: none; }
nav form { margin: 0; }
.username { font-size: 13px; color: var(--muted); }
main { max-width: 960px; margin: 36px auto 70px; padding: 0 32px; min-height: 60vh; }
h1, h2, h3 { line-height: 1.25; font-weight: 500; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: .25em 0 .6em; letter-spacing: 0; }
h2 { font-size: 1.55rem; }
.intro { padding: 6px 0 20px; }
.intro p { max-width: 680px; color: var(--muted); margin-top: 8px; }
.post-list { display: grid; gap: 20px; }
.summary { padding: 24px 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 2px 4px #1c365408; }
.summary h2 { margin: 9px 0 16px; }
.summary h2 a { text-decoration: none; }
.meta, .hint { font-size: 13px; color: var(--muted); }
.read { font-size: 13px; font-weight: 600; text-decoration: none; }
.pagination { justify-content: space-between; margin: 28px 0; }
main > article { padding: 30px 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.prose { overflow-wrap: anywhere; }
.prose img, .prose video { display: block; max-width: 100%; height: auto; margin: 24px auto; border-radius: 5px; }
.prose pre { overflow-x: auto; background: #f0f3f7; padding: 18px; border: 1px solid var(--line); border-radius: 5px; }
.prose code { font-size: .88em; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 8px 18px; margin-left: 0; background: #f3f7fc; color: #52647b; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 14px; }
.prose th { background: #eef3f9; }
.downloads, .attachments { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
input:not([type=checkbox]), textarea { display: block; width: 100%; font: inherit; padding: 10px 12px; background: var(--surface); border: 1px solid #aebccd; border-radius: 5px; margin-top: 6px; color: var(--ink); }
textarea { resize: vertical; font: 14px/1.7 ui-monospace, monospace; }
input[type=file] { font-size: 14px; }
.check { display: flex; gap: 9px; align-items: center; font-weight: normal; }
button, .button { display: inline-block; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: white; padding: 9px 16px; font: 600 14px/1.4 system-ui; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #115493; color: white; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: var(--surface); color: var(--accent); }
.danger { background: var(--danger); border-color: var(--danger); }
.link { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 400; }
.link:hover { background: none; color: var(--ink); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 20px 0; }
.actions form { margin: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; background: #e5edf7; color: #315c89; padding: 4px 9px; border-radius: 4px; }
.dashboard { display: grid; gap: 16px; }
.post-row { padding: 22px 26px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.post-row h2 { margin: 12px 0 8px; }
.post-row h2 a { text-decoration: none; }
.account { max-width: 480px; margin: 50px auto; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.account button { margin-top: 14px; }
.error { background: #fcebec; border-left: 3px solid var(--danger); padding: 16px; }
.empty { padding: 24px 0; color: var(--muted); }
.editor-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.preview { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 5px; margin: 24px 0; }
#attachment-list { padding: 0; list-style: none; }
#attachment-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); }
#attachment-list a { overflow-wrap: anywhere; }
#attachment-list button { padding: 5px 10px; font-size: 12px; }
footer { border-top: 1px solid var(--line); text-align: center; padding: 22px; color: var(--muted); font-size: 12px; background: #e9edf2; }
:focus-visible { outline: 3px solid #72a9df; outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  .nav { padding: 14px 18px; flex-direction: column; align-items: flex-start; gap: 12px; }
  nav { gap: 14px; }
  main { margin: 24px auto 48px; padding: 0 16px; }
  h2 { font-size: 1.35rem; }
  .summary, .post-row, main > article { padding: 20px; }
  .section-heading { flex-wrap: wrap; }
  .account { margin: 25px auto; padding: 22px; }
  .prose pre { padding: 12px; }
  .actions { gap: 10px; }
  button, .button { min-height: 42px; }
  textarea { font-size: 16px; }
  .preview { padding: 16px; }
}

nav, .meta, .hint, .read, .badge, label, input, button, .button, footer, .error, [role="status"] { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
input:not([type=checkbox]) { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; }

header a, header .link { color: #fff; }
header a:hover, header .link:hover { color: #fff; }
header nav a, header .link { display: inline-block; padding: 6px 11px; border: 1px solid #ffffff55; border-radius: 4px; }
header nav a:hover, header .link:hover { background: #ffffff18; }
header .username { color: #e4effa; }
header nav { gap: 10px; }
.post-heading { max-width: 960px; margin: auto; padding: 8px 32px 28px; }
.post-heading h1 { margin-top: 0; }
.post-heading .meta { color: #e4effa; margin-bottom: 0; }
@media (max-width: 600px) { .post-heading { padding: 10px 20px 24px; } }

.downloads summary { cursor: pointer; font-size: 1.3rem; }
.downloads summary .meta { margin-left: .25em; }

.post-options { border: 1px solid var(--line); border-radius: 5px; padding: 8px 16px; margin-top: 24px; }
.post-options legend { padding: 0 6px; }

header nav { min-width: 0; }
.username { max-width: 100%; overflow-wrap: anywhere; }
.meta { overflow-wrap: anywhere; }
