/* Self-hosted DejaVu Sans Mono Bold; license notice embedded in the font. */
@font-face {
  font-family: "Clanked Logo";
  src: url("/static/dejavu-sans-mono-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
/* Inter v20, self-hosted under SIL Open Font License 1.1. */
@font-face {
  font-family: "Inter";
  src: url("/static/inter-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/inter-latin-wght-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}
:root{font:15px/1.55 "Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}*{box-sizing:border-box}body{margin:0}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}a:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:4px}.top{max-width:1280px;margin:auto;padding:24px 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:16px}.brand{font:700 28px/1.1 "Clanked Logo",ui-monospace,monospace;letter-spacing:-1.5px;color:var(--ink)}.brand span{color:var(--accent)}.brand small{display:block;font:10px/1.5 ui-monospace,monospace;letter-spacing:2px;color:var(--muted);margin-top:4px}.top nav{display:flex;align-items:center;gap:24px;font-size:13px}.top nav form{margin:0}.link{border:0;background:none;color:var(--accent);padding:0;font:inherit}main{max-width:1216px;margin:0 auto;padding:36px 32px;min-height:70vh}h1,h2,h3{line-height:1.2;letter-spacing:-.03em}h1{font-size:clamp(28px,4vw,42px);margin:10px 0 16px}h2{font-size:20px;margin:0 0 16px}p{margin:0 0 16px}.intro{padding:42px 0 54px;max-width:850px}.intro p,.board-heading p{color:var(--muted);font-size:16px}.eyebrow{font:11px/1.5 ui-monospace,monospace;letter-spacing:1.6px;color:var(--accent);font-weight:700}.section-title{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:20px}.section-title h2{margin:0}.section-title span{font-size:12px;color:var(--muted)}.board-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px}.board-card{display:block;padding:28px;background:var(--paper);border:1px solid var(--line);border-radius:8px;color:var(--ink)}.board-card:hover{border-color:var(--accent);text-decoration:none}.board-slug{font:26px ui-monospace,monospace;color:var(--accent);display:block;margin-bottom:24px}.board-card p{color:var(--muted);min-height:50px}.arrow{font-size:13px;color:var(--accent)}.board-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:12px 0 30px}.panel{background:var(--paper);border:1px solid var(--line);border-radius:8px;padding:24px;margin-bottom:24px}.compose{max-width:740px;margin:0 0 36px}.compose summary{font-weight:600;cursor:pointer}.fields{margin-top:22px}label{display:block;font-size:13px;font-weight:600;margin:14px 0}label span{font-weight:400;color:var(--muted);margin-left:8px}input:not([type=checkbox]),textarea{display:block;width:100%;border:1px solid var(--input-border);border-radius:4px;background:var(--input-bg);padding:10px;margin-top:6px;font-family:inherit;font-size:14px;line-height:1.5;color:var(--input-fg)}textarea{resize:vertical;min-height:90px}input[type=file]{background:var(--wash);border-style:dashed}.check{display:flex;align-items:center;gap:8px}.check input{width:auto}button,.button{display:inline-block;background:var(--button-bg);color:var(--button-fg);border:1px solid var(--button-border);border-radius:4px;padding:9px 16px;cursor:pointer;font:600 13px/1.4 "Inter",system-ui}.button:hover{text-decoration:none}.outline{background:var(--paper);color:var(--accent)}.danger{background:var(--danger-bg);color:var(--danger-fg);border-color:var(--danger)}button.link{background:none;color:var(--accent);padding:0}.thread-preview{margin-bottom:28px;background:var(--paper);border:1px solid var(--line);border-radius:8px;overflow:hidden}.thread-heading{display:flex;align-items:center;justify-content:space-between;padding:18px 22px 0;gap:12px}.thread-heading h2{margin:0}.badge{display:inline-block;background:var(--wash);color:var(--accent);border:1px solid var(--line);border-radius:3px;padding:2px 7px;font:11px ui-monospace,monospace}.post{display:flow-root;background:var(--wash);margin:12px 22px;padding:18px;border:1px solid var(--line);border-radius:5px;overflow-wrap:anywhere}.post-meta{display:flex;gap:14px;align-items:center;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-bottom:12px}.post-meta strong{color:var(--accent);font-size:12px}.manage-link{margin-left:auto}.attachment{float:left;display:block;margin:0 22px 12px 0;max-width:250px}.attachment img{display:block;max-width:100%;height:auto;border-radius:3px}.attachment span{font:10px ui-monospace,monospace;color:var(--muted);display:block;margin-top:6px}.body{white-space:pre-wrap;line-height:1.6;min-height:32px;overflow-wrap:anywhere}.thread-open{display:block;font-size:13px;border-top:1px solid var(--line);padding:14px 22px}.thread-open span{color:var(--muted);margin-left:12px}.thread-posts{margin-bottom:28px}.thread-posts .post{margin-left:0;margin-right:0}.pagination{display:flex;gap:22px;justify-content:center;margin:26px;font-size:13px}.muted{font-size:12px;color:var(--muted)}.login{max-width:480px;margin:40px auto}.two-column{display:grid;grid-template-columns:1fr 1fr;gap:24px}.report{border-top:1px solid var(--line);padding:20px 0}.report:first-of-type{margin-top:20px}.report form{max-width:580px}.report blockquote{margin:12px 0;padding:12px 16px;border-left:3px solid var(--line);background:var(--wash);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;max-height:200px;overflow:auto}.empty{padding:20px 0;color:var(--muted)}details{margin:12px 0}details summary{cursor:pointer}hr{border:0;border-top:1px solid var(--line);margin:24px 0}.staff-panel{max-width:740px}.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px;text-align:left}td,th{border-bottom:1px solid var(--line);padding:12px 10px;vertical-align:top;overflow-wrap:anywhere}th{color:var(--muted)}footer{max-width:1216px;margin:20px auto 0;padding:28px 32px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}footer span{font-size:10px}code{font-size:12px}@media(max-width:640px){.top{padding:18px}.top nav{gap:14px;font-size:12px}main{padding:24px 16px}.intro{padding:24px 0 40px}.board-heading{align-items:flex-start;flex-direction:column}.post{margin:10px;padding:14px}.attachment{float:none;max-width:220px;margin-bottom:16px}.two-column{grid-template-columns:1fr;gap:0}.post-meta{gap:8px}.manage-link{margin-left:0}.thread-heading{padding:14px}.section-title span{display:none}.panel{padding:20px}.top .brand small{font-size:8px}td,th{padding:10px 6px}}


/* Mobile-first imageboard layout; visual presentation is theme-driven. */
.top {
  max-width: none;
  margin: 0;
  padding: 10px 12px;
  gap: 12px;
  background: var(--paper);
}
.top .brand { font-size: 20px; white-space: nowrap; }
.top .brand small { display: none; }
.top nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

main.page-board,
main.page-thread {
  max-width: none;
  margin: 0;
  padding: 12px 10px 36px;
}
main.page-thread { padding-bottom: 88px; }
.page-board .board-heading { margin: 0 0 16px; }
/* Index posts are standalone articles, not cards nested in a thread panel. */
.page-board .board-index-post {
  width: fit-content;
  min-width: min(100%, 22rem);
  max-width: min(100%, calc(80ch + 300px));
  margin: 0;
  padding: 12px;
}
/* OPs sit directly on the page, like a traditional imageboard opening post.
 * Only replies retain the colored, bordered article box. */
.page-board .board-index-post.post-op {
  width: 100%;
  min-width: 0;
  max-width: min(100%, calc(80ch + 300px));
  padding: 0 0 8px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.page-board .board-index-post.thread-preview { overflow: visible; }
/* A single uninterrupted stack of post articles, divided only by threads. */
.page-board .board-thread-divider {
  width: 100%;
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.page-board .thread-heading {
  padding: 0;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.page-board .thread-heading h2 { font-size: 13px; letter-spacing: 0; }
.page-board .thread-heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.page-board .thread-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
}
.page-board .thread-open span { margin-left: 0; font-weight: 400; }
.page-board .thread-open .icon { width: 13px; height: 13px; }

.post { overflow-wrap: anywhere; }
.post-meta { gap: 10px; font-size: 12px; margin-bottom: 8px; }
/* The thread subject appears on the OP identity row, before Anonymous/staff. */
.post-meta .post-subject {
  color: var(--modus-gold, var(--ink));
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.post-meta a.post-number { white-space: nowrap; }
.post-content { display: block; }
.post .attachment {
  float: none;
  display: block;
  width: max-content;
  max-width: min(100%, 320px);
  margin: 0 0 12px;
}
.post .attachment img { max-width: 100%; height: auto; }
.post .attachment-file {
  flex: 0 0 auto;
  width: max-content;
  max-width: min(100%, 320px);
  margin: 0 0 12px;
}
.post .attachment-file > .attachment { max-width: 100%; margin: 0; }
.post .attachment-file:has(> .attachment.expanded) { flex: 0 1 auto; max-width: 100%; }
.attachment-caption {
  display: block;
  margin-top: 6px;
  font: 10px ui-monospace,monospace;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.filename-download-link { font: inherit; text-decoration: underline; }
.post .body {
  /* Keep all public post text near the 80-character reading measure. */
  max-width: 80ch;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.page-thread .thread-posts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}
.page-thread .thread-posts .post {
  flex: none;
  width: fit-content;
  min-width: min(100%, 19rem);
  max-width: min(100%, calc(80ch + 300px));
  margin: 0;
  padding: 12px;
}
/* Thread OPs have no reply-style rim or inset background. */
.page-thread .thread-posts .post.post-op {
  width: 100%;
  min-width: 0;
  max-width: min(100%, calc(80ch + 300px));
  margin: 0;
  padding: 0 0 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}


/* Native details keeps the single reply form usable without JavaScript. */
.reply-widget {
  position: fixed;
  z-index: 40;
  inset-inline: 0;
  bottom: var(--keyboard-offset, 0px);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  background: var(--paper);
  box-shadow: 0 -4px 18px #0002;
  max-height: calc(100dvh - var(--keyboard-offset, 0px) - 8px);
  overflow: hidden;
}
.reply-widget[open] { display: flex; flex-direction: column-reverse; }
.reply-widget > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}
.reply-widget > summary::-webkit-details-marker { display: none; }
.reply-widget[open] > summary { border-top: 1px solid var(--line); }
.reply-widget > form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px;
}
.reply-widget > form label { margin: 6px 0; }
.reply-widget > form textarea { margin: 5px 0 12px; min-height: 108px; }
.reply-widget > form input[type=file] { margin: 5px 0 12px; }
.reply-widget > form .check { margin: 12px 0; }
.reply-widget > form button[type=submit] { width: 100%; }
.reply-action { display: none; }

@media (min-width: 768px) {
  :root { --toolbar-height: 46px; }
  .top {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toolbar-height);
    padding: 5px 12px;
  }
  .top .brand { font-size: 18px; }
  main { padding-top: calc(var(--toolbar-height) + 20px); }
  main.page-board, main.page-thread {
    padding: calc(var(--toolbar-height) + 16px) 12px 40px;
  }
  .post-content { display: flex; align-items: flex-start; gap: 16px; }
  .post .attachment { flex: 0 0 auto; max-width: 260px; margin: 0; }
  .post .attachment-file { max-width: 260px; margin: 0; }
  .post .body { flex: 1 1 auto; }
  .reply-action { display: inline-block; }
  .reply-widget {
    inset-inline: auto 12px;
    top: calc(var(--toolbar-height) + 12px);
    bottom: auto;
    width: min(380px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--toolbar-height) - 24px);
    border-radius: 6px;
    box-shadow: 0 6px 22px #0002;
  }
  .reply-widget[open] { flex-direction: column; }
  .reply-widget[open] > summary { border-top: 0; border-bottom: 1px solid var(--line); }
  .reply-widget > summary { min-height: 38px; padding: 7px 12px; }
  .reply-widget > form { padding: 10px 12px; }
  html.has-js .reply-widget:not([open]) { display: none; }
  /* Without JS, retain a usable reply form in document flow. */
  html:not(.has-js) .reply-widget { position: static; width: min(100%, 600px); margin-top: 16px; }
}


/* Index and catalog navigation: compact imageboard controls. */
.new-thread {
  width: min(100%, 520px);
  margin: 10px auto 20px;
}
.new-thread > summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--wash);
  color: var(--accent);
}
.new-thread > summary::-webkit-details-marker { display: none; }
.new-thread > form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 12px 18px 18px;
}
.new-thread .fields { margin-top: 0; }

.board-views {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.board-views > :is(a, span),
.thread-controls > :is(a, button) {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--accent);
  font: inherit;
  text-decoration: none;
}
.board-views > [aria-current="page"] {
  background: var(--wash);
  color: var(--ink);
  font-weight: 700;
}
.board-views a:hover,
.thread-controls a:hover { text-decoration: underline; }

.thread-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 0;
  margin: 18px 0 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.thread-controls-top {
  margin: 12px 0 16px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) {
  #thread-bottom { scroll-margin-top: calc(var(--toolbar-height, 46px) + 12px); }
}
.thread-controls > button { cursor: pointer; }
.thread-controls > button:disabled { opacity: .5; cursor: default; }
.thread-controls [data-expand-images] { display: none; }
html.has-js .thread-controls [data-expand-images] { display: inline-block; }

.page-thread .thread-posts .post.images-expanded { max-width: 100%; }
.page-thread .thread-posts .post.images-expanded .post-content { flex-wrap: wrap; }
.page-thread .thread-posts .post .attachment.expanded {
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
}
.page-thread .thread-posts .post .attachment.expanded img {
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 64px));
}

/* One image and opening-text excerpt per thread, paginated at 100. */
main.page-catalog {
  max-width: none;
  margin: 0;
  padding: 12px 10px 36px;
}
.page-catalog .catalog-heading { margin: 0 0 14px; }
.page-catalog .catalog-heading h1 { font-size: clamp(22px, 4vw, 30px); }
/* Keep every thumbnail inside a fixed-height slot. The old CSS used a
 * grid with an img sized to 100% height: the implicit grid row could grow
 * to the image's min-content size while its parent stayed 152px high.
 * That let tall thumbnails paint over the title, actions and excerpt. */
.catalog-scroll { margin: 24px 0; text-align: center; }
.catalog-scroll p { margin-bottom: 10px; }
.catalog-scroll [hidden] { display: none; }
.catalog-scroll [aria-disabled="true"] { opacity: .65; cursor: progress; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
  justify-items: center;
  align-items: start;
  gap: 14px 12px;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  max-width: 212px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.catalog-card:hover { border-color: var(--accent); }
.catalog-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-decoration: none;
}
.catalog-image {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 152px;
  width: 100%;
  height: 152px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0 0 8px;
}
.catalog-image img {
  display: block;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.catalog-image-empty {
  background: var(--wash);
  color: var(--muted);
  font-size: 12px;
}
.catalog-count {
  display: block;
  width: 100%;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.catalog-subject {
  display: block;
  width: 100%;
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: center;
}
.catalog-card .watch-card-actions { justify-content: center; }
.catalog-excerpt {
  width: 100%;
  min-width: 0;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
  line-clamp: 10;
  max-height: 14.5em;
}
.catalog-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 7px;
}
/* Like vi-chan's mobile catalog, favor one modest-sized, centered tile
 * per row rather than stretching a portrait image to the phone width. */
@media (max-width: 560px) {
  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .catalog-card {
    width: min(100%, 226px);
    max-width: 226px;
    padding: 8px;
    background: transparent;
    border-color: transparent;
  }
  .catalog-image {
    height: 148px;
    flex-basis: 148px;
  }
  .catalog-excerpt {
    -webkit-line-clamp: 8;
    line-clamp: 8;
    max-height: 11.6em;
  }
}

@media (min-width: 768px) {
  main.page-catalog { padding: calc(var(--toolbar-height) + 16px) 12px 40px; }
}


/* Shared, extensible Settings disclosure (independent of the active theme). */
.top { position: relative; }
.top .site-settings { position: relative; margin: 0; font-size: 13px; }
.top .site-settings > summary {
  list-style: none;
  white-space: nowrap;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.top .site-settings > summary::-webkit-details-marker { display: none; }
.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: min(310px, calc(100vw - 24px));
  max-height: calc(100dvh - 76px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 5px 22px #0005;
  font-size: 13px;
}
.settings-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.settings-group legend { font-weight: 700; margin-bottom: 8px; }
.settings-group label { margin: 0 0 4px; }
.settings-group select {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 8px;
  color: var(--input-fg);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 3px;
  font: inherit;
}
.settings-help { color: var(--muted); font-size: 12px; margin: 9px 0 0; }
.settings-group + .settings-group {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}
.settings-group select:focus-visible,
.site-settings summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Without JavaScript the native OS theme remains usable; hide an inert picker. */
html:not(.theme-ready) .site-settings { display: none; }
@media (max-width: 767px) {
  .top { flex-wrap: wrap; }
  .top nav { min-width: 0; }
  .settings-panel { max-height: calc(100dvh - 20px); }
}
@media (min-width: 768px) {
  .top { position: fixed; }
}


/* Persistent board navigation: every page shows the same active board list.
 * The active board is explicitly marked, and all board links open catalogs.
 * Horizontal scrolling prevents a large number of boards from obscuring
 * staff and settings controls inside the fixed desktop toolbar.
 */
.top { min-width: 0; }
.top .top-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 10px;
}
.top .home-link { flex: 0 0 auto; white-space: nowrap; }
.top-board-list {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  gap: 5px;
  padding: 3px 0;
}
.top .top-board {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}
.top .top-board:hover { text-decoration: underline; }
.top .top-board.is-active {
  border-color: var(--accent);
  background: var(--wash);
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.top-actions > form { margin: 0; }
@media (max-width: 767px) {
  .top { padding: 8px 10px; gap: 6px; }
  .top .top-nav { flex: 1 1 100%; flex-wrap: wrap; gap: 6px 10px; }
  .top .top-actions { margin-left: auto; }
  .top-board-list {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    padding: 4px 0;
  }
}
@media (min-width: 768px) {
  .top { height: var(--toolbar-height); }
  .top .top-nav { flex-wrap: nowrap; }
}


/* Keep signed-in staff actions centered over the page, aligned with the
 * site's centered banner, independently of board links and user settings.
 * This only changes presentation: staff auth and CSRF remain server-side. */
.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "site utilities";
  align-items: center;
}
.top.is-staff {
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  grid-template-areas: "site staff utilities";
}
.top-site-navigation {
  grid-area: site;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.top .top-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}
.top-actions {
  grid-area: utilities;
  justify-self: end;
  margin-left: 0;
  gap: 10px;
}
.staff-cluster {
  --staff-bg: #fce83a;
  --staff-fg: #000;
  grid-area: staff;
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 5px;
  white-space: nowrap;
}
.staff-cluster-moderator {
  --staff-bg: #c8102e;
  --staff-fg: #fff;
}
.staff-cluster > form { display: flex; margin: 0; }
.staff-cluster .staff-username,
.staff-cluster .staff-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 4px 10px;
  border: 1px solid var(--staff-bg);
  border-radius: 3px;
  background: var(--staff-bg);
  color: var(--staff-fg);
  font: 600 12px/1.35 "Inter",system-ui, sans-serif;
  white-space: nowrap;
}
.staff-cluster .staff-username {
  display: block;
  min-width: 0;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  cursor: default;
}
.staff-cluster .staff-action:hover {
  filter: brightness(.9);
  text-decoration: none;
}
@media (max-width: 767px) {
  /* On narrow screens, the controls get a centered row instead of
   * overlapping board navigation or the Watched/Settings menus. */
  .top,
  .top.is-staff {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand utilities" "boards boards";
  }
  .top.is-staff {
    grid-template-areas: "brand utilities" "boards boards" "staff staff";
  }
  .top-site-navigation { display: contents; }
  .top .brand { grid-area: brand; }
  .top .top-nav {
    grid-area: boards;
    flex: none;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
  }
  .top .top-board-list {
    order: 0;
    flex-basis: auto;
    width: auto;
    min-width: 0;
    padding: 4px 0;
  }
  .top .top-actions { grid-area: utilities; margin-left: 0; gap: 6px; }
  .staff-cluster { grid-area: staff; max-width: 100%; margin-top: 2px; }
}
@media (max-width: 360px) {
  .staff-cluster .staff-username,
  .staff-cluster .staff-action { padding: 4px 6px; font-size: 11px; }
}

/* Threadwatcher: semantic palette roles, compact imageboard controls. */
.top .watch-menu {
  margin: 0;
  position: relative;
  flex: 0 0 auto;
  font-size: 13px;
}
.top .watch-menu > summary {
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  padding: 4px 7px;
  font-weight: 600;
}
.top .watch-menu > summary::-webkit-details-marker { display: none; }
.watch-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: min(390px, calc(100vw - 24px));
  max-height: min(75dvh, 600px);
  padding: .6em;
  background: var(--wash);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px;
  overflow-y: auto;
  box-shadow: 0 5px 22px #0005;
  white-space: normal;
  font-size: .875rem;
  line-height: 1.3;
}
.watch-panel > strong { display: block; margin-bottom: 8px; }
.watch-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.watch-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  gap: .35em;
  padding: .2em 0;
  border-top: 1px solid var(--line);
}
.watch-row-link {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
  font-weight: 400;
}
.watch-row.has-unread .watch-row-link { font-weight: 700; }
.watch-flag {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: .85em;
  color: var(--muted);
}
.watch-row-action {
  flex: 0 0 auto;
  border-radius: 2px;
  padding: .14em .3em;
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--line);
  font-size: .85em;
}
.watch-row-remove {
  display: inline-grid;
  place-items: center;
  flex: 0 0 1.85em;
  width: 1.85em;
  height: 1.85em;
  padding: .2em;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--accent);
}
.watch-row-remove .icon { width: 1em; height: 1em; }
.watch-row-remove:hover { background: var(--wash); }
.watch-row-action:hover, .watch-toggle:hover, .watch-row-link:hover { text-decoration: underline; }
.watch-unread {
  display: inline-block;
  color: var(--ink);
  background: var(--wash);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 2px 6px;
  font: 700 12px/1.35 ui-monospace, monospace;
}
.watch-archived {
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.watch-archived > summary { color: var(--accent); font-weight: 600; }
#watch-connection { margin: 8px 0 0; }
#watch-total { font-weight: 800; }
.watch-toggle {
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--line);
  font-size: 12px;
  border-radius: 2px;
  padding: 4px 8px;
  white-space: nowrap;
}
.watch-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--wash);
  color: var(--ink);
  font-weight: 700;
}
.watch-toggle:disabled { opacity: .65; cursor: wait; }
.watch-card-actions {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.thread-heading > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
 
#watch-push-toggle {
  background: var(--button-bg);
  color: var(--button-fg);
  margin-top: 9px;
}
#watch-push-toggle:disabled { opacity: .65; cursor: not-allowed; }
.watch-menu > summary:focus-visible,
.watch-toggle:focus-visible,
.watch-row-action:focus-visible,
.watch-row-remove:focus-visible,
.watch-refresh:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
@media (max-width: 767px) {
  .watch-panel {
    position: fixed;
    top: 80px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - 95px);
  }
  .watch-row-action, .watch-toggle { min-height: 34px; }
  .watch-row-remove { flex-basis: 34px; width: 34px; height: 34px; }
  .watch-refresh, .watch-close { flex-basis: 38px; min-width: 38px; min-height: 38px; }
  .watch-drag-handle { min-height: 38px; }
}


/* The watchlist is a persistent floating utility window, not a dropdown.
 * Its position and visibility are restored from browser-local storage. */
.top .watch-menu .watch-panel {
  position: fixed;
  top: 60px;
  right: 12px;
  left: auto;
  width: min(390px, calc(100vw - 24px));
  height: min(48dvh, 400px);
  min-height: 180px;
  max-height: min(76dvh, 620px);
  resize: vertical;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 80;
}
.watch-panel-header {
  position: sticky;
  top: -.6em;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35em;
  margin: -.6em -.6em .4em;
  padding: .22em .5em;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.watch-collapse, .watch-drag-handle {
  min-width: 0;
  border: 0;
  border-radius: 2px;
  padding: .22em .3em;
  min-height: 1.9em;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font: inherit;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}
.watch-drag-handle { flex: 0 0 auto; cursor: grab; touch-action: none; }
.watch-collapse {
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35em;
  cursor: pointer;
  touch-action: manipulation;
}
.watch-collapse[aria-expanded="true"] .menu-chevron { transform: rotate(180deg); }
.top .watch-menu .watch-panel[data-collapsed="true"] {
  height: auto !important;
  min-height: 0;
  padding-bottom: 0;
  resize: none;
  overflow: hidden;
}
.watch-panel[data-collapsed="true"] .watch-panel-header { margin-bottom: 0; border-bottom: 0; }
.watch-drag-handle:active { cursor: grabbing; }
.watch-refresh, .watch-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 1.9em;
  width: 1.9em;
  height: 1.9em;
  padding: .24em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: inherit;
  line-height: 1;
}
.watch-close { font-size: inherit; }
.watch-refresh .icon { width: 1em; height: 1em; }
.watch-refresh:disabled { cursor: progress; }
.watch-refresh[aria-busy="true"] .icon { animation: watch-refresh-spin 800ms linear infinite; }
@keyframes watch-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .watch-refresh[aria-busy="true"] .icon { animation: none; }
}
.watch-drag-handle:focus-visible, .watch-collapse:focus-visible, .watch-close:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
@media (max-width: 767px) {
  .top .watch-menu .watch-panel {
    top: 88px;
    width: min(390px, calc(100vw - 24px));
    max-height: calc(100dvh - 102px);
  }
}

/* Five-second live thread refresh: unobtrusive status/timer at the bottom.
 * Only show the indicator when its JS is actually running. */
.thread-refresh { display: none; }
html.thread-updates-ready .thread-refresh {
  position: fixed;
  z-index: 25;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(510px, calc(100vw - 20px));
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 2px 8px #0003;
  pointer-events: none;
}
.thread-refresh-countdown {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 767px) {
  html.thread-updates-ready .thread-refresh {
    bottom: calc(57px + env(safe-area-inset-bottom));
    left: 8px;
    max-width: calc(100vw - 16px);
    font-size: 11px;
  }
}


/* Self-hosted Lucide glyphs use SVG geometry rather than fonts or Unicode.
 * This keeps control icons identical across browsers, OSes and themes.
 */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
  pointer-events: none;
}
.top .site-settings > summary,
.top .watch-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.menu-chevron { margin-left: 1px; transition: transform 120ms ease; }
.site-settings[open] > summary .menu-chevron,
.watch-menu[open] > summary .menu-chevron,
.watch-archived[open] > summary .menu-chevron {
  transform: rotate(180deg);
}
.top .top-board.is-active { gap: 3px; }
.watch-drag-handle { display: inline-flex; align-items: center; gap: 6px; }
.watch-close { display: inline-grid; place-items: center; }
.watch-close .icon { width: 1em; height: 1em; }
.watch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.watch-toggle[aria-pressed="true"] .icon { fill: currentColor; }
.watch-archived > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.thread-controls > :is(a,button),
.thread-open,
.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pagination a .icon, .arrow .icon { width: .95em; height: .95em; }

/* Unified native posting form, shared between new threads and replies.
 * Both views use the same grid, controls and submit button.
 */
.posting-widget {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.posting-widget > summary,
.new-thread.posting-widget > summary,
.reply-widget.posting-widget > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--wash);
  border: 0;
  border-radius: 3px 3px 0 0;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
}
.posting-widget > summary::-webkit-details-marker { display: none; }
.posting-widget .posting-chevron {
  flex: 0 0 auto;
  transition: transform 120ms ease;
}
.posting-widget[open] .posting-chevron { transform: rotate(180deg); }
.posting-handle-copy { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.posting-target { color: var(--accent); font-size: 12px; font-weight: 600; }
.posting-widget > form,
.new-thread.posting-widget > form,
.reply-widget.posting-widget > form {
  margin: 0;
  padding: 12px 14px 14px;
  background: var(--paper);
  border: 0;
  border-top: 1px solid var(--line);
}
.posting-fields {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.posting-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}
.posting-row > label:not(.check),
.posting-row-label {
  display: block;
  margin: 0;
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.posting-row > :is(input,textarea) {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--input-border);
  border-radius: 2px;
  background: var(--input-bg);
  color: var(--input-fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.posting-row > textarea {
  min-height: 96px;
  max-height: min(45dvh, 300px);
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
}
/* The actual file input stays native, keyboard reachable and submitted through
   FormData. The custom label is its visible, clickable drop target. */
.posting-file-control {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 6px;
  border: 1px dashed var(--input-border);
  border-radius: 3px;
  background: var(--wash);
  transition: background 120ms ease, border-color 120ms ease;
}
.posting-file-control.is-drag-over {
  border: 2px dashed var(--accent);
  padding: 5px;
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
}
.posting-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.posting-file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--paper);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.posting-file-picker .icon { width: 14px; height: 14px; flex: none; }
.posting-file-picker:hover { background: var(--input-bg); }
.posting-file-input:focus-visible + .posting-file-picker {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.posting-file-preview {
  display: flex;
  flex: 1 1 110px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.posting-file-preview[hidden], .posting-file-thumbnail[hidden],
.posting-file-error[hidden] { display: none; }
.posting-file-thumbnail {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 2px;
  object-fit: cover;
  background: var(--paper);
}
.posting-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.posting-file-clear {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 27px;
  height: 27px;
  min-height: 27px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--danger);
}
.posting-file-clear .icon { width: 14px; height: 14px; }
.posting-file-error {
  flex-basis: 100%;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.posting-options-row .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  font-size: 12px;
  font-weight: 400;
}
.posting-options-row input[type="checkbox"] { min-width: 24px; min-height: 24px; margin: 0; }
.posting-submit-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  margin: 0;
  padding: 7px 12px;
  border-radius: 3px;
}
.posting-note { margin: 0 0 0 94px; font-size: 11px; }
.new-thread.posting-widget {
  max-width: 520px;
  width: min(100%, 520px);
  margin: 10px auto 18px;
  overflow: hidden;
}
.posting-slot { position: relative; }
.posting-widget .posting-close { display: none; }

@media (min-width: 768px) {
  .page-thread .posting-slot {
    width: min(100%, 520px);
    max-width: 520px;
    margin: 10px auto 22px;
  }
  .page-thread .posting-widget.reply-widget {
    display: block;
    position: relative;
    z-index: 1;
    inset: auto;
    width: 100%;
    max-height: none;
    margin: 0;
    border-radius: 4px;
    box-shadow: none;
    overflow: visible;
  }
  .page-thread .posting-widget.reply-widget[open] { display: block; }
  .page-thread .posting-widget.reply-widget > summary {
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    cursor: default;
  }
  /* Reply remains open on desktop; only mobile uses the disclosure chevron. */
  .page-thread .posting-widget.reply-widget .posting-chevron { display: none; }
  .page-thread .posting-widget.reply-widget > form {
    overflow: visible;
    padding: 12px 14px 14px;
  }
  .page-thread .posting-widget.reply-widget.is-detached {
    display: block;
    position: fixed;
    z-index: 85;
    top: calc(var(--toolbar-height, 46px) + 12px);
    right: 14px;
    left: auto;
    bottom: auto;
    width: min(425px, calc(100vw - 28px));
    max-height: calc(100dvh - var(--toolbar-height, 46px) - 28px);
    border-radius: 4px;
    box-shadow: 0 7px 26px #0006;
    overflow: hidden;
  }
  .page-thread .posting-widget.reply-widget.is-detached[open] { display: flex; flex-direction: column; }
  .page-thread .posting-widget.reply-widget.is-detached > form {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    max-height: calc(100dvh - var(--toolbar-height, 46px) - 75px);
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-handle {
    padding-right: 44px;
    cursor: grab;
    user-select: none;
    touch-action: none;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-handle:active {
    cursor: grabbing;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-close {
    position: absolute;
    z-index: 3;
    display: inline-grid;
    place-items: center;
    top: 5px;
    right: 5px;
    width: 29px;
    height: 29px;
    min-height: 29px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--accent);
    background: var(--paper);
  }
  .page-thread .posting-widget.reply-widget.is-detached.is-dismissed,
  html.has-js .page-thread .posting-widget.reply-widget.is-detached.is-dismissed {
    display: none !important;
  }

  /* The entire floating window is the resize target. Resizing its bottom-right
   * corner grows the textarea in both directions; rows never drift apart. */
  .page-thread .posting-widget.reply-widget.is-detached {
    width: min(27em, calc(100vw - 2em));
    height: auto;
    min-width: min(19em, calc(100vw - 1em));
    max-width: min(70em, calc(100vw - 1em));
    min-height: 14em;
    max-height: calc(100dvh - var(--toolbar-height, 46px) - 1em);
    resize: both;
    overflow: hidden;
    font-size: .875rem;
    line-height: 1.2;
  }
  .page-thread .posting-widget.reply-widget.is-detached > summary {
    flex: 0 0 auto;
    min-height: 1.9em;
    padding: .2em 2.35em .2em .5em;
    font-size: 1em;
    line-height: 1.2;
    gap: .35em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-handle {
    padding-right: 2.35em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-target {
    font-size: .9em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-close {
    top: .16em;
    right: .16em;
    width: max(24px, 1.6em);
    height: max(24px, 1.6em);
    min-height: 24px;
    padding: .14em;
    color: inherit;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-close .icon {
    width: 1em;
    height: 1em;
  }
  .page-thread .posting-widget.reply-widget.is-detached > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: .3em;
    margin: 0;
    overflow: auto;
    max-height: none;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-fields {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(6em, 1fr) auto;
    align-items: stretch;
    gap: .2em .35em;
    font-size: 1em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-row {
    display: block;
    min-width: 0;
    margin: 0;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-row > label:not(.check) {
    /* Keep the programmatic input label while using the field's placeholder
       or native file selector as its only visible label. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-row-label {
    display: none;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-identity-row {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: center;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-sage-row {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-comment-row {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 0;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-row {
    grid-column: 1;
    grid-row: 4;
    min-width: 0;
    overflow: hidden;
    align-self: center;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-submit-row {
    grid-column: 2;
    grid-row: 4;
    align-self: center;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-identity-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-identity-choice > .muted {
    display: none;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-options-row .check {
    margin: 0;
    padding: 0;
    gap: .3em;
    font-size: .88em;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-options-row input[type="checkbox"] {
    width: 1em;
    height: 1em;
    margin: 0;
    flex: 0 0 auto;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-identity-choice .staff-identity {
    margin: 0;
    padding: .05em .2em;
    font-size: .85em;
    line-height: 1.3;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-row > textarea {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 6em;
    max-height: none;
    margin: 0;
    padding: .3em .4em;
    font-size: 1em;
    line-height: 1.2;
    resize: none;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-control {
    flex-wrap: nowrap;
    gap: .25em;
    min-height: 2em;
    padding: .12em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-picker {
    flex: none;
    min-height: 1.7em;
    padding: .15em .35em;
    border-color: var(--line);
    font: inherit;
    line-height: 1.15;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-picker [data-file-prompt] {
    display: none;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-preview {
    flex: 1 1 auto;
    gap: .2em;
    overflow: hidden;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-thumbnail {
    width: 1.7em;
    height: 1.7em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-name {
    font-size: .85em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-clear {
    width: 1.7em;
    height: 1.7em;
    min-height: 1.7em;
    padding: .2em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-error {
    font-size: .85em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-file-control:has(.posting-file-error:not([hidden])) {
    flex-wrap: wrap;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-submit-row button[type="submit"] {
    width: auto;
    min-height: 1.9em;
    margin: 0;
    padding: .18em .6em;
    gap: .35em;
    border-radius: 2px;
    font: inherit;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-submit-row .icon {
    width: 1em;
    height: 1em;
  }
  .page-thread .posting-widget.reply-widget.is-detached .posting-feedback {
    grid-column: 1 / -1;
    grid-row: 5;
    margin: 0;
    padding: .35em .5em;
  }
}

@media (max-width: 767px) {
  .page-thread .posting-slot {
    height: 0;
    min-height: 0;
    margin: 0;
  }
  .page-thread .posting-widget.reply-widget {
    /* Retain the existing expandable bottom sheet on mobile. */
    position: fixed;
    z-index: 40;
    inset-inline: 0;
    top: auto;
    bottom: var(--keyboard-offset, 0px);
    width: 100%;
    max-height: calc(100dvh - var(--keyboard-offset, 0px) - 8px);
    margin: 0;
    border-radius: 9px 9px 0 0;
    overflow: hidden;
  }
  .page-thread .posting-widget.reply-widget[open] {
    display: flex;
    flex-direction: column-reverse;
  }
  .page-thread .posting-widget.reply-widget > summary {
    min-height: 48px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }
  .page-thread .posting-widget.reply-widget > form {
    padding: 10px 14px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    border-top: 0;
  }
  .posting-row { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .posting-row > label:not(.check), .posting-row-label { padding: 0; }
  .posting-submit-row > .posting-row-label { display: none; }
  .posting-submit-row button { width: 100%; }
  .posting-note { margin-left: 0; }
  .posting-row > :is(input,textarea) { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .posting-widget .posting-chevron, .menu-chevron { transition: none; }
}


/* Rotating site banners retain the 3:1 aspect ratio at all viewport sizes. */
.site-banner { display: flex; justify-content: center; margin: 0 auto 22px; }
.site-banner-refresh {
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}
.site-banner-refresh:disabled { cursor: progress; }
.site-banner .board_image,
.staff-banner img {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: contain;
}
.staff-banners { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.staff-banner { max-width: 100%; }
.staff-banner form { margin-top: 8px; }


/* Center the board masthead on catalog and index pages without constraining
 * the catalog grid, thread previews, or top navigation. Override the shared
 * mobile flex heading as well as the desktop full-width heading. */
.page-board .site-banner,
.page-catalog .site-banner {
  margin-bottom: 12px;
}
.page-board .board-heading,
.page-catalog .board-heading {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 10px;
  text-align: center;
}
.page-board .board-heading h1,
.page-catalog .board-heading h1 {
  margin: 4px 0 6px;
}
.page-board .board-heading p,
.page-catalog .board-heading p {
  margin: 0;
  font-size: 13px;
}


/* Recent site announcements are a small, centered strip between the banner
 * and board heading/posting form. Old announcements stay in the archive only. */
.site-announcement-strip {
  max-width: 520px;
  margin: 0 auto 14px;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.site-announcement-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-announcement-strip li + li { margin-top: 5px; }
.site-announcement-strip a {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.site-announcement-strip time { color: var(--muted); }
.site-announcement-strip .announcement-more { margin-top: 6px; }
/* Keep the public footer as a single compact row of navigation links. */
footer {
  margin-top: 10px;
  padding: 10px 16px 12px;
  font-size: 11px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.footer-social-icon {
  display: block;
  width: 15px;
  height: 15px;
  flex: none;
  fill: currentColor;
}
.footer-staff-login {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  white-space: nowrap;
}
.footer-staff-login:hover {
  border-color: var(--accent);
  text-decoration: none;
}
@media (max-width: 640px) {
  footer { padding: 8px 12px 10px; }
  .footer-links { gap: 6px 10px; }
  .footer-staff-login { margin-left: 0; }
}
.site-content {
  width: min(100%, 820px);
  margin: 14px auto 24px;
}
.site-prose {
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.site-prose > :first-child { margin-top: 0; }
.site-prose > :last-child { margin-bottom: 0; }
.site-prose h2, .site-prose h3, .site-prose h4 { margin: 1.2em 0 .5em; }
.site-prose ul, .site-prose ol { padding-left: 1.7em; margin: 0 0 16px; }
.site-prose li { margin-bottom: .25em; }
.site-prose blockquote { border-left: 3px solid var(--line); padding: .35em 1em; margin: 0 0 16px; background: var(--wash); }
.site-prose pre { overflow-x: auto; padding: 12px; margin: 0 0 16px; background: var(--wash); border-radius: 4px; }
.site-prose code { overflow-wrap: anywhere; }
.site-prose pre code { overflow-wrap: normal; }
.site-prose img { max-width: 100%; height: auto; }
.site-prose table { display: block; max-width: 100%; overflow-x: auto; margin-bottom: 16px; }
.announcement-dates,
.announcement-item time { color: var(--muted); font-size: 12px; }
.announcement-item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.announcement-item h2 { margin: 5px 0 0; }
.announcement-item h3 { margin: 5px 0; }
.announcement-pages {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 13px;
}
.announcement-back { margin: 24px 0 0; }
.announcement-delete { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.announcement-delete summary { color: var(--danger); }


/* Imageboard-style inline image expansion; modifier-click still navigates
 * to the sanitized full-size image and captions remain below the picture. */
.post .attachment { cursor: zoom-in; }
.post .attachment.expanded { cursor: zoom-out; }
.post .attachment span { overflow-wrap: anywhere; }
.page-board .board-index-post.images-expanded { max-width: 100%; }
.page-board .board-index-post.images-expanded .post-content { flex-wrap: wrap; }
.page-board .board-index-post .attachment.expanded {
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
}
.page-board .board-index-post .attachment.expanded img {
  width: auto;
  height: auto;
  max-width: min(100%, calc(100vw - 64px));
}

/* Private approval and incident workspace. No media is loaded by queue cards. */
.mpa-nav { display:flex; flex-wrap:wrap; gap:.6rem 1.2rem; padding:.8rem 0; margin-bottom:1rem; border-bottom:1px solid var(--line); }
.mpa-warning { border:2px solid currentColor; border-radius:.4rem; padding:1rem; }
.mpa-queue-item { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 0; border-bottom:1px solid var(--line); }
.mpa-queue-item > div { min-width:0; overflow-wrap:anywhere; }
.mpa-frame { display:block; max-width:100%; height:auto; background:repeating-conic-gradient(#ccc 0% 25%,#fff 0% 50%) 50% / 20px 20px; }
.mpa-frames { display:flex; flex-wrap:wrap; gap:.4rem; margin:1rem 0; }
.mpa-frames a { display:inline-block; border:1px solid currentColor; padding:.3rem .6rem; }
.mpa-frames a[aria-current="page"] { outline:2px solid currentColor; outline-offset:2px; font-weight:bold; }
.mpa-context { white-space:pre-wrap; overflow-wrap:anywhere; max-height:32rem; overflow:auto; }
.mpa-evidence { margin:1rem 0; padding:.5rem 0; }
.mpa-evidence dd { overflow-wrap:anywhere; margin:0 0 1rem; }
.mpa-pending { display:inline-block; border:1px dashed currentColor; padding:.7rem; margin:.3rem 0; }
@media (max-width:600px) { .mpa-queue-item { align-items:flex-start; flex-direction:column; } }

/* Bound long role/action labels inside narrow staff panels. */
.mpa-nav ~ .panel select { width:100%; max-width:100%; }

/* Posting feedback is embedded in the one movable form, never a new page. */
.posting-feedback {
  margin: 3px 0 0 94px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 3px;
  background: var(--wash);
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.posting-feedback[hidden] { display: none; }
.posting-feedback[data-state="error"] { border-inline-start-color: var(--danger); }
.posting-feedback a { font-weight: 700; }
.posting-widget form[aria-busy="true"] { cursor: progress; }
.posting-widget form[aria-busy="true"] button[type="submit"] { opacity: .65; }
.javascript-required {
  border-bottom: 2px solid var(--danger);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 18px;
  font-weight: 700;
  text-align: center;
}
@media (max-width: 767px) {
  .posting-feedback { margin-left: 0; }
}

/* MPA virtual catalog: staff-only thumbnails, in-place full image viewer. */
.mpa-grid{align-items:start;margin:1rem 0 2rem}
.mpa-card{padding:0;overflow:hidden}
.mpa-thumbnail{display:flex;align-items:center;justify-content:center;width:100%;min-height:165px;border:0;border-radius:0;background:var(--wash);padding:8px;cursor:zoom-in}
.mpa-thumbnail img{display:block;max-width:100%;max-height:240px;object-fit:contain}
.mpa-card-details{padding:1rem}
.mpa-card-details h2{font-size:1rem;letter-spacing:normal;margin:0 0 .5rem}
.mpa-title{display:block;margin:.6rem 0}
.mpa-card-body{white-space:pre-wrap;overflow-wrap:anywhere;max-height:7rem;overflow:auto;font-size:.9rem;margin-bottom:.7rem}
.mpa-approve-form{margin:.6rem 0}
.mpa-card select,.mpa-viewer select{width:100%;max-width:100%;display:block;margin-top:.4rem;padding:.5rem;background:var(--input-bg);color:var(--input-fg);border:1px solid var(--input-border)}
.mpa-preview-dialog{width:min(96vw,1000px);max-height:94vh;background:var(--paper);color:var(--ink);border:2px solid var(--line);border-radius:8px;padding:1rem;overscroll-behavior:contain}
.mpa-preview-dialog::backdrop{background:rgba(0,0,0,.8)}
.mpa-preview-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}
.mpa-preview-image{min-height:140px;display:flex;justify-content:center;align-items:center;overflow:auto}
.mpa-preview-image img{display:block;max-width:100%;max-height:75vh;object-fit:contain}
.pending-attachment img{display:block;width:220px;height:auto;max-width:100%}
@media(max-width:640px){.mpa-card-details{padding:.8rem}.mpa-preview-dialog{padding:.5rem}.mpa-preview-image img{max-height:70vh}}

/* Staff media review: index-like posts + compact catalog, with a shared feed. */
.mpa-board-heading{margin-bottom:12px}
.mpa-board-heading h1{font-size:clamp(23px,3vw,32px)}
.mpa-queue-filters{justify-content:flex-start;gap:12px;flex-wrap:wrap;margin:0 0 14px}
.mpa-queue-filters a[aria-current="page"]{font-weight:700;text-decoration:underline;text-underline-offset:3px}
.mpa-filter-separator{color:var(--muted)}
.mpa-board-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,260px);gap:22px;align-items:start}
.mpa-board-stream{min-width:0}
.mpa-index{display:flex;flex-direction:column;gap:16px}
.mpa-thread{margin:0;min-width:0}
.mpa-thread .thread-heading{padding:10px 14px 0}
.mpa-thread .thread-heading h2{font-size:16px;overflow-wrap:anywhere}
.mpa-thread .post{margin:8px 12px 12px;padding:12px}
.mpa-review-post .post-meta{margin-bottom:12px}
.mpa-review-post .post-meta small{font-size:11px;color:var(--muted)}
.mpa-post-content{display:flex;align-items:flex-start;gap:14px;min-width:0}
.mpa-private-thumb{flex:0 0 auto;display:block;width:min(220px,45%);max-width:100%;margin:0;text-align:left;background:transparent;color:var(--ink);border:0;padding:0;cursor:zoom-in;font:inherit}
.mpa-private-thumb img{display:block;max-width:100%;max-height:200px;object-fit:contain;border:1px solid var(--line);border-radius:3px}
.mpa-private-thumb span{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.mpa-post-text{min-width:0;flex:1 1 auto;white-space:pre-wrap;overflow-wrap:anywhere}
.mpa-post-text .body{min-height:0;max-width:none;max-height:260px;overflow:auto;font-size:13px}
.mpa-title{display:block;font-size:14px;font-weight:700;margin:0 0 8px;white-space:normal}
.mpa-action-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
.mpa-action-row form{margin:0}
.mpa-action-row button{padding:7px 12px}
.mpa-review-item[data-busy="true"] button{opacity:.55;cursor:wait}
.mpa-item-feedback{font-size:12px;padding:8px 0;margin:0}
.mpa-item-feedback[data-state="error"],.mpa-action-notice[data-state="error"]{color:var(--danger)}
.mpa-action-notice{padding:10px;border:1px solid var(--line);background:var(--paper);margin:10px 0}
.mpa-decision-sidebar{min-width:0;position:sticky;top:66px;border:1px solid var(--line);border-radius:6px;background:var(--paper)}
.mpa-decision-inner{padding:14px}
.mpa-decision-inner h2{font-size:16px;margin:0 0 8px}
.mpa-decision-inner p{margin:0 0 10px}
.mpa-sync-status{border-top:1px solid var(--line);padding-top:8px}
.mpa-decision-list{padding:0;margin:0;list-style:none;max-height:68vh;overflow:auto}
.mpa-decision{border-top:1px solid var(--line);padding:9px 0;font-size:12px;overflow-wrap:anywhere}
.mpa-decision strong{color:var(--accent)}
.mpa-decision small{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.mpa-grid{margin:0;gap:12px}
.mpa-card{padding:0;overflow:visible}
.mpa-catalog-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px}
.mpa-catalog-heading strong{font-size:13px}
.mpa-card .mpa-post-content{display:flex;flex-direction:column;padding:0 10px 8px;gap:10px}
.mpa-card .mpa-private-thumb{width:100%;margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center;max-height:none}
.mpa-card .mpa-private-thumb img{max-height:210px}
.mpa-card .mpa-post-text{width:100%}
.mpa-card-details{padding:10px}
.mpa-card .mpa-action-row{gap:6px}
.mpa-card .mpa-action-row button{font-size:12px;padding:6px 8px}
.mpa-card .mpa-post-text .body{max-height:80px}
@media(max-width:900px){.mpa-board-layout{grid-template-columns:minmax(0,1fr)}.mpa-decision-sidebar{position:static;order:2}.mpa-decision-list{max-height:210px}.mpa-board-stream{order:1}}
@media(max-width:640px){.mpa-post-content{flex-direction:column}.mpa-private-thumb{width:min(220px,100%)}.mpa-thread .post{margin:8px}.mpa-thread .thread-heading{padding:10px}}

.mpa-queue-filters .mpa-filter-separator{border:0;border-radius:0;background:transparent;padding:0 2px;color:var(--muted)}

/* Staff queue uses the same full-width viewport and catalog tiles as /board/catalog.
 * A decision changes paint/interaction only; layout never reflows until refresh. */
main.page-media-queue{max-width:none;margin:0;padding:12px 10px 36px}
.page-media-queue .mpa-board-layout{display:block;min-width:0}
.page-media-queue .mpa-board-stream{width:100%;min-width:0}
.page-media-queue .mpa-grid{gap:14px 12px;margin:0 0 24px}
.page-media-queue .mpa-card{padding:10px;max-width:212px;overflow:hidden}
.page-media-queue .mpa-catalog-heading{padding:0;margin:0 0 7px;gap:4px;flex-wrap:wrap}
.page-media-queue .mpa-catalog-heading strong{font-size:12px}
.page-media-queue .mpa-card .mpa-post-content{gap:6px;padding:0}
.page-media-queue .mpa-card .mpa-private-thumb{display:block;width:100%;text-align:center}
.page-media-queue .mpa-card .mpa-private-thumb .catalog-image{height:152px;min-height:152px;max-height:152px;flex-basis:152px;margin-bottom:6px;overflow:hidden}
.page-media-queue .mpa-card .mpa-private-thumb img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border:0}
.page-media-queue .mpa-card .mpa-private-thumb>span:last-child{margin:0 0 6px}
.page-media-queue .mpa-card .mpa-post-text{text-align:center}
.page-media-queue .mpa-card .mpa-post-text .body{max-height:10em;font-size:12px}
.page-media-queue .mpa-card-details{padding:0}
.page-media-queue .mpa-card-details>p{margin:4px 0 8px;text-align:center}
.page-media-queue .mpa-action-row{margin:6px 0 0;padding-top:8px;justify-content:center}
.page-media-queue .mpa-action-row button{padding:6px 8px;font-size:12px}
.page-media-queue .mpa-live-controls{display:flex;flex-wrap:wrap;align-items:center;column-gap:14px;row-gap:4px;min-height:42px;margin:0 0 12px;font-size:12px;color:var(--muted)}
.page-media-queue .mpa-live-controls a{font-weight:600}
.page-media-queue .mpa-decision-sidebar{position:static;display:block;max-width:900px;margin:18px 0 0;border-radius:4px}
.page-media-queue .mpa-decision-sidebar>summary{padding:10px 14px;font-weight:600;cursor:pointer}
.page-media-queue .mpa-decision-inner{padding:0 14px 14px}
.page-media-queue .mpa-decision-list{max-height:190px;overflow:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:6px 12px}
.page-media-queue .mpa-decision{padding:6px 0}
.page-media-queue .mpa-review-item[data-review-state]:not([data-review-state="pending"]){opacity:.56;filter:grayscale(.65);border-style:dashed}
.page-media-queue .mpa-review-item[data-review-state="auto-approved"]{opacity:.76;filter:grayscale(.35);border:2px solid var(--accent);border-style:solid}
.page-media-queue .mpa-review-item[data-review-state="auto-approved"] .badge{border-color:var(--accent);color:var(--accent);font-weight:700}
.page-media-queue .mpa-decision[data-action="media-auto-approved"] strong{color:var(--muted)}
.page-media-queue .mpa-review-item[data-review-state="escalated"]{border-color:var(--danger)}
.page-media-queue .mpa-review-item[data-review-state="rejected"],.page-media-queue .mpa-review-item[data-review-state="retracted"]{border-color:var(--muted)}
.page-media-queue .mpa-review-item[data-review-state]:not([data-review-state="pending"]) .mpa-action-row{pointer-events:none}
.page-media-queue .mpa-action-notice[data-mpa-notice]{position:fixed;bottom:12px;right:12px;z-index:80;max-width:min(90vw,420px);box-shadow:0 4px 16px #0003;margin:0}
@media(max-width:560px){.page-media-queue .mpa-card{width:min(100%,226px);max-width:226px;padding:8px;background:transparent}.page-media-queue .mpa-card .mpa-private-thumb .catalog-image{height:148px;min-height:148px;max-height:148px;flex-basis:148px}.page-media-queue .mpa-live-controls{min-height:68px}.page-media-queue .mpa-decision-list{grid-template-columns:1fr}}

/* Small inline report composer: on-screen even beside narrow mobile posts. */
.settings-panel { white-space: normal; overflow-wrap: anywhere; overflow-x: hidden; }
.settings-help { white-space: normal; overflow-wrap: anywhere; }
.post-meta .post-number { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.post-reply-icon { width: 13px; height: 13px; }
.post-quote-label { display: none; font-size: 11px; }
.page-thread .post-quote-label { display: inline; }
.post-report-trigger { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 11px; white-space: nowrap; }
.post-report-trigger .icon { width: 13px; height: 13px; }
.post-report-popover {
  position: fixed; inset: auto; margin: 0; z-index: 100;
  width: min(300px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 12px; overflow-y: auto; overflow-x: hidden;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 5px;
  box-shadow: 0 8px 24px #0005;
  font-size: 13px; white-space: normal;
}
.post-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.post-report-heading strong { overflow-wrap: anywhere; }
.post-report-close { padding: 3px; line-height: 1; background: transparent; color: var(--muted); border: 0; }
.post-report-close .icon { width: 17px; height: 17px; }
.post-report-popover label { display: block; margin: 9px 0 4px; font-size: 12px; }
.post-report-popover label small { color: var(--muted); font-weight: 400; }
.post-report-popover textarea { width: 100%; min-height: 64px; max-height: 150px; margin: 0 0 9px; }
.post-report-popover button[type="submit"] { padding: 6px 12px; }
.post-report-feedback { margin: 8px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.post-report-feedback[data-state="error"] { color: var(--danger); }
.post-report-feedback[data-state="success"] { color: var(--ink); }
@media (max-width: 600px) {
  .post-report-popover { left: 12px !important; right: 12px !important; top: auto !important; bottom: 12px !important; width: auto; }
}
/* Native Popover API puts moderation forms in the top layer, escaping
 * catalog-card overflow and keeping all grid rows stationary. */
.mpa-action-trigger {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--accent);
  font: 600 12px/1.4 "Inter",system-ui, sans-serif;
  cursor: pointer;
}
.mpa-action-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(328px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 8px 24px #0006;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.mpa-action-popover .mpa-popover-title { display: block; margin-bottom: 8px; font-size: 13px; }
.mpa-action-popover .muted { margin: 0 0 8px; font-size: 11px; }
.mpa-action-popover form { display: block; margin: 0; }
.mpa-action-popover label { display: block; margin: 8px 0; font-size: 12px; }
.mpa-action-popover :is(textarea, select) {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 4px 0 0;
  padding: 6px;
  border: 1px solid var(--input-border);
  border-radius: 3px;
  background: var(--input-bg);
  color: var(--input-fg);
  font: inherit;
}
.mpa-action-popover textarea { min-height: 68px; resize: vertical; }
.mpa-action-popover button[type="submit"] { margin-top: 4px; padding: 7px 12px; }
.mpa-action-popover .mpa-item-feedback { padding: 6px 0 0; }
@media (max-width: 560px) {
  .mpa-action-popover:popover-open {
    position: fixed;
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px !important;
    width: auto;
    max-height: calc(100dvh - 24px);
  }
}


/* Clickable post references and clearly unavailable/deleted targets. */
.post .body .post-quote-link { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.post .body .post-quote-suffix { font-size: .88em; font-weight: 600; }
.post .body .post-quote-dead { color: var(--muted); text-decoration: line-through; }

/* Stable per-thread pseudonyms use a bounded accessible CSS palette.
 * No inline CSS, so the existing restrictive style CSP still applies. */
.post-meta .poster-id {
  display: inline-block;
  border-radius: 3px;
  padding: 1px 6px;
  color: #fff;
  font: 700 11px/1.55 ui-monospace, monospace;
  letter-spacing: .02em;
  white-space: nowrap;
}
.poster-id-color-0 { background: #563b87; }
.poster-id-color-1 { background: #1b597f; }
.poster-id-color-2 { background: #815017; }
.poster-id-color-3 { background: #276347; }
.poster-id-color-4 { background: #893c64; }
.poster-id-color-5 { background: #475694; }
.poster-id-color-6 { background: #76502c; }
.poster-id-color-7 { background: #386477; }
.poster-id-color-8 { background: #853e41; }
.poster-id-color-9 { background: #4b6253; }
.poster-id-color-10 { background: #574b84; }
.poster-id-color-11 { background: #79532b; }
.poster-id-color-12 { background: #2d5c83; }
.poster-id-color-13 { background: #7d426d; }
.poster-id-color-14 { background: #35655b; }
.poster-id-color-15 { background: #6c4e75; }

/* Fixed-role semantics: the header shows the account rank; tabs show the
 * minimum rank for the destination. Text labels also communicate the policy. */
.staff-cluster-content_moderator { --staff-bg: #0033a0; --staff-fg: #fff; }
.mpa-nav { gap: .45rem; }
.mpa-nav .staff-tab { display: inline-flex; align-items: center; padding: .45rem .7rem; border: 1px solid transparent; border-radius: 3px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.mpa-nav .role-content_moderator, .permission-matrix .role-content_moderator { background: #0033a0; color: #fff; }
.mpa-nav .role-moderator, .permission-matrix .role-moderator { background: #c8102e; color: #fff; }
.mpa-nav .role-admin, .permission-matrix .role-admin { background: #fce83a; color: #000; }
.mpa-nav .staff-tab:hover { text-decoration: underline; }
.mpa-nav .staff-tab[aria-current="page"] { outline: 2px solid var(--fg-main); outline-offset: 2px; }
.permission-matrix { max-width: 100%; overflow-x: auto; margin-bottom: 2rem; }
.permission-matrix table { min-width: 740px; width: 100%; border-collapse: collapse; }
.permission-matrix th, .permission-matrix td { padding: .65rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.permission-matrix td[data-role] { text-align: center; }
.permission-matrix code { font-size: .75rem; overflow-wrap: anywhere; }
@media (max-width: 480px) {
 .mpa-nav .staff-tab { flex: 1 1 auto; justify-content: center; font-size: .8rem; padding: .5rem; }
 .staff-panel form { min-width: 0; }
}


/* Hovered post references mimic imageboard quote previews without changing
 * any source post's layout. The global overlay is outside scroll containers. */
.post-meta .post-backlinks {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font: 600 11px/1.4 ui-monospace, monospace;
}
.post-meta .post-backlink { text-decoration: underline; text-underline-offset: 2px; }
.post.post-quote-highlight {
  background: color-mix(in srgb, var(--accent) 18%, var(--wash)) !important;
  border-color: var(--accent) !important;
}
.page-thread .thread-posts .post[id] { scroll-margin-top: calc(var(--toolbar-height, 46px) + 16px); }
.page-thread .thread-posts .post:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.post-reference-preview {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  width: min(460px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: 5px;
  box-shadow: 0 8px 30px #0007;
}
.post-reference-preview[hidden] { display: none; }
.post-reference-preview .post {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 10px;
}
.post-reference-preview .post-content { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.post-reference-preview .post-meta { margin-bottom: 6px; }
.post-reference-preview .post-number .post-quote-label,
.post-reference-preview .post-reply-icon { display: none; }
.post-reference-preview .post .attachment {
  max-width: 130px;
  margin: 0;
  flex: 0 0 auto;
}
.post-reference-preview .attachment img { max-width: 130px; max-height: 150px; object-fit: contain; }
.post-reference-preview .post .attachment-file { max-width: 130px; margin: 0; }
.post-reference-preview .post .body {
  flex: 1 1 180px;
  min-width: 0;
  max-height: 38vh;
  overflow: hidden;
  white-space: pre-wrap;
}


/* Explicit shortcuts for authenticated staff, without promoting staff boards to
   visitors. All elements inherit the active Modus theme and staff rank palette. */
.staff-board-menu { position: relative; margin: 0; }
.staff-board-menu > summary { list-style: none; cursor: pointer; gap: 6px; }
.staff-board-menu > summary::-webkit-details-marker { display: none; }
.staff-board-menu > summary .icon { width: 13px; height: 13px; }
.staff-board-menu[open] > summary .icon { transform: rotate(180deg); }
.top .staff-board-menu-links {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 2px;
  min-width: min(270px, 88vw);
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 8px 20px #0003;
  color: var(--ink);
}
.staff-board-menu-links a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ink);
  border-radius: 3px;
  text-decoration: none;
  white-space: normal;
}
.staff-board-menu-links a:hover,
.staff-board-menu-links a:focus-visible { background: var(--wash); }
.staff-board-menu-links a strong { color: var(--accent); font: 700 13px/1.4 ui-monospace,monospace; }
.staff-board-menu-links a span { font-size: 12px; overflow-wrap: anywhere; }
.staff-board-shortcuts h2 { margin: 0 0 15px; }
.staff-board-shortcut-list { display: flex; flex-wrap: wrap; gap: 12px; }
.staff-board-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  min-width: min(240px, 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: var(--wash);
  color: var(--ink);
  text-decoration: none;
}
.staff-board-shortcut:hover { border-color: var(--accent); text-decoration: none; }
.staff-board-shortcut:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.staff-board-shortcut-name { display: grid; gap: 2px; flex: 1; min-width: 0; }
.staff-board-shortcut-name strong { color: var(--accent); font: 700 15px/1.3 ui-monospace,monospace; }
.staff-board-shortcut-name span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.staff-board-shortcut > .icon { flex: 0 0 auto; }
@media (max-width: 640px) {
  .staff-cluster { flex-wrap: wrap; justify-content: center; white-space: normal; }
  .staff-board-menu-links { left: auto; right: 0; transform: none; }
  .staff-board-shortcut { flex: 1 1 100%; }
}

/* A normal, fully themed document for missing pages. */
.page-not-found { display: flex; flex-direction: column; }
.not-found-panel {
  width: min(100%, 650px);
  margin: clamp(36px, 8vh, 100px) auto 70px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--paper);
}
.not-found-code {
  margin: 8px 0 0;
  color: var(--accent);
  font: 800 clamp(74px, 17vw, 124px)/1 ui-monospace,monospace;
  letter-spacing: -.09em;
}
.not-found-panel h1 { margin: 10px 0; font-size: clamp(25px, 5vw, 36px); }
.not-found-panel > p:not(.not-found-code):not(.eyebrow) { color: var(--muted); max-width: 44ch; }
.not-found-return { display: inline-flex; align-items: center; gap: 9px; margin-top: 8px; }
.not-found-return .icon { width: 16px; height: 16px; }

/* The authenticator QR is generated locally and remains visible in every
   theme; a white quiet zone and crisp scaling preserve scanner reliability. */
.staff-mfa-qr{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;margin:1.25rem 0}
.staff-mfa-qr img{display:block;box-sizing:content-box;max-width:100%;height:auto;padding:12px;background:#fff;border:1px solid var(--line);border-radius:8px;image-rendering:pixelated}
.staff-mfa-qr figcaption{color:var(--muted);font-size:.85rem}
.staff-mfa-manual{margin:1rem 0}
.staff-mfa-manual code{overflow-wrap:anywhere}

/* Staff password-manager-friendly second-factor challenge. The first page
   contains only username/password; this screen does not cache credentials. */
.staff-login-mfa .auth-error{border-inline-start:3px solid var(--danger);padding:8px 12px;color:var(--ink);background:var(--wash)}
.staff-login-mfa [data-staff-mfa-code]{font-variant-numeric:tabular-nums;letter-spacing:.18em;font-size:19px;font-family:ui-monospace,monospace;max-width:18ch}
.staff-login-recovery{margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}
.staff-login-recovery summary{cursor:pointer;color:var(--accent);font-weight:600}
.staff-login-recovery form{margin-top:14px}
.staff-login-back{margin-top:22px;font-size:13px;color:var(--muted)}

/* Board MCP discovery: a small, theme-aware tinted notice, not a global alert. */
.mcp-posting-notice {
  display: flex; align-items: center; gap: 9px;
  width: min(100%, 520px); margin: 0 auto 14px; padding: 9px 12px;
  font-size: 12px; line-height: 1.5; color: var(--ink);
  background: color-mix(in srgb, var(--accent) 10%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 5px;
}
.mcp-posting-notice .icon { width: 16px; height: 16px; color: var(--accent); flex: none; }
.mcp-post-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.mcp-post-icon .icon { width: 13px; height: 13px; }
.mcp-guide ol { padding-left: 24px; }
.mcp-guide li { margin: 0 0 12px; }
.mcp-guide code { overflow-wrap: anywhere; }

/* Unlisted MCP onboarding: theme-aware, compact and usable without JavaScript. */
.mcp-guide{max-width:920px;margin-inline:auto}
.mcp-guide-section{margin-top:24px;padding-top:18px;border-top:1px solid var(--line)}
.mcp-guide-section h2{margin-top:0}
.mcp-guide-endpoint{padding:12px 14px;border:1px solid var(--line);border-radius:6px;background:color-mix(in srgb,var(--accent) 7%,var(--paper))}
.mcp-guide-endpoint-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.mcp-guide-endpoint code{flex:1;min-width:0;overflow-wrap:anywhere;user-select:all}
.mcp-guide-copy{flex:none}
.mcp-guide-copy[hidden]{display:none}
.mcp-guide-copy-status{margin:4px 0 0;font-size:12px;color:var(--muted)}
.mcp-guide-copy-status:empty{display:none}
.mcp-guide-warning{padding:12px 14px;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--line));border-radius:6px;background:color-mix(in srgb,var(--accent) 9%,var(--paper))}
/* Multi-attachment posts and native multi-file posting previews. */
.posting-file-preview{flex-direction:column;align-items:stretch;max-height:190px;overflow:auto}
.posting-file-item{display:flex;align-items:center;gap:8px;width:100%;margin:3px 0}
.posting-file-item .posting-file-thumbnail{width:42px;height:42px;object-fit:cover;flex:none}
.posting-file-item .posting-file-name{flex:1;min-width:0;overflow-wrap:anywhere}
.posting-file-item .posting-file-clear{flex:none}
.catalog-attachment-count{position:absolute;bottom:5px;right:5px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:3px;padding:1px 5px;font:11px ui-monospace,monospace}
.catalog-image{position:relative}
.post .attachment{position:relative}

/* Private multi-attachment review: all images are isolated staff-only routes. */
.mpa-preview-thumbnails{display:flex;gap:8px;overflow-x:auto;align-items:center;padding:9px 3px;border-top:1px solid var(--line);margin-top:8px}
.mpa-preview-attachment{flex:0 0 84px;background:var(--paper);border:1px solid var(--line);border-radius:4px;padding:5px;cursor:pointer}
.mpa-preview-attachment[aria-pressed="true"]{outline:2px solid var(--accent);outline-offset:1px}
.mpa-preview-attachment img,.mpa-preview-thumbnails a img{display:block;width:70px;height:70px;object-fit:contain;margin:auto}
.mpa-preview-image video{max-width:100%;max-height:70vh}
.mpa-preview-image [hidden]{display:none!important}
.mpa-flagged-attachments{border:1px solid var(--line);margin:8px 0;padding:7px;min-width:0}
.mpa-flagged-attachments legend{font-size:12px}
.mpa-flagged-attachments label.check{display:flex;align-items:center;gap:7px;overflow-wrap:anywhere}

/* Expanded video replaces the thumbnail link; native player controls handle
   playback. Place the supplied 13px collapse asset in a narrow left gutter. */
.post a.attachment[hidden]{display:none!important}
.post .expanded-video{position:relative;display:block;flex:0 1 auto;width:max-content;max-width:100%;min-width:0;padding-left:15px;margin:0 0 12px}
.post .expanded-video video{display:block;max-width:min(100%,780px);max-height:72vh;width:auto;height:auto;cursor:default}
.post .expanded-video .video-collapse{position:absolute;top:0;left:0;display:block;width:13px;height:13px;margin:0;padding:0;border:0;border-radius:0;background:transparent;line-height:0;cursor:pointer}
.post .expanded-video .video-collapse img{display:block;width:13px;height:13px;max-width:none}
.post .expanded-video .expanded-video-caption{display:block;max-width:100%;margin-top:6px;font:10px ui-monospace,monospace;color:var(--muted);overflow-wrap:anywhere}

/* The picker is the drop landing zone; each attachment sits below it as a
   separate removable row. Preserve this layout in the detached quick reply. */
.posting-file-control {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
}
.posting-file-control.is-drag-over {
  padding: 0;
  border: 0;
  background: transparent;
}
.posting-file-control .posting-file-picker {
  width: 100%;
  max-width: none;
  min-height: 44px;
  border: 1px dashed var(--input-border);
  background: var(--wash);
  color: var(--muted);
}
.posting-file-control .posting-file-picker:hover {
  border-color: var(--accent);
  background: var(--input-bg);
  color: var(--accent);
}
.posting-file-control.is-drag-over .posting-file-picker {
  border: 2px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
  color: var(--accent);
}
.posting-file-control .posting-file-preview {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  max-height: 220px;
  margin-top: 7px;
  overflow-y: auto;
}
.posting-file-control .posting-file-preview[hidden] { display: none; }
.posting-file-control .posting-file-item {
  width: 100%;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
}
.page-thread .posting-widget.reply-widget.is-detached .posting-file-control {
  flex-direction: column;
  align-items: stretch;
}
.page-thread .posting-widget.reply-widget.is-detached .posting-file-preview {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  max-height: 9em;
  overflow-y: auto;
}
.page-thread .posting-widget.reply-widget.is-detached .posting-file-preview[hidden] {
  display: none;
}

/* Thread creation uses its own placeholders and checkbox captions instead of
   reserving a desktop label column. Preserve real labels for screen readers. */
.new-thread.posting-widget .posting-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}
.new-thread.posting-widget .posting-row > label:not(.check) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.new-thread.posting-widget .posting-row-label { display: none; }
.new-thread.posting-widget .posting-feedback { width: 100%; margin-left: 0; }
.new-thread.posting-widget .posting-note { margin-left: 0; }

/* Pending multi-file posts have no public media IDs, only safe placeholders.
   Allow three or more thumbnails to wrap on narrow thread layouts. */
.post-content.has-pending-media { flex-wrap: wrap; }

/* One prominent MPA file count, aligned opposite the first file's size. */
.mpa-private-thumb .mpa-thumb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 1.8em;
  margin-top: 5px;
}
.mpa-private-thumb .mpa-thumb-meta .mpa-attachment-count {
  display: inline-block;
  flex: none;
  margin: 0;
  padding: .1em .4em;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--accent);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.2;
}
.mpa-private-thumb .mpa-thumb-meta .mpa-primary-size {
  display: inline-block;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 400;
  text-align: right;
}
.page-media-queue .mpa-card .mpa-private-thumb > .mpa-thumb-meta {
  margin: 0 0 6px;
}

/* Multi-file posts keep their previews together, with body text below the
   attachment row rather than squeezed into a narrow column beside it. */
.post-content.has-multiple-media {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}
.post-content.has-multiple-media > .body {
  flex: 0 0 100%;
  width: 100%;
  max-width: 80ch;
}

/* The per-thread composer is always a viewport-fixed window. Its zero-sized
   wrapper must never reserve a blank space above the thread controls. */
.page-thread .posting-slot {
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.page-thread .reply-reopen[hidden] { display: none; }
@media (min-width: 768px) {
  .page-thread .reply-reopen:not([hidden]) {
    position: fixed;
    z-index: 85;
    top: calc(var(--toolbar-height, 46px) + 12px);
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--accent);
    font: 600 12px/1.2 "Inter",system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 16px #0005;
  }
}
@media (max-width: 767px) {
  .page-thread .reply-reopen { display: none; }
}


/* Browser-local notification troubleshooting stays usable on narrow screens. */
/* Retained for manual DevTools use; not visible to ordinary visitors. */
.watch-push-debug[hidden] { display: none !important; }
.watch-push-debug { margin-top: .7em; max-width: 100%; }
.watch-push-debug > summary { color: var(--accent); font-weight: 600; }
.watch-push-debug .settings-help { margin: .65em 0; }
.watch-push-debug-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4em;
  margin: .6em 0;
}
.watch-push-debug-actions button {
  min-width: 0;
  padding: .45em .6em;
  white-space: normal;
  overflow-wrap: anywhere;
}
#watch-push-report {
  max-height: 19em;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: .7em;
  margin: .6em 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: .78em/1.5 ui-monospace, monospace;
}

/* Shared session interruption notice; colors inherit the active Modus theme. */
#gosoy-session-notice {
  position: fixed;
  z-index: 10000;
  top: 12px;
  left: 12px;
  right: 12px;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 18px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--wash);
}
#gosoy-session-notice[hidden],
#gosoy-session-notice button[hidden] { display: none !important; }
#gosoy-session-notice p { margin: 0 0 10px; }
#gosoy-session-notice a,
#gosoy-session-notice button { margin: 4px 10px 4px 0; }

/* Account controls share the settings panel on every viewport. */
.account-actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.account-actions form { margin: 0; width: 100%; }
.settings-account p { margin: 0 0 10px; overflow-wrap: anywhere; }
.top .account-actions .account-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--wash); color: var(--ink); font: inherit;
  line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer;
}
.top .account-actions .account-menu-item:hover {
  background: var(--modus-bg-hover); border-color: var(--accent); color: var(--ink);
}
.top .account-actions .account-menu-item:active { background: var(--button-bg); }
.top .account-actions .account-menu-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.account-menu-item .icon { width: 16px; height: 16px; flex: 0 0 16px; }
.account-menu-item span { min-width: 0; }
.setting-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.setting-switch span { color: var(--ink); margin: 0; font-weight: 600; }
.setting-switch input[role="switch"] {
  appearance: none; flex: 0 0 44px; width: 44px; height: 26px; margin: 0;
  border: 1px solid var(--input-border); border-radius: 20px;
  background: var(--input-bg); position: relative; cursor: pointer;
}
.setting-switch input[role="switch"]::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  border-radius: 50%; background: var(--ink);
}
.setting-switch input[role="switch"]:checked { background: var(--button-bg); border-color: var(--button-border); }
.setting-switch input[role="switch"]:checked::before { transform: translateX(18px); background: var(--button-fg); }
.setting-switch input[role="switch"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.setting-switch input[role="switch"]:disabled { cursor: wait; opacity: .65; }
.settings-save-status { margin: 12px 0 0; overflow-wrap: anywhere; }

/* Compact ban policy editor; all colors follow the active Modus palette. */
.duration-help { color: var(--muted); font-size: 12px; margin: 8px 0 16px; }
.duration-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.duration-table .duration-handle-column { width: 34px; }
.duration-table .duration-role-column { width: 112px; }
.duration-table th { padding: 0 4px 9px; font-size: 12px; font-weight: 600; text-align: left; vertical-align: bottom; }
.duration-table th.duration-role { text-align: center; }
.duration-table td { padding: 3px 4px; height: 42px; border-top: 1px solid var(--line); }
.duration-table tr:last-child td { border-bottom: 1px solid var(--line); }
.duration-cm { color: var(--modus-blue); }
.duration-mod { color: var(--modus-red); }
.duration-permission { display: flex; align-items: center; justify-content: center; min-height: 36px; margin: 0; }
.duration-permission input { width: 17px; height: 17px; margin: 0; accent-color: var(--modus-blue); }
.duration-mod input { accent-color: var(--modus-red); }
.duration-picker { display: flex; align-items: center; gap: 5px; }
.duration-picker input, .duration-picker select { width: auto; min-width: 0; margin: 0; padding: 5px 6px; height: 32px; font-size: 13px; }
.duration-picker input { width: 49px; appearance: textfield; font-variant-numeric: tabular-nums; }
.duration-picker input::-webkit-inner-spin-button { appearance: none; }
.duration-picker input[hidden] { display: none; }
.duration-picker select { width: 94px; }
.duration-icon-button { display: flex; align-items: center; justify-content: center; width: 28px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.duration-icon-button .icon { width: 16px; height: 16px; }
.duration-grip { cursor: grab; touch-action: none; }
.duration-dragging { background: var(--wash); }
.duration-dragging .duration-grip { color: var(--accent); cursor: grabbing; }
.duration-remove:hover { color: var(--modus-red); background: var(--wash); }
.duration-footer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.duration-footer button { margin: 0; }
.duration-footer .duration-save { margin-left: auto; }
.duration-status { color: var(--muted); font-size: 12px; }
@media (max-width: 560px) {
  .duration-table .duration-role-column { width: 59px; }
  .duration-table .duration-handle-column { width: 28px; }
  .duration-table th { padding: 0 2px 8px; font-size: 11px; overflow-wrap: anywhere; }
  .duration-table td { padding: 3px 2px; }
  .duration-picker { gap: 3px; }
  .duration-picker input { width: 34px; padding: 4px; }
  .duration-picker select { width: 76px; padding: 4px 2px; }
  .duration-footer { gap: 8px; }
  .duration-status { order: 3; width: 100%; }
}
@media (pointer: coarse) {
  .duration-table td { height: 48px; }
  .duration-permission, .duration-icon-button { min-height: 44px; }
  .duration-picker input, .duration-picker select { font-size: 16px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (pointer: coarse) and (max-width: 560px) {
  .duration-table .duration-role-column { width: 44px; }
  .duration-table .duration-handle-column { width: 40px; }
  .duration-table th, .duration-table td { padding-left: 0; padding-right: 0; }
  .duration-icon-button { width: 40px; }
}

.duration-picker input[hidden] + select { width: 148px; max-width: 100%; }

/* Compact archive list in the selected board theme. */
.archive-summary { text-align: center; margin: .75rem 0; }
.archive-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .85rem; }
.archive-table th, .archive-table td { padding: .1em .4em; line-height: 1.2; }
.archive-table th:first-child { width: 8em; }
.archive-table th:last-child { width: 4em; }
.archive-table td { border: 0; }
.archive-table tbody tr:nth-child(even) { background: var(--paper); }
.archive-excerpt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.archive-excerpt a { color: inherit; }
#thread-archive-notice[hidden] { display: none; }
.page-thread[data-archived="true"] .post-reply-icon,
.page-thread[data-archived="true"] .post-quote-label { display: none; }
