:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --text: #30332f;
  --muted: #747970;
  --line: #c9ccc3;
  --link: #3b5e67;
  --error: #984c42;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--text); }
button, input, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.page { width: min(100%, 940px); margin: auto; padding: 32px 24px 72px; }
.boardhead { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 28px; }
.boardtitle { font-size: 1rem; font-weight: 500; margin: 0; letter-spacing: .04em; }
.hint, .fileinfo, time, .empty { color: var(--muted); font-size: 11px; }
.hint { line-height: 1.7; }
.gate { min-height: 100svh; display: grid; place-items: center; padding: 24px 12px; }
.gate-art { font-family: monospace; font-size: clamp(7px, 2.6vw, 14px); line-height: 1.12; white-space: pre; margin: 0; letter-spacing: 0; }
.upload { border: 1px dashed var(--line); padding: 16px; margin: 24px 0 32px; }
.upload strong { font-weight: 500; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
input[type=file] { min-width: 0; max-width: 100%; font-size: 11px; }
input::file-selector-button { font: inherit; color: var(--text); border: 1px solid var(--line); padding: 4px 8px; background: transparent; cursor: pointer; }
textarea { display: block; width: 100%; min-height: 104px; resize: vertical; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 0; margin: 12px 0; }
textarea::placeholder { color: var(--muted); opacity: 1; }
button { cursor: pointer; border: 0; padding: 8px 0; min-height: 40px; background: transparent; color: var(--link); }
button:hover { text-decoration: underline; text-underline-offset: 3px; }
.error { font-size: 12px; color: var(--error); margin-bottom: 0; }
.error::before { content: "! "; }
.thread-summary { border-bottom: 1px solid var(--line); padding: 0 0 24px; margin-bottom: 24px; }
.post { padding: 8px 0 12px; overflow-wrap: anywhere; }
.posthead { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 11px; margin-bottom: 8px; }
.fileinfo { flex-basis: 100%; }
.anon { font-weight: 500; }
.postno { text-decoration: none; }
.thumbnail { display: inline-block; margin: 4px 0 8px; max-width: 100%; }
.thumbnail img { display: block; max-width: min(250px, 100%); max-height: 250px; height: auto; border: 1px solid var(--line); }
.comment { max-width: 74ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; font-size: 11px; color: var(--muted); margin: 8px 0 16px; }
.reply { margin: 12px 0 0 12px; border-left: 1px solid var(--line); padding: 8px 0 8px 16px; }
.post:target { outline: 1px dashed var(--link); outline-offset: 6px; }
#thread { margin-top: 24px; }
#more { margin: 24px 0; }
.empty { margin: 32px 0; }
.image-viewer { width: 100%; height: 100dvh; max-width: 100%; max-height: 100%; margin: 0; border: 0; padding: 16px; background: var(--bg); color: var(--text); }
.image-viewer::backdrop { background: var(--bg); }
.viewer-toolbar { margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.image-viewer > img { display: block; max-width: 100%; max-height: calc(100dvh - 100px); width: auto; height: auto; margin: auto; object-fit: contain; }
body:has(.image-viewer[open]) { overflow: hidden; }
@media (max-width: 560px) {
  .page { padding: 20px 16px 48px; }
  .upload { padding: 12px; }
  .reply { margin-left: 4px; padding-left: 12px; }
}
