/* board.css — the suggestion board and the moderation page.
   Same tokens as the calculator: neutral ink, color only where it means something
   (green/red for agree/disagree counts, amber for cautions). System fonts only. */
:root {
  --bg: #F2F3F5; --surface: #FFFFFF; --surface-2: #F6F7F9; --ink: #111418; --muted: #535B66;
  --line: #DCE0E5; --line-strong: #BCC3CB; --sel-bg: #EAECEF;
  --pos: #0B7A3B; --pos-soft: #DDF3E5; --neg: #B3261E; --neg-soft: #FBE4E1;
  --warn-bg: #FFF5D9; --warn-ink: #5E4300; --warn-line: #E9CB72;
  --shadow: 0 1px 2px rgba(17, 20, 24, .06);
  --f-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-num: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1014; --surface: #161A20; --surface-2: #1C2129; --ink: #E8EBEF; --muted: #A2ABB6;
    --line: #2A313B; --line-strong: #404A56; --sel-bg: #262C35;
    --pos: #57D191; --pos-soft: #12301F; --neg: #FF8D7E; --neg-soft: #3B1C18;
    --warn-bg: #2E2610; --warn-ink: #F2CD70; --warn-line: #6B5520;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Bot trap. Off-screen rather than .sr: screen-reader users must never meet it. */
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: -10000px; }
.skip:focus { left: 16px; top: 12px; z-index: 5; background: var(--surface); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--ink); }

.wrap { max-width: 860px; margin: 0 auto; padding-inline: 20px; padding-block: 26px 64px; }
.wrap.wide { max-width: 1180px; }
.top { display: grid; gap: 10px; margin-bottom: 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 19px; font-weight: 750; margin: 0; }
.lede { margin: 0; color: var(--muted); max-width: 68ch; font-size: 15.5px; }
.main { display: grid; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-size: 14px; font-weight: 550; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.danger { background: var(--neg-soft); color: var(--neg); border-color: var(--neg); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.linkish { appearance: none; background: none; border: 0; padding: 6px 4px; min-height: 36px; cursor: pointer; color: var(--muted); font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.linkish:hover { color: var(--ink); }
.linkish:disabled { cursor: default; text-decoration: none; opacity: .7; }

label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
textarea, input[type="password"] { width: 100%; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
textarea { resize: vertical; min-height: 84px; }
.form-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.charcount { margin: 0; font: 500 13px var(--f-num); color: var(--muted); }
.charcount.is-over { color: var(--neg); }
.rules { margin: 14px 0 0; padding: 10px 14px 10px 30px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 8px; font-size: 13.5px; display: grid; gap: 4px; }
.status { margin: 12px 0 0; font-size: 14px; font-weight: 550; min-height: 1.4em; }

.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; }
.seg button { appearance: none; border: 0; background: transparent; border-radius: 7px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; font-weight: 600; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.empty { color: var(--muted); margin: 6px 0; }

.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.entry { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.serial { font: 600 13px/1.6 var(--f-num); color: var(--muted); }
.entry-main { min-width: 0; }
.entry-body, .reply-body { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.actions, .reply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; }
.vote { appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 550; }
.vote:hover { border-color: var(--ink); }
.vote[data-like][aria-pressed="true"] { background: var(--pos-soft); border-color: var(--pos); color: var(--pos); }
.vote[data-dislike][aria-pressed="true"] { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
.vote:disabled { opacity: .6; cursor: wait; }
.count { font-family: var(--f-num); }
.replies-label { margin: 10px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.replies { list-style: none; margin: 6px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.replyform { margin-top: 10px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.replyform .form-row .btns { display: flex; gap: 8px; }

.privacy p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); max-width: 80ch; }
.privacy p:first-of-type { margin-top: 6px; }
.email { font-family: var(--f-num); font-weight: 600; color: var(--ink); user-select: all; word-break: break-all; }

/* Moderation table */
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.admin-table thead th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.admin-table .admin-body { overflow-wrap: anywhere; white-space: pre-wrap; max-width: 52ch; }
.admin-table .reply-of { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }
.admin-table .num { font-family: var(--f-num); white-space: nowrap; }
.admin-table .act { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-table tr.is-hidden-row td, .admin-table tr.is-hidden-row th { background: var(--warn-bg); }
.admin-table tr.is-reply-row .admin-body { padding-left: 10px; border-left: 2px solid var(--line); }
.admin-table time { white-space: nowrap; }

@media (max-width: 600px) {
  .wrap { padding-block: 20px 48px; }
  .card { padding: 16px; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .serial { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
