/* the post — a clean, modern imageboard.
   Default theme: professional dark with a green accent.
   Alternates: Light, Yotsuba B (blue), Yotsuba (cream). */

:root {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1e242c;
  --border: #262d36;
  --text: #d6dbe2;
  --muted: #8a94a2;
  --accent: #3fb950;
  --accent-2: #2ea043;
  --on-accent: #04140a;
  --link: #59c884;
  --link-hover: #86e0aa;
  --name: #3fb950;
  --subject: #eaeff5;
  --title: #f2f5f9;
  --quote: #8cbf5e;
  --highlight: #1f3320;
  --input-bg: #0d1014;
  --input-text: #d6dbe2;
  --input-border: #2b333d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --radius: 8px;
}
html.light {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --border: #d8dee4;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #1a7f37;
  --accent-2: #116329;
  --on-accent: #ffffff;
  --link: #1a7f37;
  --link-hover: #116329;
  --name: #1a7f37;
  --subject: #0b0f14;
  --title: #0b0f14;
  --quote: #4f7a25;
  --highlight: #eaf5ea;
  --input-bg: #ffffff;
  --input-text: #1f2328;
  --input-border: #ced4da;
  --shadow: 0 1px 3px rgba(27, 31, 36, 0.08);
}
html.yotsuba-b {
  --bg: #eef2ff;
  --surface: #d6daf0;
  --surface-2: #c8cfe9;
  --border: #b7c5d9;
  --text: #0d0b28;
  --muted: #34345c;
  --accent: #34345c;
  --accent-2: #23233f;
  --on-accent: #ffffff;
  --link: #34345c;
  --link-hover: #dd0000;
  --name: #117743;
  --subject: #0f0c5d;
  --title: #af0a0f;
  --quote: #789922;
  --highlight: #d6bad0;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #aab3c4;
  --shadow: 0 1px 2px rgba(15, 12, 45, 0.12);
}
html.yotsuba {
  --bg: #ffffee;
  --surface: #f0e0d6;
  --surface-2: #e7d2c4;
  --border: #d9bfb7;
  --text: #600000;
  --muted: #8a5a4a;
  --accent: #800000;
  --accent-2: #5c0000;
  --on-accent: #ffffff;
  --link: #0000ee;
  --link-hover: #dd0000;
  --name: #117743;
  --subject: #cc1105;
  --title: #af0a0f;
  --quote: #789922;
  --highlight: #f0c0b0;
  --input-bg: #ffffff;
  --input-text: #000000;
  --input-border: #cbb2a8;
  --shadow: 0 1px 2px rgba(96, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  font-size: 0.9em;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; clear: both; }

/* ------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--title);
}
.brand:hover { color: var(--title); text-decoration: none; }
.brand::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: middle;
}
.nav-boards { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav-board {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nav-board:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-board.active { background: var(--accent); color: var(--on-accent); }
.nav-board.active:hover { background: var(--accent-2); color: var(--on-accent); }

/* ------------------------------------------------------- layout */
.container { max-width: 880px; margin: 0 auto; padding: 22px 16px 60px; }

.board-banner { text-align: center; margin: 8px 0 22px; }
.board-title { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -0.02em; color: var(--title); }
.board-blurb { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.navLinks { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin: 10px 0; }
.navLinks a { color: var(--link); }
.empty { text-align: center; margin: 48px 0; color: var(--muted); }

/* ------------------------------------------------------- post form */
.formToggle { margin: 6px 0 14px; }
.formToggle a {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 14px;
}
.formToggle a:hover { background: var(--accent-2); color: var(--on-accent); text-decoration: none; }

.postFormWrap { display: none; margin-bottom: 20px; }
.postFormWrap.open { display: block; }
.postFormWrap form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  max-width: 560px;
}
.postFormWrap table { width: 100%; border-collapse: collapse; }
.postFormWrap td { padding: 5px 0; vertical-align: middle; }
.postFormWrap td.label {
  width: 84px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding-right: 12px;
  white-space: nowrap;
}
input[type="text"], input[type="password"], textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  padding: 7px 9px;
  background: var(--input-bg);
  color: var(--input-text);
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
input[type="file"] { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type="submit"], button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid transparent;
  cursor: pointer;
}
input[type="submit"]:hover, button:hover { background: var(--accent-2); }
input[type="submit"]:disabled { opacity: 0.5; cursor: default; }
.subjectRow { display: flex; gap: 8px; align-items: center; }
.subjectRow input[type="text"] { flex: 1; }
.hint { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.hpt { position: absolute; left: -9999px; top: -9999px; }

/* ------------------------------------------------------- posts */
.thread { margin: 0 0 10px; }
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow: hidden;
}
.post.op { box-shadow: var(--shadow); }
.replyContainer { margin: 8px 0 8px 20px; }
.replyContainer .post.reply { background: var(--surface-2); }
.sideArrows { display: none; }
.post:target, .post.highlight { border-color: var(--accent); background: var(--highlight); }

.postInfo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.postInfo input[type="checkbox"] { margin: 0 2px 0 0; }
.name { color: var(--name); font-weight: 600; }
.trip { color: var(--name); opacity: 0.85; font-weight: 600; }
.subject { color: var(--subject); font-weight: 700; }
.dateTime { color: var(--muted); }
.postNum a { color: var(--muted); }
.postNum a:hover { color: var(--link); }
.replyLink a, .reportLink a { color: var(--muted); font-size: 12px; }
.omitted { color: var(--muted); font-size: 13px; margin: 2px 0 8px 2px; }

.file { float: left; margin: 2px 16px 8px 0; max-width: 100%; }
.fileText { font-size: 12px; color: var(--muted); margin-bottom: 5px; max-width: 280px; overflow-wrap: anywhere; }
.fileThumb img { display: block; max-width: 260px; max-height: 260px; border-radius: 6px; border: 1px solid var(--border); }
.fileThumb.small img { max-width: 150px; max-height: 150px; }
.fileThumb.expanded img, .fileThumb.small.expanded img { max-width: 100%; max-height: none; }
video.fileThumb { display: block; max-width: min(380px, 100%); max-height: 360px; border-radius: 6px; border: 1px solid var(--border); background: #000; }
video.fileThumb.small { max-width: min(280px, 100%); max-height: 260px; }

blockquote.postMessage { margin: 4px 0; overflow-wrap: break-word; white-space: normal; }
.quote { color: var(--quote); }
.quotelink { color: var(--link); }
.quotelink:hover { color: var(--link-hover); }
.deadlink { color: var(--muted); text-decoration: line-through; }

.deleteBar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0;
}
.deleteBar input[type="password"] { width: 130px; }
.deleteBar input[type="submit"] { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.deleteBar input[type="submit"]:hover { border-color: var(--accent); background: var(--surface); }

/* ------------------------------------------------------- catalog */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 16px 0; }
.catalogCell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  font-size: 12.5px;
  overflow: hidden;
  transition: transform 0.08s ease, border-color 0.08s ease;
}
.catalogCell:hover { transform: translateY(-2px); border-color: var(--accent); }
.catalogCell img, .catalogCell video { max-width: 100%; max-height: 150px; border-radius: 6px; background: #000; }
.catalogCell .meta { color: var(--muted); font-weight: 600; margin: 6px 0 3px; }
.catalogCell .teaser { color: var(--text); overflow-wrap: break-word; line-height: 1.4; }

/* ------------------------------------------------------- home */
.home { text-align: center; }
.homeTitle {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--title);
  margin: 10px 0 4px;
}
.homeTag { color: var(--muted); margin-bottom: 26px; }
.boardList { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.boardList th { background: var(--surface-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 9px 14px; }
.boardList td { border-top: 1px solid var(--border); padding: 11px 14px; vertical-align: middle; }
.boardList tr:hover td { background: var(--surface-2); }
.boardList td.slug a { font-weight: 700; }
.boardList td.bname a { color: var(--text); font-weight: 600; }
.boardList td.blurb { color: var(--muted); font-size: 13px; }
.boardList td.num, .boardList th.num { text-align: right; font-variant-numeric: tabular-nums; }
.homeAbout { max-width: 620px; margin: 30px auto 0; text-align: left; color: var(--text); }
.homeAbout p { margin: 12px 0; }
.homeAbout .hint { display: block; font-size: 13px; color: var(--muted); }

.board-section { margin: 26px 0; text-align: left; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px 2px;
}
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.state-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 13px;
  color: var(--text);
}
.state-chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.chip-count {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 7px;
  line-height: 18px;
}

.admin-login { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.admin-login input[type="password"] { max-width: 220px; }

/* ------------------------------------------------------- admin */
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.admin-head h1 { margin: 0; font-size: 24px; color: var(--title); letter-spacing: -0.02em; }
.admin-head .hint { max-width: 560px; }

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  padding-bottom: 0;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.admin-tab:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.admin-tab.active { color: var(--text); background: var(--surface); border-color: var(--border); position: relative; top: 1px; }
.tab-badge {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 7px;
  line-height: 17px;
}
.admin-section-title { font-size: 16px; color: var(--title); margin: 18px 0 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--title); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 4px; }
.stat-extra { font-size: 12px; color: var(--muted); margin-top: 4px; }

.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

.admin-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
select {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 9px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--input-text);
}
.admin-filter input[type="submit"] { padding: 7px 14px; }

.admin-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.admin-post.flagged { border-color: #c0533e; }
.admin-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.board-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 12px;
  color: var(--link);
}
.kind { font-size: 12px; }
.post-link { font-weight: 600; }
.ip-chip {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--muted);
  cursor: help;
}
.report-badge {
  background: #c0533e;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
}
.admin-post-body { display: flex; gap: 14px; margin-top: 10px; }
.admin-post-text { min-width: 0; }
.admin-post-text .subject { margin-bottom: 3px; }
.admin-comment { overflow-wrap: break-word; }
.admin-file { font-size: 12px; color: var(--muted); margin-top: 5px; }
.adminThumb { max-width: 110px; max-height: 110px; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; background: #000; }
video.adminThumb { max-width: 160px; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.admin-actions button { font-size: 12.5px; padding: 5px 11px; }
.btn-quiet { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-quiet:hover { background: var(--surface); border-color: var(--accent); }
.btn-danger { background: transparent; color: #d4705e; border: 1px solid #a04737; }
.btn-danger:hover { background: #a04737; color: #fff; }

.admin-pager { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0; }
.admin-pager .page { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.admin-pager .page.current { background: var(--accent); color: var(--on-accent); border-color: transparent; }

.adminTable { border-collapse: collapse; width: 100%; font-size: 13px; background: var(--surface); }
.adminTable th, .adminTable td { border: 1px solid var(--border); padding: 8px 10px; vertical-align: middle; text-align: left; }
.adminTable th { background: var(--surface-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.adminTable .num { text-align: right; font-variant-numeric: tabular-nums; }
.adminTable .hint-cell { color: var(--muted); }

@media (max-width: 700px) {
  .admin-cols { grid-template-columns: 1fr; }
  .admin-post-body { flex-direction: column; }
}

/* ------------------------------------------------------- errors */
.errorBox {
  max-width: 460px;
  margin: 70px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.errorTitle { font-size: 19px; font-weight: 700; color: var(--title); margin-bottom: 8px; }

/* ------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); padding: 22px 16px 40px; text-align: center; color: var(--muted); font-size: 13px; }
.theme-switch { margin-bottom: 8px; }
.theme-switch a { margin: 0 4px; color: var(--link); }
.footer-note { margin: 6px auto 0; max-width: 560px; }

/* --------------------------------------------- quotelink hover box */
#quotePreview {
  position: absolute;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
  max-width: min(480px, 90vw);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

@media (max-width: 640px) {
  .site-header { padding: 10px 14px; gap: 10px; }
  .nav-boards { margin-left: 0; width: 100%; }
  .container { padding: 16px 12px 48px; }
  .postFormWrap td.label { width: 70px; font-size: 11px; }
  .replyContainer { margin-left: 10px; }
  .homeTitle { font-size: 32px; }
}
