:root {
  --bg: #fdfdfc;
  --fg: #1d1d1b;
  --muted: #6b6b66;
  --line: #e4e4e0;
  --accent: #2456d6;
  --field: #fff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --fg: #ececea; --muted: #9a9a94; --line: #2e2e2c; --accent: #7aa2ff; --field: #1f1f1e; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 44rem; padding: 2rem 1rem 4rem; background: var(--bg); color: var(--fg); font: 17px/1.6 system-ui, sans-serif; }
a { color: var(--accent); }
img, iframe { max-width: 100%; }
header { padding-bottom: 1.5rem; }
header nav { display: flex; gap: 1rem; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .8rem; cursor: pointer; }
button[type=submit] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
button:disabled { opacity: .5; }
input:not([type=checkbox]):not([type=file]), textarea { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .65rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#search { margin-bottom: 1.5rem; }
#composer, #edit-form { display: grid; gap: .75rem; margin-bottom: 5rem; }
#post-actions { margin-top: 2rem; }
#drop { display: grid; gap: .5rem; border-radius: 8px; }
#drop.over { outline: 2px dashed var(--accent); outline-offset: 4px; }
#attachments { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
#attachments:empty { display: none; }
#attachments img { height: 4rem; border-radius: 4px; display: block; }
#mainfile { margin: 0; }
.row { display: flex; gap: .75rem; align-items: center; }
.row input[type=file] { flex: 1; color: var(--muted); font-size: .9rem; }
#error { color: #c0392b; margin: 0; }
#error:empty { display: none; }
/* Posts are separated by whitespace only. */
#posts article { margin-bottom: 5rem; }
#posts h2 { font-size: 1.25rem; margin: .5rem 0 .25rem; }
#posts h2 a { color: var(--fg); text-decoration: none; }
#posts p { margin: .25rem 0; color: var(--muted); }
#posts img { display: block; border-radius: 4px; }
.pages { display: flex; justify-content: space-between; }
.post img { border-radius: 4px; }
.post pre { overflow-x: auto; }
.pdf { width: 100%; height: 80vh; border: 1px solid var(--line); }
#admin-posts { width: 100%; border-collapse: collapse; }
#admin-posts th, #admin-posts td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
#admin-posts time, #admin-posts small { color: var(--muted); font-size: .9rem; white-space: nowrap; }
@media (max-width: 30rem) { .row { flex-wrap: wrap; } }
