/* ===========================================================================
   romdump.net, period skin
   ---------------------------------------------------------------------------
   One self-hosted stylesheet, two themes. Dark ("black + blue") is always the
   default and lives in :root; light is opt-in via <html data-theme="light">,
   set before first paint by the tiny /static/theme.js shim from a cookie.

   Structure:
     1. Tokens        (dark default, light override)
     2. Reset + base
     3. Layout        (masthead, nav, breadcrumbs, footer)
     4. Components    (cards, tables, buttons, badges, forms)
     5. Forum         (node/thread tables, postbit)
     6. Feature areas (dumps, profile, DMs, chat, notifications, reports)
     7. Utilities + responsive + print
   =========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* "Black + blue", Astalavista style: pure-black canvas, glossy blue chrome,
     bright underlined links, one warm gold accent. */
  --bg:            #000000;
  --bg-elev:       #050a13;
  --bg-elev2:      #0c1830;
  --bg-inset:      #02050a;
  --border:        #17324f;
  --border-strong: #2c5d93;
  --fg:            #c6d4e8;
  --fg-dim:        #8fa6c2;
  /* ≥ 5.6:1 on every dark surface (the old #647e9c dropped to 4.2:1 on panels). */
  --muted:         #7a94b4;

  --accent:        #2f7fd0;
  --accent-dim:    #1c558f;
  --accent-ink:    #04101f;          /* text on an accent-filled control */
  --link:          #58a6ff;
  --link-visited:  #b48cf0;
  --hover:         #ff9d2e;          /* warm gold, used sparingly */

  --danger:        #ff5c5c;
  --danger-bg:     #2a0d0d;
  /* Fill behind white text (badges, danger buttons): #ff5c5c is only 3:1. */
  --danger-fill:   #c62828;
  --warn:          #ffcf6b;
  --ok:            #4fe0a0;
  --ok-bg:         rgba(79, 224, 160, .12);

  --chrome:        linear-gradient(#16304f, #071325);
  --chrome-hover:  linear-gradient(#1e4270, #0c1e38);

  /* Section-header bars (panel titles, table heads). */
  --bar:           linear-gradient(#1d4a7d, #0f2b52);
  --bar-text:      #eaf4ff;

  /* Subtle blue glow behind the masthead, like the portal's top light. */
  --topglow:       radial-gradient(120% 320px at 50% -90px, rgba(48, 120, 220, .26), transparent 70%);
  --brand-glow:    0 0 14px rgba(80, 150, 255, .45), 0 1px 0 #000;
  --text-glow:     0 1px 0 rgba(0, 0, 0, .55);
  --nav-text:      #cfe0f5;
  /* Primary nav strip, black by default (dark theme is the default look). */
  --topbar-bg:     #000000;

  /* Surfaces a user can recolour from the settings page. These default to the
     theme's own values; /theme/user.css overrides them per-account. */
  --masthead-bg:   var(--bg);
  --footer-bg:     var(--bg-elev);

  /* Dark label on a lighter face: ≥ 5:1 down to the darker bottom edge (the
     old #2b6db0 end was 3.6:1). */
  --btn-face:      linear-gradient(#64aae6, #3f87ca);
  --btn-border:    #2c6aa8;
  --btn-text:      #04101f;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: Verdana, "Segoe UI", Tahoma, Geneva, sans-serif;

  color-scheme: dark;
}

html[data-theme="light"] {
  /* Windows 7 / phpBB-era light: gray canvas, white panels, blue chrome. */
  --bg:            #e6ebef;
  --bg-elev:       #ffffff;
  --bg-elev2:      #f2f6f9;
  --bg-inset:      #fafcfd;
  --border:        #c3cfda;
  --border-strong: #9db0c0;
  --fg:            #1b2733;
  --fg-dim:        #4a5b6b;
  --muted:         #54657a;           /* ≥ 4.9:1 on the grey canvas, not 4.4 */

  --accent:        #0b5a87;
  --accent-dim:    #08415f;
  --accent-ink:    #ffffff;
  --link:          #0b5a87;
  --link-visited:  #5b3d9e;
  --hover:         #b44700;

  --danger:        #b3261e;
  --danger-bg:     #fbe9e7;
  --danger-fill:   #b3261e;
  --warn:          #8a6d2f;
  --ok:            #1f7a4d;
  --ok-bg:         rgba(31, 122, 77, .10);

  --chrome:        linear-gradient(#fbfdfe, #e9eff5);
  --chrome-hover:  linear-gradient(#ffffff, #f0f5fa);

  --bar:           linear-gradient(#f4f8fc, #dbe6f2);
  --bar-text:      #1b2733;

  --topglow:       none;
  --brand-glow:    0 1px 0 #fff;
  --text-glow:     none;
  --nav-text:      #17324f;
  --topbar-bg:     linear-gradient(#fbfdfe, #e9eff5);

  /* White label here, so the face goes *darker*: ≥ 5:1 at the lighter top
     edge (the old #3f97d8 end was 3.2:1). */
  --btn-face:      linear-gradient(#2672b0, #175989);
  --btn-border:    #10466d;
  --btn-text:      #ffffff;

  color-scheme: light;
}

/* --- 2. Reset + base ----------------------------------------------------- */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.6 var(--sans);
}

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
p { margin: .5em 0; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--hover); }
a:visited { color: var(--link-visited); }
/* Chrome and structural links stay quiet; content links stay underlined. */
.brand, .mainnav a, .pager a, .crumb a, .footer a, .filters .btn,
.card > h2:first-child a, table.data th a { text-decoration: none; }
a.btn, .btn, .who, .bell { text-decoration: none; }

/* Keyboard focus only, keep the era look intact for mouse users. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.muted { color: var(--muted); }
.mono  { font-family: var(--mono); font-size: .95em; }
code   { font-family: var(--mono); font-size: .93em; }
strong { font-weight: 700; }

/* Hidden inline-SVG sprite. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em;
  fill: none; flex: 0 0 auto;
}

/* Skip link for keyboard/AT users. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; font-weight: 700;
}
.skip:focus { left: 0; }

/* --- 3. Layout ----------------------------------------------------------- */

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* Masthead, near-black band with a soft blue top glow; holds the logo. */
.masthead {
  background: var(--masthead-bg);
  background-image: var(--topglow);
  border-bottom: 1px solid var(--border-strong);
}
.masthead-inner {
  display: flex; align-items: center; gap: 16px;
  padding-top: 14px; padding-bottom: 12px;
}
/* Site logo. Compact enough to leave the nav and auth controls up top, but a
   clear step up from the earlier thumbnail. Drop an <img> or inline <svg> in
   the slot. */
.logo-slot { display: block; line-height: 0; flex: 0 0 auto; }
.logo-img { display: block; height: clamp(46px, 6.5vw, 84px); width: auto; }
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 24px; letter-spacing: -.01em;
  color: var(--fg); text-shadow: var(--brand-glow);
}
.brand:hover { text-decoration: none; }
.brand span, .brand-dot { color: var(--link); }
.brand-tag {
  color: var(--muted); font-size: 12px; letter-spacing: .02em; flex: 1 1 auto;
}
/* The card clips its banner so the cover art can't bleed past the rounded
   corners. */
.profile-card { overflow: hidden; }

/* Primary bar, nav + auth. Glossy "tab" strip in the spirit of the portal. */
.topbar {
  background: var(--topbar-bg);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid var(--border-strong);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(0,0,0,.5), 0 2px 10px rgba(0,0,0,.35);
}
.topbar .wrap,
.topbar-inner {
  display: flex; align-items: center; gap: 14px; min-height: 36px; flex-wrap: wrap;
}
.mainnav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; align-items: stretch; }
.mainnav a {
  color: var(--nav-text); padding: 7px 13px; font-weight: 700; font-size: 12px;
  border: 1px solid transparent; border-radius: 3px 3px 0 0;
  text-shadow: var(--text-glow);
}
.mainnav a:hover {
  color: var(--fg); background: var(--chrome-hover); border-color: var(--border-strong);
  text-decoration: none;
}
.auth { display: flex; align-items: center; gap: 12px; }
.auth a { color: var(--fg-dim); }
.auth a:hover { color: var(--fg); }
.who { color: var(--fg) !important; display: inline-flex; align-items: center; gap: 6px; }
.who:hover { text-decoration: none; }
.rep { color: var(--ok); font-family: var(--mono); font-size: 12px; }
.rank {
  color: var(--fg-dim); font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; background: var(--bg-elev2); white-space: nowrap;
}

/* Breadcrumbs, the portal's "You are here:" bar. */
.crumb {
  font-size: 12px; margin: 0 0 14px; color: var(--bar-text);
  padding: 6px 12px; background: var(--bar); border: 1px solid var(--border-strong);
  border-radius: 3px; text-shadow: var(--text-glow);
}
.crumb a { color: var(--link); }
.crumb .sep { color: var(--muted); margin: 0 6px; }

main { padding: 20px 0 56px; }

/* Footer. */
.footer {
  border-top: 1px solid var(--border-strong); color: var(--muted); font-size: 12px;
  padding: 18px; background: var(--footer-bg);
}
.footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.footer-brand { margin: 0; max-width: 46ch; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.theme-toggle { display: inline-flex; align-items: center; gap: 5px; }

/* --- 4. Components ------------------------------------------------------- */

/* Panels, a 1px-ruled box whose <h2> becomes a blue section-header bar,
   exactly like the portal's boxed columns. */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.card > h2:first-child {
  margin: -14px -16px 12px; padding: 8px 14px;
  background: var(--bar); border-bottom: 1px solid var(--border-strong);
  border-radius: 3px 3px 0 0; color: var(--bar-text); font-size: 13px;
  letter-spacing: .03em; text-shadow: var(--text-glow);
}
.card > h1:first-child { margin-top: 0; }
.card.narrow { max-width: 440px; margin: 32px auto; }
.card.center { text-align: center; }
html[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(0,0,0,.10); }

.grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

/* Simple key/value list. */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 9px 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
}
.list li:last-child { border-bottom: none; }

/* Data tables, dense, 1px-ruled, sticky-header-ish chrome. */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; color: var(--bar-text); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; padding: 7px 10px;
  border-bottom: 1px solid var(--border-strong); background: var(--bar);
  white-space: nowrap; text-shadow: var(--text-glow);
}
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--bg-elev2); }
table.data .num, table.data th.num { text-align: right; }
/* Zebra rows read as a data table in the light era skin. */
html[data-theme="light"] table.data tbody tr:nth-child(even) td { background: #f7fafc; }

/* Buttons, gradient chrome controls. */
.btn {
  display: inline-block; cursor: pointer; font: inherit; font-weight: 700; font-size: 12px;
  color: var(--btn-text); background: var(--btn-face);
  border: 1px solid var(--btn-border); border-radius: 3px;
  padding: 6px 12px; text-align: center; text-shadow: 0 1px 0 rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { filter: brightness(.94); }
.btn.ghost {
  background: var(--chrome); color: var(--fg-dim); border-color: var(--border-strong);
  text-shadow: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.btn.ghost:hover { color: var(--fg); border-color: var(--muted); }
.btn.ghost.on { color: var(--fg); border-color: var(--accent-dim); background: var(--chrome-hover); }
.btn.danger { background: var(--danger-fill); border-color: var(--danger-fill); color: #fff; }
/* Link-styled buttons keep their label colour: the generic `a:visited`,
   `a:hover` and `.auth a` rules outrank `.btn` and put light link text on the
   light button face ("Sign up" in the nav). */
a.btn:not(.ghost):not(.danger),
a.btn:not(.ghost):not(.danger):visited,
a.btn:not(.ghost):not(.danger):hover { color: var(--btn-text); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }

.inline { display: inline; }
button.link {
  background: none; border: none; color: var(--link); cursor: pointer; padding: 0;
  font: inherit;
}
button.link:hover { text-decoration: underline; }
.link-accent { color: var(--accent); }
.danger-text { color: var(--danger); }
.up, .down { cursor: pointer; user-select: none; font-family: var(--mono); }
.up:hover { color: var(--ok); }
.down:hover { color: var(--danger); }

/* Tags, badges, pills. */
.tag {
  display: inline-block; background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 6px; font-size: 11px; color: var(--muted);
  font-family: var(--mono); vertical-align: middle; white-space: nowrap;
}
.tag-sticky { color: var(--hover); border-color: var(--hover); }
.badge {
  display: inline-block; background: var(--ok-bg); color: var(--ok);
  border: 1px solid var(--ok); border-radius: 3px; padding: 1px 7px; font-size: 11px;
  font-weight: 700; margin-right: 5px; vertical-align: middle;
}
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }

/* Stats strip. */
.stat { text-align: center; }
.stat .n { font-size: 24px; font-family: var(--mono); color: var(--accent); display: block; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.stats { display: flex; gap: 26px; justify-content: space-around; flex-wrap: wrap; }

/* Role badges, color-coded by staff/special tier. */
.role-badge {
  display: inline-block; border-radius: 3px; padding: 1px 7px; font-size: 11px;
  font-weight: 700; border: 1px solid; vertical-align: middle; white-space: nowrap;
}
.role-member    { color: var(--muted); border-color: var(--border); }
.role-expert    { color: #6cb0e8; border-color: #2f5d8f; background: rgba(108,176,232,.10); }
.role-moderator { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.role-admin     { color: var(--warn); border-color: #8a6d2f; background: rgba(229,192,123,.10); }
.role-god       { color: #e879f9; border-color: #a21caf; background: linear-gradient(90deg, rgba(232,121,249,.16), rgba(126,200,255,.16)); }
html[data-theme="light"] .role-expert { color: #1a5c96; }
html[data-theme="light"] .role-admin  { color: #7a5a12; }
html[data-theme="light"] .role-god    { color: #8a1fa8; }

/* Forms. */
label { display: block; margin: 13px 0 5px; color: var(--fg-dim); font-size: 12px; font-weight: 700; }
input[type=text], input[type=password], input[type=email], input[type=search],
input[type=number], textarea, select {
  width: 100%; padding: 7px 9px; background: var(--bg-inset); border: 1px solid var(--border-strong);
  border-radius: 3px; color: var(--fg); font: inherit;
}
html[data-theme="light"] input[type=text],
html[data-theme="light"] input[type=password],
html[data-theme="light"] input[type=email],
html[data-theme="light"] input[type=search],
html[data-theme="light"] input[type=number],
html[data-theme="light"] textarea,
html[data-theme="light"] select { background: #fff; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 150px; font-family: var(--mono); font-size: 12.5px; }
select { width: auto; min-width: 8ch; }
/* File inputs: the native "Browse…" button is wildly inconsistent across
   browsers, so give the whole control a field look and style the button. */
input[type=file] {
  width: 100%; color: var(--muted); font: inherit; font-size: 12px;
  background: var(--bg-inset); border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 4px 6px;
}
input[type=file]::file-selector-button {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--btn-text); background: var(--btn-face); border: 1px solid var(--btn-border);
  border-radius: 3px; padding: 5px 12px; margin-right: 10px;
  text-shadow: 0 1px 0 rgba(0,0,0,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
input[type=file]::file-selector-button:hover { filter: brightness(1.06); }
input[type=file]::-webkit-file-upload-button {
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--btn-text); background: var(--btn-face); border: 1px solid var(--btn-border);
  border-radius: 3px; padding: 5px 12px; margin-right: 10px;
}
input[type=file]::-webkit-file-upload-button:hover { filter: brightness(1.06); }
.narrow-input { max-width: 12ch; }
details { margin: 10px 0; }
summary { cursor: pointer; color: var(--fg-dim); }

/* Flash messages. */
.flash {
  background: var(--ok-bg); border: 1px solid var(--ok); color: var(--ok);
  padding: 9px 13px; border-radius: 3px; margin: 12px 0; font-size: 12.5px; font-weight: 700;
}
.flash.err { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.code { font-family: var(--mono); font-size: 42px; margin: 0; color: var(--muted); }
.qr { background: #fff; padding: 12px; border-radius: 4px; display: inline-block; color: #111; }
/* The enrolment QR is an inline SVG with no intrinsic CSS size: pin it to a
   scannable square that still fits a phone screen, crisp at any zoom. */
.qr svg { display: block; width: 220px; max-width: 100%; height: auto; shape-rendering: crispEdges; }
.hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* Pagers. */
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; font-size: 12px; }
.pager a { color: var(--link); }
.pager .current { color: var(--muted); }

/* Search + filter bars. */
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* --- 5. Forum ------------------------------------------------------------ */

.forum-table td { vertical-align: middle; }
.col-icon { width: 30px; text-align: center; }
.forum-icon { width: 18px; height: 18px; color: var(--muted); }
.forum-icon.pinned { color: var(--hover); }
.forum-icon.locked { color: var(--danger); }
.desc { font-size: 12px; }
.title-row { margin-bottom: 12px; align-items: flex-end; }

/* Thread postbit, classic left author column, collapsing on narrow screens. */
.post {
  display: grid; grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--border);
}
.post:last-child { border-bottom: none; }
.postbit-author {
  background: var(--bg-elev2); border-right: 1px solid var(--border);
  padding: 14px 12px; text-align: center; font-size: 12px;
}
.postbit-author .avatar { width: 64px; height: 64px; }
.postbit-author .pb-name { display: block; font-weight: 700; font-size: 13px; margin: 8px 0 4px; word-break: break-word; }
.postbit-author .pb-rank { display: block; margin-bottom: 6px; }
.postbit-author .pb-role { margin-bottom: 6px; }
.postbit-author .pb-fields { color: var(--muted); font-size: 11.5px; margin-top: 8px; line-height: 1.7; text-align: left; }
.postbit-author .pb-fields b { color: var(--fg-dim); font-weight: 700; }
.postbit-body { min-width: 0; }
.post-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 6px 12px; border-bottom: 1px solid var(--border-strong);
  background: var(--bar); color: var(--bar-text); font-size: 11.5px;
  text-shadow: var(--text-glow);
}
.post-head .grow { flex: 1; }
.post-head .muted { color: var(--fg-dim); }
.post-head .anchor { color: var(--fg-dim); }
.post-body {
  padding: 14px 16px; line-height: 1.65; overflow-wrap: anywhere;
  min-height: 60px;
}
.post-body pre {
  background: var(--bg-inset); border: 1px solid var(--border); padding: 10px 12px;
  overflow-x: auto; border-radius: 3px; font-size: 12.5px;
}
.post-body code { background: var(--bg-elev2); padding: 1px 5px; border-radius: 3px; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote {
  border-left: 3px solid var(--border-strong); margin: 10px 0; padding: 2px 0 2px 12px;
  color: var(--muted);
}
.post-body img { max-width: 100%; height: auto; }
.post-body h1, .post-body h2, .post-body h3 { margin-top: .8em; }
.post-body table { border-collapse: collapse; }
.post-body table td, .post-body table th { border: 1px solid var(--border); padding: 4px 8px; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
/* Rich-editor output: alignment, colour and embeds. */
.post-body [align="center"], .signature [align="center"], .sig [align="center"] { text-align: center; }
.post-body [align="right"], .signature [align="right"], .sig [align="right"] { text-align: right; }
/* Text size: classic 1–7 <font size> steps, mapped to proportional sizes so a
   user-picked size scales with the page instead of the browser's legacy default. */
font[size="1"] { font-size: .75em; }
font[size="2"] { font-size: .85em; }
font[size="3"] { font-size: 1em; }
font[size="4"] { font-size: 1.15em; }
font[size="5"] { font-size: 1.35em; }
font[size="6"] { font-size: 1.6em; }
font[size="7"] { font-size: 1.9em; }
.post-body iframe, .signature iframe, .sig iframe {
  width: 100%; max-width: 560px; aspect-ratio: 16 / 9; height: auto; border: 0;
}

/* Rich content inside encrypted DMs, the same vocabulary as posts, so a
   formatted message renders identically whether it's a post or a DM. */
.chat-body p { margin: .35em 0; }
.chat-body pre {
  background: var(--bg-inset); border: 1px solid var(--border); padding: 8px 10px;
  overflow-x: auto; border-radius: 3px; font-size: 12.5px;
}
.chat-body code { background: var(--bg-elev2); padding: 1px 5px; border-radius: 3px; }
.chat-body pre code { background: none; padding: 0; }
.chat-body blockquote {
  border-left: 3px solid var(--border-strong); margin: 8px 0; padding: 2px 0 2px 10px;
  color: var(--muted);
}
.chat-body h1, .chat-body h2, .chat-body h3 { margin: .5em 0 .3em; }
.chat-body ul, .chat-body ol { margin: .3em 0 .3em 1.4em; }
.chat-body a { color: var(--link); text-decoration: underline; }
.chat-body hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.chat-body [align="center"] { text-align: center; }
.chat-body [align="right"] { text-align: right; }

@media (max-width: 680px) {
  .post { grid-template-columns: 1fr; }
  .postbit-author {
    border-right: none; border-bottom: 1px solid var(--border); text-align: left;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  }
  .postbit-author .avatar { width: 40px; height: 40px; }
  .postbit-author .pb-name { margin: 0; }
  .postbit-author .pb-fields { display: none; }
}

.postfoot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px 12px; border-top: 1px dashed var(--border); font-size: 12px;
}
.react { display: inline-flex; align-items: center; gap: 6px; }
.react-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--chrome); border: 1px solid var(--border-strong); color: var(--fg-dim);
  border-radius: 3px; padding: 3px 9px; cursor: pointer; font: inherit; font-size: 12px;
}
.react-btn:hover { color: var(--fg); border-color: var(--muted); }
.react-btn.on { border-color: var(--accent-dim); color: var(--accent); background: var(--chrome-hover); }
.react-btn.dislike.on { border-color: var(--danger); color: var(--danger); }
.vote-score { font-size: 11.5px; }
.report-link { font-size: 11.5px; }
.anchor { color: var(--muted); font-size: 11px; font-family: var(--mono); margin-left: auto; }
.anchor:hover { color: var(--accent); text-decoration: none; }

.sig { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 9px; color: var(--muted); font-size: 12px; }

/* --- 6. Feature areas ---------------------------------------------------- */

/* Profile. */
.avatar { width: 22px; height: 22px; border-radius: 3px; vertical-align: middle; display: inline-block; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-inline { margin-right: 12px; }
.avatar-row { align-items: center; }
.profile-fields { margin: 8px 0 0; color: var(--muted); }
.profile-fields a { color: var(--link); }
.bio { margin: 10px 0 0; }

.comment-form { margin-bottom: 6px; }
.profile-comment { border-top: 1px solid var(--border); padding: 11px 0; }
.profile-comment:first-of-type { border-top: none; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.comment-body { margin-top: 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.linklike {
  background: none; border: none; padding: 0; margin: 0; font: inherit;
  color: var(--muted); cursor: pointer; text-decoration: underline;
}
.linklike:hover { color: var(--danger); }

.excerpt {
  color: var(--muted); font-size: 12px; display: inline-block; max-width: 60ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}

/* Encrypted DMs. */
.dm-log { max-height: 60vh; overflow-y: auto; }
.dm-log .chat-msg { margin-bottom: 10px; }
.dm-mine { text-align: right; }
.dm-mine .chat-meta { justify-content: flex-end; }
/* Only the run of text is right-aligned (chat convention); block-level rich
   content stays left-aligned so lists, code and quotes remain readable. */
.dm-mine .chat-body ul,
.dm-mine .chat-body ol,
.dm-mine .chat-body pre,
.dm-mine .chat-body blockquote { text-align: left; }
.chat-msg[data-pending] .chat-body { opacity: .65; font-style: italic; }

/* Chatbox. */
#chatlog { max-height: 460px; overflow-y: auto; }
.chat-msg { padding: 6px 0; border-bottom: 1px solid var(--border); }
.chat-msg:last-child { border-bottom: none; }
.chat-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.chat-time { margin-left: auto; font-size: 11.5px; }
.chat-body { margin-top: 2px; word-wrap: break-word; }
#chat-form { display: flex; gap: 8px; align-items: center; }
#chat-form input[type="text"] { flex: 1; }

.chat-composer { position: relative; }
/* Chat emoji picker, square, beveled, period. No pill shapes. */
.emoji-toggle { flex: 0 0 auto; font-size: 15px; padding: 6px 11px; }
.emoji-panel {
  position: absolute; right: 18px; bottom: 68px; z-index: 30;
  width: min(440px, calc(100% - 36px)); max-height: 320px; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: 0; padding: 0;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .55);
}
.emoji-cats {
  display: flex; flex-wrap: wrap; gap: 0; margin: 0;
  position: sticky; top: 0; z-index: 1;
  background: var(--bar); border-bottom: 1px solid var(--border-strong);
}
.emoji-cat {
  background: transparent; border: none; border-right: 1px solid rgba(0, 0, 0, .35);
  color: var(--bar-text); padding: 5px 10px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; cursor: pointer; border-radius: 0;
  text-shadow: var(--text-glow);
}
.emoji-cat:hover { background: rgba(255, 255, 255, .10); color: var(--bar-text); }
.emoji-cat.on { background: rgba(0, 0, 0, .38); color: #fff; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 0; padding: 6px; }
.emoji-item {
  background: transparent; border: 1px solid transparent; font-size: 18px; line-height: 1;
  padding: 4px 0; cursor: pointer; border-radius: 0;
}
.emoji-item:hover { background: var(--bg-inset); border-color: var(--border-strong); }

/* Chat/post/dump edit + delete affordances. */
.chat-deleted .chat-body { color: var(--muted); }
.chat-tombstone em { color: var(--muted); }
.chat-locked em { color: var(--muted); font-style: italic; }
.post-tombstone em { color: var(--muted); }
.chat-edited, .post-edited { font-size: 11px; font-style: italic; }
.chat-act, .post-act {
  font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px;
}
.chat-act:hover, .post-act:hover { color: var(--accent); text-decoration: none; }
.chat-act .icon, .post-act .icon { width: 12px; height: 12px; }
.chat-del, .post-del { display: inline; margin: 0; }
.dm-acts { margin-top: 3px; display: flex; gap: 10px; font-size: 11.5px; }
.dm-mine .dm-acts { justify-content: flex-end; }
.linkish {
  background: none; border: none; padding: 0; margin: 0; font: inherit; font-size: 11.5px;
  color: var(--muted); cursor: pointer;
}
.linkish:hover { color: var(--danger); text-decoration: underline; }
.chat-edit-form { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.chat-edit-form input[type="text"] { flex: 1; }

/* Emoji button inside the rich editor toolbar. */
.editor-emoji-wrap { position: relative; display: inline-flex; }
.editor-emoji {
  position: absolute; right: 0; top: calc(100% + 4px); bottom: auto; z-index: 40;
  width: min(440px, 92vw);
  left: auto;
}

/* Notifications. */
.bell { position: relative; display: inline-flex; align-items: center; }
.bell .icon { width: 17px; height: 17px; }
.bell:hover { text-decoration: none; }
.nav-count {
  background: var(--danger-fill); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 0 5px; line-height: 15px;
  margin-left: 3px; vertical-align: 1px;
}
.bell-count {
  position: absolute; top: -7px; right: -11px; background: var(--danger-fill); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 5px; line-height: 15px;
}
.notifs { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: none; }
.notif.unread { background: var(--ok-bg); border-left: 2px solid var(--accent); }
.notif-icon { flex: 0 0 auto; font-size: 16px; }
.notif-main { flex: 1; word-break: break-word; }

/* Reports (moderation). */
.report-preview { border-left: 3px solid var(--border-strong); margin: 10px 0; padding-left: 12px; white-space: pre-wrap; }
.report-row { padding: 13px 0; border-bottom: 1px solid var(--border); }
.report-row:last-child { border-bottom: none; }
.report-row.handled { opacity: .6; }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-body { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.report-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.report-actions input[type="text"] { flex: 1; min-width: 12ch; }

/* --- 7. Utilities + responsive + print ----------------------------------- */

.row { display: flex; align-items: center; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.break-all { word-break: break-all; }
.m-0  { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mb-4 { margin-bottom: 4px; }

@media (max-width: 640px) {
  .brand-tag { display: none; }
  .mainnav { width: 100%; }
  .auth { width: 100%; justify-content: flex-start; }
  .stats { gap: 16px; }
  .editor-bar { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  .topbar, .masthead, .footer, .postfoot, .skip, .filters, .searchbar { display: none; }
  body { background: #fff; color: #000; }
  .card { border-color: #999; box-shadow: none; }
}

/* --- 8. Profile design, banner, signature --------------------------------- */

/* Banner: a wide cover image that stays clipped to the rounded card, so it can
   never spill outside the panel (the earlier version poked past the corners). */
.profile-banner {
  margin: -14px -16px 12px; height: 160px; overflow: hidden;
  border-bottom: 1px solid var(--border-strong); background: var(--bg-inset);
  border-radius: 4px 4px 0 0;
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-banner-empty { display: none; }

/* Signature under posts and on the profile card. */
.signature, .sig {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--fg-dim); max-height: 220px; overflow: hidden;
}
.sig { border-top: none; }
.signature img, .sig img { max-width: 100%; height: auto; }

/* --- 9. Rich (WYSIWYG) editor --------------------------------------------- */
.editor-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 8px 0 0;
  padding: 6px; background: var(--bg-elev2); border: 1px solid var(--border);
  border-bottom: none; border-radius: 4px 4px 0 0;
  position: sticky; top: 36px; z-index: 5;
}
.editor-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--chrome); border: 1px solid var(--border-strong); color: var(--fg);
  border-radius: 3px; min-width: 34px; height: 30px; padding: 0 8px; cursor: pointer;
  font-size: 13px; line-height: 1;
}
.editor-btn:hover { background: var(--chrome-hover); color: var(--fg); }
.editor-btn:active { filter: brightness(.9); }
.editor-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--border); }
.ed-ico { width: 16px; height: 16px; display: block; }
.ed-b { font-weight: 700; }
.ed-i { font-style: italic; }
.ed-u { text-decoration: underline; }
.ed-s { text-decoration: line-through; }
.ed-code { font-family: var(--mono); font-size: 12px; }
.ed-color { font-weight: 700; }
.editor-size {
  height: 30px; min-width: 60px; padding: 0 4px; margin: 0;
  background: var(--chrome); color: var(--fg); border: 1px solid var(--border-strong);
  border-radius: 3px; font: inherit; font-size: 12px; cursor: pointer;
}
.editor-size:hover { background: var(--chrome-hover); }
/* This is a <label>, so it MUST reset the global label margin/padding or the
   colour swatch is shoved onto its own line. */
.editor-colorwrap {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 30px; margin: 0; padding: 0; cursor: pointer;
  color: var(--fg); font-size: 13px; font-weight: 700; line-height: 1;
  background: var(--chrome); border: 1px solid var(--border-strong); border-radius: 3px;
}
.editor-colorwrap:hover { background: var(--chrome-hover); }
.editor-color {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  border: none; padding: 0;
}
/* The WYSIWYG surface. Bordered like a textarea, sized generously. */
.rich-editor {
  min-height: 220px; max-height: 60vh; overflow-y: auto;
  padding: 10px 12px; background: var(--bg-inset); color: var(--fg);
  border: 1px solid var(--border); border-radius: 0 0 4px 4px;
  line-height: 1.6; overflow-wrap: anywhere;
}
.rich-editor:empty::before,
.rich-editor[data-placeholder]::before { color: var(--muted); }
.rich-editor:empty::before { content: attr(data-placeholder); pointer-events: none; }
.rich-editor:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rich-editor h2 { font-size: 16px; margin: .6em 0 .4em; }
.rich-editor blockquote {
  border-left: 3px solid var(--border-strong); margin: 10px 0; padding: 2px 0 2px 12px;
  color: var(--muted);
}
.rich-editor pre {
  background: var(--bg-elev2); border: 1px solid var(--border); padding: 10px 12px;
  border-radius: 3px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto;
}
.rich-editor img, .rich-editor video, .rich-editor iframe { max-width: 100%; }
.rich-editor iframe { aspect-ratio: 16 / 9; height: auto; width: 100%; border: 0; }
.rich-editor [align="center"] { text-align: center; }
.rich-editor [align="right"] { text-align: right; }
/* The real textarea is kept in the DOM (form field) but hidden once the rich
   surface is mounted. */
.rich-source { display: none; }

/* E2EE DM composer: the same editor, but compact (it's only ~4,000 chars and
   the log lives above it). The bar keeps the shared `top: 36px` so it sticks
   below the sticky topbar rather than behind it. */
#dm-compose .editor-bar { margin-top: 0; }
#dm-compose .rich-editor { min-height: 90px; max-height: 40vh; }

/* --- 10. Avatar crop modal ------------------------------------------------ */
.crop-back {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 999;
  background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  overflow: auto;
}
.crop-panel {
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  padding: 16px; max-width: 380px; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.6);
  margin: auto;
}
.crop-panel h2 { margin-top: 0; }
.crop-stage {
  position: relative; width: 320px; max-width: 100%; aspect-ratio: 1 / 1; height: auto;
  margin: 0 auto 12px; overflow: hidden; border: 1px solid var(--border-strong);
  cursor: grab; touch-action: none;
}
.crop-canvas { display: block; width: 100%; height: 100%; }
.crop-guide {
  position: absolute; inset: 0; pointer-events: none; box-sizing: border-box;
  outline: 2px dashed rgba(255, 255, 255, .55); outline-offset: -4px;
}
.crop-zoom { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.crop-zoom input[type="range"] { flex: 1; }
.crop-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Generic confirmation modal (the DM key-password gate). */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  overflow: auto;
}
.modal-backdrop .modal {
  position: relative; margin: auto;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  padding: 16px; width: 100%; max-width: 440px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
.modal-backdrop .modal h3 { margin: 0 0 8px; }
.modal-backdrop .modal input[type="password"] {
  display: block; width: 100%; box-sizing: border-box; margin: 6px 0 12px;
}
.modal-backdrop .modal .btn { margin-right: 8px; }

/* --- 11. Settings color rows --------------------------------------------- */
.color-row { gap: 8px; }
.color-row input[type="color"] { width: 42px; height: 34px; padding: 2px; background: var(--bg-inset); }
.color-row input[type="text"] { flex: 1; font-family: var(--mono); }
.banner-preview { max-width: 100%; border: 1px solid var(--border-strong); display: block; }

/* --- 12. Admin panel + site-wide controls -------------------------------- */

/* Announcement bar: a full-width strip at the very top of public pages. The
   close button only appears with JS (static/theme.js), which also hides a bar
   this browser already dismissed before it paints. */
.announce-bar {
  background: var(--bg-inset); border-bottom: 1px solid var(--accent-dim);
  color: var(--fg); font-size: 13px;
}
.announce-inner { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.announce-text { margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.announce-link { font-weight: 700; white-space: nowrap; }
.announce-close {
  flex: 0 0 auto; background: none; border: 1px solid transparent; border-radius: 3px;
  color: inherit; font: inherit; font-size: 18px; line-height: 1; padding: 2px 8px; cursor: pointer;
}
.announce-close:hover, .announce-close:focus-visible { border-color: currentColor; }
.announce-warn   { background: rgba(255, 207, 107, .10); border-bottom-color: var(--warn); }
.announce-danger { background: var(--danger-bg); border-bottom-color: var(--danger); color: var(--danger); }
.announce-danger .announce-link { color: inherit; text-decoration: underline; }
html[data-announce-dismissed] .announce-bar { display: none; }

/* Header banner (uploaded by staff): full width above the masthead, capped in
   height and cropped to fit rather than squashed. */
.site-banner { line-height: 0; background: var(--masthead-bg); border-bottom: 1px solid var(--border-strong); }
.site-banner img { display: block; width: 100%; height: auto; max-height: 200px; object-fit: cover; }
@media (max-width: 600px) { .site-banner img { max-height: 110px; } }

/* Branding slots on the portal's settings page. */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.brand-slot h3 { margin: 0 0 8px; }
.brand-slot p { margin: 6px 0; }
.brand-preview {
  display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 8px;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 3px; overflow: hidden;
}
.brand-preview img { display: block; max-width: 100%; max-height: 120px; width: auto; height: auto; }
.brand-preview-favicon img { width: 48px; height: 48px; object-fit: contain; }
.brand-upload, .brand-remove { margin: 8px 0 0; }
.brand-upload .btn { margin-top: 6px; }

/* Maintenance curtain. */
.maintenance { max-width: 560px; margin: 48px auto; text-align: center; }

/* Two even columns for admin detail pages (the public .grid reserves a narrow
   sidebar column, which crams the control panels). */
.admin-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .admin-2 { grid-template-columns: 1fr; } }

/* Key/value list (user detail). */
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv li:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.kv .v { text-align: right; }

/* Stack of small forms in the moderation card. */
.stack { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stack:last-of-type { border-bottom: 0; }
.stack .btn { align-self: flex-start; }

/* Achievement chips. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 12px; cursor: pointer; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-inset); color: var(--fg-dim);
}
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip.held { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }

/* Checkbox rows in the settings form. */
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--fg); font-weight: 400; }
.check input[type=checkbox] { width: auto; margin: 0; }
.settings-form textarea { min-height: 64px; }
.settings-form hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.settings-form .card h2 { margin-top: 0; }

/* Inline table actions. */
.actions { white-space: nowrap; }
.actions form { margin: 0 6px 0 0; }
.actions form:last-child { margin-right: 0; }
tr.row-deleted { background: var(--danger-bg); }
tr.row-deleted td { opacity: .65; }

/* Section (node) editor rows. */
.node-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 10px 0; border-bottom: 1px solid var(--border); }
.node-form label { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.node-form label.grow { flex: 1; min-width: 200px; }
.node-form input { width: auto; }
.node-form label.grow input { width: 100%; }
.node-edit { display: inline-flex; align-items: center; gap: 6px; }
.node-edit input { width: 14ch; }
details summary { cursor: pointer; margin: 10px 0; }

/* Danger zone. */
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); margin-top: 0; }

/* Success flash. */
.flash.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }

/* ---------------------------------------------------------------------------
   13. Firmware archaeology: fingerprints, relationships, collections.
   --------------------------------------------------------------------------- */

/* Fingerprint card. */
.fp-summary { font-size: 15px; margin: 4px 0 2px; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.fp-group { background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.fp-group h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fp-list { list-style: none; margin: 0; padding: 0; }
.fp-list li { padding: 3px 0; border-bottom: 1px dashed var(--border); line-height: 1.35; }
.fp-list li:last-child { border-bottom: 0; }
.fp-val { color: var(--fg); }
.fp-det { display: block; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* Intelligence report table (dump page). */
.fp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.fp-table { margin-top: 4px; }
.fp-table th { text-align: left; }
.fp-table .fp-field {
  width: 34%; min-width: 150px; color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em; vertical-align: top;
}
.fp-table .fp-val { font-weight: 600; }
.fp-table .fp-item { display: inline-block; margin: 2px 0; }
.fp-table .fp-item + .fp-item { margin-left: 14px; }
.fp-table .fp-det { display: inline; margin-left: 6px; font-family: var(--mono); }
.fp-off {
  margin-left: 8px; font-size: 11.5px; color: var(--hover);
  border-bottom: 1px dotted var(--border-strong); white-space: nowrap;
}
.fp-off:hover { color: var(--accent); border-color: var(--accent); }

/* Entropy distribution (dump page). */
.entropy { margin: 8px 0 4px; }
.entropy-head { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 4px; }
.entropy-bars { display: flex; align-items: flex-end; gap: 1px; height: 46px; padding: 4px; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.entropy-bar { flex: 1 1 0; min-width: 1px; height: 100%; display: flex; align-items: flex-end; background: transparent; }
.entropy-fill { display: block; width: 100%; background: var(--bar, var(--accent)); border-radius: 2px 2px 0 0; }
.h0 { height: 0; } .h5 { height: 5%; } .h10 { height: 10%; } .h15 { height: 15%; } .h20 { height: 20%; }
.h25 { height: 25%; } .h30 { height: 30%; } .h35 { height: 35%; } .h40 { height: 40%; } .h45 { height: 45%; }
.h50 { height: 50%; } .h55 { height: 55%; } .h60 { height: 60%; } .h65 { height: 65%; } .h70 { height: 70%; }
.h75 { height: 75%; } .h80 { height: 80%; } .h85 { height: 85%; } .h90 { height: 90%; } .h95 { height: 95%; }
.h100 { height: 100%; }

/* Firmware comparison. */
.compare-form { margin-top: 10px; }
.compare-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.compare-pickers label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.compare-pickers select { width: 100%; }
.compare-links { margin-top: 12px; }
.cmp-card { border-left: 3px solid var(--border-strong); }
.cmp-added { border-left-color: var(--ok); }
.cmp-removed { border-left-color: var(--danger); }
.cmp-list { list-style: none; margin: 0; padding: 0; }
.cmp-list > li { padding: 5px 0; border-bottom: 1px dashed var(--border); }
.cmp-list > li:last-child { border-bottom: 0; }
.cmp-cat {
  display: inline-block; min-width: 92px; margin-right: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.cmp-side { font-size: 11px; color: var(--muted); }
.cmp-list .fp-det { display: inline; margin-left: 6px; font-family: var(--mono); }

/* Firmware families. */
.family-model h2 { margin-bottom: 8px; }
.family-versions { list-style: none; margin: 0; padding: 0; }
.family-versions > li { padding: 7px 0; border-bottom: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.family-versions > li:last-child { border-bottom: 0; }

/* Hex viewer. */
.hex-jump { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.hex-jump label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.hex-jump input[type=text] { width: 180px; }
.hex-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.hex-card { overflow-x: auto; }
.hexdump {
  border-collapse: collapse; width: 100%; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.5;
}
.hexdump th {
  text-align: left; padding: 4px 10px 6px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.hexdump td { padding: 1px 10px; white-space: nowrap; vertical-align: top; }
.hexdump tr:nth-child(even) td { background: var(--bg-inset); }
.hex-off { color: var(--muted); user-select: none; }
.hex-bytes { letter-spacing: 1px; }
.hex-ascii { border-left: 1px solid var(--border); }
.hex-byte.hi { background: var(--accent); color: var(--accent-ink); border-radius: 2px; }

/* Related firmware. */
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list > li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.related-list > li:last-child { border-bottom: 0; }
.related-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.related-score { font-family: var(--mono); font-size: 12px; color: var(--hover); white-space: nowrap; }
.related-shared { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.related-shared .chip { cursor: default; font-family: var(--mono); font-size: 11px; padding: 3px 9px; }

/* Add-to-collection control. */
.collect-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.collect-row select { max-width: 100%; }
.collect-row input[type=text] { width: auto; flex: 1; min-width: 160px; }

/* Archaeology bar charts (CSP-safe widths: no inline styles). */
.bars { list-style: none; margin: 0; padding: 0; }
.bar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 3ch; align-items: center; gap: 8px; padding: 3px 0; }
.bar-label { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--bar); }
.bar-count { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.w0 { width: 0; } .w5 { width: 5%; } .w10 { width: 10%; } .w15 { width: 15%; } .w20 { width: 20%; }
.w25 { width: 25%; } .w30 { width: 30%; } .w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; }
.w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w65 { width: 65%; } .w70 { width: 70%; }
.w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; }
.w100 { width: 100%; }

/* Collections. */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.collection-card { background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.collection-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.collection-desc { margin: 6px 0 0; font-size: 13px; }
.collection-meta { margin: 8px 0 0; font-size: 12px; }
.collection-items .excerpt { font-size: 12.5px; }
.chip-pub { border-color: var(--ok); color: var(--ok); cursor: default; }
.chip-priv { border-color: var(--border-strong); color: var(--muted); cursor: default; }

/* Generic stacked form (collection editor). */
.stack { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack input[type=text], .stack textarea { width: 100%; }

/* --- 8. Escrow + wallet ----------------------------------------------------- */

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-sm { padding: 3px 9px; font-size: 11.5px; }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); }
.k-label { margin: 0 0 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.empty { text-align: center; padding: 10px 0; }

/* State pills: one look everywhere a deal state is shown. */
.pill {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border-strong); color: var(--fg-dim); background: var(--bg-elev2); white-space: nowrap;
}
.pill-ok   { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.pill-bad  { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.pill-live { color: var(--link); border-color: var(--accent-dim); background: rgba(47, 127, 208, .14); }
.pill-wait { color: var(--warn); border-color: #8a6d2f; background: rgba(255, 207, 107, .10); }
.pill-dim  { color: var(--muted); }

.coin { font-family: var(--mono); font-weight: 700; font-size: .8em; padding: 1px 6px; border-radius: 3px; border: 1px solid; vertical-align: middle; }
.coin-btc { color: #f7931a; border-color: #8a5410; }
.coin-eth { color: #8ea2f2; border-color: #4a5a9c; }
.coin-xmr { color: #ff7a3d; border-color: #8f3f1b; }

/* Deal header + progress. */
.deal-head h1 { font-size: 20px; }
.deal-summary { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.deal-amount { font-size: 26px; font-weight: 700; color: var(--fg); }
.deal-parties { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.deal-parties .avatar { vertical-align: middle; }
.deal-parties .arrow { color: var(--muted); }
.mm-chip { border: 1px dashed var(--accent-dim); color: var(--link); border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
.stepper { display: flex; list-style: none; margin: 16px 0 0; padding: 0; counter-reset: step; gap: 4px; }
.stepper .step {
  flex: 1; position: relative; padding: 22px 4px 0; font-size: 11px; text-align: center; color: var(--muted);
  counter-increment: step;
}
.stepper .step::before {
  content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px; line-height: 16px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--bg-inset); font-size: 10px; font-weight: 700;
}
.stepper .step::after {
  content: ""; position: absolute; top: 9px; left: calc(50% + 12px); right: calc(-50% + 12px); height: 1px; background: var(--border-strong);
}
.stepper .step:last-child::after { display: none; }
.stepper .step-done { color: var(--ok); }
.stepper .step-done::before { content: "✓"; border-color: var(--ok); color: var(--ok); }
.stepper .step-now { color: var(--fg); font-weight: 700; }
.stepper .step-now::before { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.next-step > p:first-of-type { margin-top: 0; }
.callout { border: 1px solid var(--border-strong); border-left-width: 4px; border-radius: 3px; padding: 10px 12px; margin: 12px 0; background: var(--bg-inset); }
.callout.warn { border-color: #8a6d2f; border-left-color: var(--warn); }
.callout.bad { border-color: var(--danger); border-left-color: var(--danger); background: var(--danger-bg); }
blockquote.note { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--border-strong); color: var(--fg-dim); white-space: pre-wrap; background: var(--bg-inset); }
.terms { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.fp { font-size: 13px; letter-spacing: .04em; color: var(--fg); }
.fp-box { border: 1px solid var(--border-strong); border-radius: 3px; padding: 10px 12px; margin: 12px 0; background: var(--bg-inset); }
.fp-box.bad { border-color: var(--danger); background: var(--danger-bg); }
.hash { font-size: 11px; color: var(--muted); word-break: break-all; }
.files li { align-items: flex-start; }
.settle-box { border-top: 1px dashed var(--border); padding-top: 10px; }
.upload-form { border: 1px dashed var(--border-strong); border-radius: 3px; padding: 4px 12px 0; margin: 10px 0; }

/* Dump upload progress (static/upload.js). */
.upload-progress { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; }
.upload-progress[hidden] { display: none; }
.upload-progress progress { flex: 1 1 auto; height: 14px; accent-color: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.timeline li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline-detail { color: var(--fg-dim); font-size: 12px; margin-top: 2px; word-break: break-word; }

.deal-chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.deal-msg { border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; background: var(--bg-inset); max-width: 85%; }
.deal-msg.mine { align-self: flex-end; border-color: var(--accent-dim); }
.deal-msg.staff { border-color: var(--ok); }
.deal-msg-meta { font-size: 11.5px; margin-bottom: 3px; }
.deal-msg-body { white-space: pre-wrap; word-break: break-word; }

.deals-table tr.needs-me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.howto { margin: 0 0 10px; padding-left: 20px; line-height: 1.6; }
.howto li { margin-bottom: 4px; }

/* Forms on the deal pages. */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
fieldset.seg { border: 0; padding: 0; margin: 13px 0 0; }
fieldset.seg legend { color: var(--fg-dim); font-size: 12px; font-weight: 700; padding: 0; margin-bottom: 5px; }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 4px 0; font-weight: 400; color: var(--fg); font-size: 13px; cursor: pointer; }
.hint-list { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
.deal-form textarea { min-height: 120px; font-family: inherit; font-size: 13px; }

/* Wallet. */
.wallet-app .card h2 { margin-bottom: 12px; }
.wallet-panel { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.wallet-panel:empty { display: none; }
.wstatus { margin: 8px 0 0; font-size: 12.5px; color: var(--fg-dim); min-height: 1em; word-break: break-word; }
.wstatus:empty { display: none; }
.wstatus.ok { color: var(--ok); }
.wstatus.err { color: var(--danger); }
.wallet-head .btn-row { justify-content: flex-end; }
.balance { margin: 0 0 12px; }
.balance-n { font-size: 26px; font-weight: 700; color: var(--fg); }
.addr-block { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.addr-block .addr-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.qr-img { background: #fff; padding: 6px; border-radius: 4px; image-rendering: pixelated; }
.seed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 14px; padding-left: 28px; margin: 12px 0; }
.seed-grid li { padding: 4px 6px; border-bottom: 1px dashed var(--border); }
.seed-grid li span { color: var(--fg); font-size: 13px; }
ul.checks { list-style: none; padding: 0; margin: 0 0 12px; }
ul.checks li { padding: 5px 0 5px 22px; position: relative; font-size: 12.5px; }
ul.checks li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.send-form { max-width: 520px; }
.modal-backdrop .modal .kv .v { max-width: 70%; }
.modal-backdrop .modal label + input, .modal-backdrop .modal label + textarea { margin-bottom: 4px; }

/* Keyboard focus must stay visible on fields (the generic `:focus` rule
   above removes the outline for mouse users). */
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Wide data tables scroll inside their card on small screens. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Small screens: the sticky multi-row nav ate a third of a phone screen. It
   now scrolls with the page and the links scroll sideways in one row. */
@media (max-width: 820px) {
  .topbar { position: static; }
  .mainnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .mainnav a { white-space: nowrap; }
  .editor-bar { top: 0; }
  .stepper .step { font-size: 0; }
  .stepper .step-now { font-size: 10.5px; }
  table.data { display: block; overflow-x: auto; }
}

/* Click-to-load video placeholder (see theme.js). */
.embed-ph {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; max-width: 560px;
  border: 1px dashed var(--border-strong); border-radius: 4px; background: var(--bg-inset); margin: 8px 0;
}

/* Wallet getting-started guide. */
.guide > summary { list-style: none; cursor: pointer; margin: -14px -16px 12px; }
.guide > summary::-webkit-details-marker { display: none; }
.guide-title {
  margin: 0; padding: 8px 14px; background: var(--bar); border-bottom: 1px solid var(--border-strong);
  border-radius: 3px 3px 0 0; color: var(--bar-text); font-size: 13px; letter-spacing: .03em;
}
.guide-title::after { content: "▾"; float: right; }
.guide:not([open]) > summary { margin-bottom: -14px; }
.guide:not([open]) .guide-title::after { content: "▸"; }
.guide-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.55; }
.guide-steps li::marker { color: var(--accent); font-weight: 700; }
.guide-steps strong { display: block; color: var(--fg); }
.guide-foot { border-top: 1px dashed var(--border); margin-top: 14px; padding-top: 12px; }
.pb-deal { display: block; margin-top: 6px; font-size: 11.5px; }

/* --- 9. Search, mentions, moderation log, sessions ------------------------ */

/* Header search: sits in the masthead's free right-hand space, so it never
   pushes the nav onto another row; on phones (tagline hidden) it fills the
   space next to the logo. */
.site-search { display: flex; align-items: center; gap: 4px; flex: 0 1 300px; min-width: 0; }
.site-search input[type=search] { padding: 5px 9px; font-size: 12px; min-width: 0; }
.site-search .btn { padding: 5px 9px; line-height: 1; }
.site-search .icon { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 640px) {
  .site-search { flex: 1 1 auto; }
}

/* Results. Highlights come from the server as <mark> around escaped text. */
.search-results { list-style: none; margin: 8px 0 0; padding: 0; }
.search-hit { padding: 11px 0; border-bottom: 1px solid var(--border); }
.search-hit:last-child { border-bottom: none; }
.search-kind { margin-right: 6px; text-transform: uppercase; letter-spacing: .04em; }
.search-title { font-weight: 700; word-break: break-word; }
.search-snippet { margin: 4px 0 2px; color: var(--fg-dim); word-break: break-word; line-height: 1.5; }
.search-meta { margin: 0; font-size: 11.5px; }
.search-hit mark, .search-title mark {
  background: rgba(229,192,123,.22); color: var(--fg); border-radius: 2px; padding: 0 1px;
}
html[data-theme="light"] .search-hit mark { background: #fde68a; color: #111; }

/* @mentions inside posts. */
.post-body a.mention { font-weight: 700; text-decoration: none; }
.post-body a.mention:hover { text-decoration: underline; }

/* Public moderation log. */
.modlog { list-style: none; margin: 0; padding: 0; }
.modlog-entry {
  display: grid; grid-template-columns: 9ch 1fr; gap: 2px 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.modlog-entry:last-child { border-bottom: none; }
.modlog-when { font-family: var(--mono); font-size: 11.5px; padding-top: 1px; }
.modlog-what { word-break: break-word; }
.modlog-reason { grid-column: 2; color: var(--fg-dim); font-size: 12px; word-break: break-word; }
@media (max-width: 640px) {
  .modlog-entry { grid-template-columns: 1fr; }
  .modlog-reason { grid-column: 1; }
}

/* Active sessions. */
.sessions-table tr.session-current td { background: var(--ok-bg); }

/* Staff: the optional public reason next to a moderation button. */
.reason-input[type=text] { width: 17ch; padding: 2px 6px; font-size: 11.5px; margin-right: 4px; }

/* --- 10. Watching, first-unread, feeds, profile portfolio ----------------- */

/* Thread notification level: three plain submit buttons in one form. */
.watch-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 12px; }
.watch-form select { width: auto; padding: 3px 6px; font-size: 12px; }
.watch-opt {
  background: var(--chrome); border: 1px solid var(--border-strong); color: var(--fg-dim);
  border-radius: 3px; padding: 3px 9px; cursor: pointer; font: inherit; font-size: 12px;
}
.watch-opt:hover { color: var(--fg); border-color: var(--muted); }
.watch-opt.on { border-color: var(--accent); color: var(--fg); background: var(--chrome-hover); font-weight: 700; }

/* Unread threads in lists, and the "new" jump link to the first unread post. */
.unread-jump {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 3px;
  border: 1px solid var(--ok); background: var(--ok-bg); color: var(--ok);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  text-decoration: none; vertical-align: 1px;
}
.unread-jump:hover { text-decoration: underline; }
tr.is-unread td:first-child, li.is-unread > span:first-child { border-left: 2px solid var(--ok); padding-left: 8px; }
.badge-new { margin-left: 4px; }
.latest-table td:first-child { width: 70%; }
.watched-table td:last-child { white-space: nowrap; }
.feed-link::before { content: "◉ "; color: var(--hover); }

/* Profile: escrow summary line, PGP fingerprint + key. */
.profile-escrow { margin: 10px 0 0; }
.profile-pgp { margin: 8px 0 0; }
.pgp-fp { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; word-break: break-all; }
.pgp-details { margin-top: 6px; }
.pgp-details > summary { cursor: pointer; color: var(--link); font-size: 12px; }
.pgp-key {
  max-height: 22em; overflow: auto; margin: 8px 0; padding: 8px 10px; font-size: 11px; line-height: 1.35;
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 3px; white-space: pre; user-select: all;
}
.pgp-input { font-size: 11.5px; }

/* ---- Rules page + themed 404 ------------------------------------------------ */
.rules { max-width: 760px; margin: 24px auto; }
.rules h2 { font-size: 18px; margin-top: 24px; }
.rules li { margin: 6px 0; }
.art-404 { font-family: var(--mono); font-size: 12px; line-height: 1.35; color: var(--muted); display: inline-block; text-align: left; margin: 0 auto 8px; overflow-x: auto; max-width: 100%; }
.search-404 { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.search-404 input { min-width: 0; flex: 1 1 220px; max-width: 360px; }

/* ---- Post revision history + staff restores ---------------------------------- */
a.post-edited { color: var(--muted); }
a.post-edited:hover { color: var(--link); }
.post-modnote { margin: 0; padding: 0 16px 10px; font-size: 11.5px; font-style: italic; }
.mod-edit-note {
  margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: 3px; background: var(--bg-elev2);
}
.staff-tombstone { border-left: 3px solid var(--danger); }
.staff-deleted { margin: 0 16px 8px; padding: 6px 10px; border: 1px dashed var(--danger); border-radius: 3px; }
.staff-deleted > summary { color: var(--danger); font-size: 12px; margin: 0; }
.staff-deleted .post-body { opacity: .85; padding: 8px 4px 2px; min-height: 0; }
.staff-note { font-size: 11.5px; margin: 0; padding: 0 16px 10px; }
.restore-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.postbit-body .restore-form { margin: 0; padding: 0 16px 10px; }
.restore-form .btn { padding: 3px 10px; font-size: 12px; }
.revision .rev-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.revision .rev-title { font-size: 15px; margin: 0; }
.rev-reason { margin: 0 0 8px; font-size: 12.5px; color: var(--fg-dim); }
.rev-body { border-top: 1px solid var(--border); padding-top: 8px; }
.rev-changes { margin: 12px 0 0; }
.rev-changes > summary { font-size: 12px; }
.rev-diff {
  margin: 6px 0 0; padding: 6px 0; max-height: 32em; overflow: auto; font-family: var(--mono); font-size: 12px;
  line-height: 1.45; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 3px;
  white-space: pre-wrap; word-break: break-word;
}
.diff-line { display: block; min-height: 1.45em; padding: 0 10px; text-decoration: none; }
.diff-line::before { display: inline-block; width: 1.5em; color: var(--muted); }
.diff-add { background: var(--ok-bg); color: var(--ok); }
.diff-add::before { content: "+"; color: var(--ok); }
.diff-del { background: var(--danger-bg); color: var(--danger); }
.diff-del::before { content: "−"; color: var(--danger); }
.diff-same { color: var(--fg-dim); }
.diff-same::before { content: " "; }
.diff-gap { color: var(--muted); font-style: italic; }
.mention-list {
  position: absolute; z-index: 50; margin: 0; padding: 4px 0; list-style: none; min-width: 180px; max-width: 320px;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  font-size: 13px;
}
.mention-opt { padding: 4px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-opt[aria-selected="true"] { background: var(--bg-elev2); }
.post-body blockquote > .quote-by { margin: 0 0 4px; font-size: 12px; font-weight: 600; }
.post-body blockquote > .quote-by a { color: var(--fg-dim); }
.post-body blockquote > .quote-by a::after { content: " ↑"; }
.rev-meta { margin: 0 0 8px; }
.rev-meta th { width: 7em; text-align: left; font-weight: 600; color: var(--fg-dim); }
.rev-fields { margin: 6px 0; padding-left: 20px; font-size: 13px; }
.diff-del-inline { background: var(--danger-bg); color: var(--danger); }
.diff-add-inline { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
.dm-history { margin: 6px 0 2px; padding: 6px 10px; border-left: 3px solid var(--border-strong); background: var(--bg-inset); font-size: 13px; }
.dm-version + .dm-version { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.dm-version .chat-meta { font-size: 11.5px; }
.hof { margin: 0; padding-left: 22px; }
.hof li { margin: 6px 0; }

/* ---- Thread prefixes + solved answers ---------------------------------------- */
.prefix { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; vertical-align: 2px; margin-right: 4px; }
.prefix:hover { color: var(--fg); border-color: var(--accent); }
.prefix-lg { font-size: 13px; vertical-align: 4px; }
.prefix.tone-ok, .chip.tone-ok.on { color: var(--ok); border-color: var(--ok); }
.prefix.tone-info, .chip.tone-info.on { color: var(--accent); border-color: var(--accent); }
.prefix.tone-warn, .chip.tone-warn.on { color: var(--warn, #d9a441); border-color: var(--warn, #d9a441); }
.prefix-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip.on { border-color: var(--accent); color: var(--fg); }
.tag-solved { color: var(--ok); border-color: var(--ok); }
.badge-solution { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.post.is-solution { box-shadow: inset 3px 0 0 var(--ok); }
.curate-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.prefix-form select { width: auto; padding: 3px 6px; }
.title-prefix-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.title-prefix-row .grow { flex: 1 1 260px; }
.title-prefix-row select { width: auto; }

/* ---- Dump cards + dump discussions ------------------------------------------- */
/* A card is phrasing content (spans) so it can replace a line inside a <p>. */
.dump-card {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; max-width: 640px; margin: 6px 0;
  padding: 8px 12px; border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: 4px; background: var(--bg-elev2); line-height: 1.4;
}
.dump-card + br { display: none; }
.dump-card-title { font-size: 14px; text-decoration: none; }
.dump-card-title:hover strong { text-decoration: underline; }
.dump-card-meta { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; }
.dump-card-sha { color: var(--muted); font-size: 11.5px; }
.dump-card-hidden { color: var(--danger); border-color: var(--danger); }
.dump-card-gone { border-left-color: var(--border-strong); color: var(--muted); font-style: italic; }
.thread-dump { margin-top: 10px; }
.thread-dump .dump-card { margin-top: 4px; }
.discuss-card .dump-card { margin: 0 0 8px; }
.discuss-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mentioned-head { font-size: 14px; margin: 14px 0 6px; }
.mentioned-list { margin: 0; padding-left: 20px; }
.mentioned-list li { margin: 4px 0; }

/* ---- Code presentation: highlighting, diff/hexdump fences, line anchors ---- */
.post-body pre.code { white-space: pre; tab-size: 4; line-height: 1.5; }
pre.code.numbered code { display: block; counter-reset: none; }
pre.code .cl { display: block; position: relative; padding-left: 3.6em; min-height: 1.5em; }
pre.code .cl:target { background: var(--bg-elev2); box-shadow: inset 2px 0 0 var(--accent); }
pre.code .ln { position: absolute; left: 0; width: 2.8em; text-align: right; color: var(--muted); opacity: .6;
  text-decoration: none; user-select: none; -webkit-user-select: none; }
pre.code .ln:hover { opacity: 1; color: var(--accent); }
.tok-k { color: #c792ea; }
.tok-s { color: #c3e88d; }
.tok-c { color: var(--muted); font-style: italic; }
.tok-n { color: #f78c6c; }
.tok-f { color: #82aaff; }
.tok-r { color: #ffcb6b; }
.tok-l { color: #89ddff; font-weight: 700; }
.d-add { color: var(--ok); background: rgba(79, 224, 160, .08); display: inline-block; min-width: 100%; }
.d-del { color: #ff7b7b; background: rgba(255, 123, 123, .08); display: inline-block; min-width: 100%; }
.d-hunk { color: var(--accent); }
.d-meta { color: var(--fg-dim); font-weight: 700; }
.hexdump .hx-off { color: var(--muted); margin-right: .2em; }
.hexdump .hx-z { color: var(--muted); opacity: .55; }
.hexdump .hx-b { color: var(--fg); }
.hexdump .hx-asc { color: var(--ok); }
[data-theme="light"] .tok-k { color: #7c3aad; }
[data-theme="light"] .tok-s { color: #2d7a21; }
[data-theme="light"] .tok-n { color: #b4501f; }
[data-theme="light"] .tok-f { color: #1f5fbf; }
[data-theme="light"] .tok-r { color: #8a5a00; }
[data-theme="light"] .tok-l { color: #0b6e8a; }
[data-theme="light"] .d-del { color: #b02a2a; }

/* ---- Bounty threads + anti-brigade voting ------------------------------------ */
.bounty-card {
  margin-top: 12px; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-left: 3px solid var(--warn, #d9a441); border-radius: 4px; background: var(--bg-elev2);
}
.bounty-card.state-fulfilled { border-left-color: var(--ok); }
.bounty-card.state-expired { border-left-color: var(--border-strong); }
.bounty-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.bounty-state {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px;
  border-radius: 4px; border: 1px solid var(--warn, #d9a441); color: var(--warn, #d9a441);
}
.state-fulfilled .bounty-state { border-color: var(--ok); color: var(--ok); }
.state-expired .bounty-state { border-color: var(--border-strong); color: var(--muted); }
.bounty-wanted { font-size: 14px; }
.bounty-reward { margin-left: auto; font-weight: 700; color: var(--accent); }
.bounty-meta { margin: 6px 0 0; }
.bounty-dump .dump-card { margin: 8px 0 0; }
.bounty-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 10px; }
.bounty-claim { margin: 0; }
.bounty-claim summary { list-style: none; cursor: pointer; display: inline-block; margin: 0; }
.bounty-claim summary::-webkit-details-marker { display: none; }
.bounty-claim[open] summary { margin-bottom: 8px; }
.bounty-claim-form { display: grid; gap: 6px; max-width: 520px; }
.bounty-claim-form textarea { min-height: 3.5em; }
.tag-bounty { color: var(--warn, #d9a441); border-color: var(--warn, #d9a441); }
.tag-bounty.bounty-fulfilled { color: var(--ok); border-color: var(--ok); }
.tag-bounty.bounty-expired { color: var(--muted); border-color: var(--border-strong); }
.bounty-history-head { font-size: 13px; margin: 12px 0 4px; }
.bounty-state-chip { text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; }
.bounty-state-chip.state-open, .bounty-state-chip.state-claimed, .bounty-state-chip.state-pending { color: var(--warn, #d9a441); }
.bounty-state-chip.state-fulfilled { color: var(--ok); }
.react-btn.locked { opacity: .55; cursor: not-allowed; }
.react-btn.locked:hover, .react-btn.locked:focus { color: var(--muted); border-color: var(--border); }
.tally-note { font-size: 11.5px; font-style: italic; }
.hot-boards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .hot-boards { grid-template-columns: 1fr; } }
.hot-list { margin: 0; padding-left: 22px; }
.hot-list li { margin: 6px 0; line-height: 1.35; }
.hot-list li > .small { display: block; }
.hot-points { color: var(--accent); }

/* ---- Pay / release from your own Ethereum wallet --------------------------- */
.hidden { display: none !important; }
.ext-tx li { align-items: center; gap: 8px; }
.ext-tx .v { flex: 1 1 auto; min-width: 0; }

/* ---- Trust without killing lurkers (roadmap item 16) ----------------------- */
/* The honeypot: off-screen for people (the CSP forbids inline style), still a
   plain text input for form-filling bots. Not display:none, which some skip. */
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.trust-lock { border: 1px solid var(--warn); border-radius: 6px; padding: 10px 12px; margin: 8px 0 12px; background: rgba(255, 207, 107, .07); }
.trust-lock p + p { margin: 6px 0 0; }
.trust-note { border-left: 3px solid var(--accent); padding: 6px 10px; margin: 0 0 10px; color: var(--fg-dim); font-size: 13px; }
.trust-note-locked { border-left-color: var(--warn); color: var(--warn); }
.trust-hint { margin: 6px 0 0; }
.trust-box { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: grid; gap: 6px; }
.trust-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.trust-level { display: inline-block; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 12.5px; }
.trust-level.trust-new { color: var(--warn); border-color: var(--warn); }
.trust-level.trust-established, .trust-level.trust-staff { color: var(--ok); border-color: var(--ok); }
.trust-locks { margin: 4px 0 8px; padding-left: 4px; list-style: none; }
.trust-locks li { margin: 4px 0; }
.invite-new { margin: 10px 0; }
.invite-code { font-size: 20px; letter-spacing: .08em; margin: 8px 0; user-select: all; color: var(--fg); }
.invite-tree { list-style: none; margin: 4px 0 12px; padding: 0; }
.invite-tree li { margin: 3px 0; padding-left: 0; }
.invite-tree li::before { content: "└ "; color: var(--muted); }
.invite-tree .tree-d2 { padding-left: 18px; }
.invite-tree .tree-d3 { padding-left: 36px; }
.invite-tree .tree-d4 { padding-left: 54px; }
.invite-tree .tree-d5 { padding-left: 72px; }
.invite-tree .tree-d6 { padding-left: 90px; }
.dup-link { margin: -4px 0 12px; }

/* ---- Hold for review, vouch-suspension overrides (roadmap item 16) ---------- */
.held-note { border-left: 3px solid var(--warn); padding: 8px 12px; margin: 0 0 10px; display: grid; gap: 6px; }
.held-note p { margin: 0; }
.card.held-note { margin-bottom: 14px; }
.held-badge { color: var(--warn); border-color: var(--warn); background: rgba(255, 207, 107, .07); }
.mb-0 { margin-bottom: 0; }
.held-off { border: 1px solid var(--warn); border-radius: 6px; padding: 8px 12px; color: var(--warn); }
.review-links { margin: 4px 0 8px; padding-left: 18px; font-size: 12px; }
.review-links li { margin: 2px 0; }
.suspension-box { border: 1px solid var(--danger); border-radius: 6px; padding: 8px 12px; margin: 8px 0 12px; }
.suspension-box h3 { margin-top: 0; }
.suspension-set { margin: 8px 0 12px; }
.suspension-set .days-input { width: 7ch; }
.suspension-history summary { cursor: pointer; margin: 6px 0; }
.suspension-box .reason-input, .suspension-set .reason-input { flex: 1 1 24ch; min-width: 24ch; }

/* ---- Milestone deals ------------------------------------------------------ */
.milestones { margin: 6px 0; padding-left: 20px; }
.milestones li { margin: 4px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.milestones li .ms-title { flex: 1 1 auto; }
.milestones li.done .ms-title { color: var(--muted); text-decoration: line-through; }
.milestones li.current .ms-title { font-weight: 700; }
.ms-rows { display: grid; grid-template-columns: 1fr 10em; gap: 6px 10px; margin-top: 6px; }

/* ---- Thread artifacts and symbol search (roadmap items 12 and 9) ------------ */
.thread-artifacts { margin-top: 10px; }
.artifact-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.artifact { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.artifact .dump-card { margin: 0; flex: 0 1 640px; }
.artifact-by { white-space: nowrap; }
.artifact-of { margin: 4px 0 8px; }
.attach-for { border-left: 3px solid var(--accent); padding: 6px 10px; margin: 0 0 10px; background: var(--bg-inset); }
.reply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.symbol-note { margin: 0 0 10px; }
.symbol-note code { font-family: var(--mono); font-size: 12px; }

/* ---- Dump symbols (roadmap item 9) ---------------------------------------- */
.sym-libs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 10px; }
.sym-table td:first-child { max-width: 48ch; }
.sym-table .tag { font-size: 11px; }

/* ---- Delivery evidence (acceptance checklist, delivery records) ----------- */
.checklist { margin: 6px 0; padding-left: 20px; }
.checklist li { margin: 3px 0; }
.evidence-fields { border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; margin: 10px 0; }
.evidence-fields legend { padding: 0 4px; font-weight: 600; }
.ev-field { margin: 8px 0; }
.ev-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
@media (max-width: 560px) { .ev-pair { grid-template-columns: 1fr; } }
.delivery { border-top: 1px solid var(--border); padding: 10px 0; }
.delivery:first-of-type { border-top: 0; }
.evidence-list { margin: 6px 0; padding-left: 20px; }
.evidence-list li { margin: 8px 0; }
.evidence-list li.not-given .ev-text { color: var(--muted); }
.ev-item { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-weight: 600; }
.ev-evidence { display: flex; flex-direction: column; gap: 2px; margin: 2px 0; }
.ack-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.ack-form input[type=text] { flex: 1 1 180px; width: auto; padding: 3px 6px; }
.tag-missing { color: #ff7b7b; border-color: #ff7b7b; }

/* --- Watching: tracking counts, dump and vendor watches -------------------- */

/* A watched or tracked thread's unread count ("5 new"). */
.unread-jump.unread-count { text-transform: none; letter-spacing: 0; }
.section-watch { margin: 0; }
.dump-watch { margin: 0 0 10px; }
.dump-watch form { display: inline; }
.vendor-watch-add { margin-top: 10px; }
.vendor-watch-add input[type="text"] { width: auto; flex: 1 1 14em; max-width: 24em; }

/* --- Culture pack: the home page banner, rot13 contacts --------------------- */

/* ASCII-art banner (aria-hidden; the h1 below it is the real heading, read by
   screen readers and shown when the art is hidden). Wide art plus a hexdump
   on desktop, a narrower art on phones, nothing below 280px. */
.home-banner { margin: 0 0 16px; }
.ascii-banner { display: flex; align-items: flex-end; gap: 28px; overflow: hidden; }
.ascii-banner pre {
  margin: 0; padding: 0; border: 0; background: none; overflow: hidden;
  font-family: var(--mono); font-size: 13px; line-height: 1.25; white-space: pre;
}
.ascii-art { color: var(--link); }
.ascii-hex { color: var(--muted); }
.ascii-narrow { display: none; }
.home-title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (max-width: 760px) { .ascii-hex { display: none; } }
@media (max-width: 560px) {
  .ascii-wide { display: none; }
  .ascii-banner .ascii-narrow { display: block; font-size: clamp(8px, 3.2vw, 13px); }
}
@media (max-width: 280px) {
  .ascii-banner { display: none; }
  .home-title { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
}

/* rot13 contact: the hint goes once rot13.js has decoded the address. */
.rot13-contact .rot13 { font-family: var(--mono); }
.rot13-hint { font-size: 12px; }

/* Signed delivery records (escrow::evidence). */
.tag-signed { color: var(--ok); border-color: var(--ok); }
.tag-unsigned { color: var(--muted); }
.sig-note { font-size: 12px; font-weight: 400; }
.sig-details { margin-top: 4px; color: var(--muted); }
.sig-details summary { cursor: pointer; }
