/*
 * 90Sec Geist for Discuz X5 (turing_dz20, styleid 5).
 * A presentation layer only: loaded after the template CSS, no markup changes.
 * Mirrors the forum.90sec.com Discourse theme tokens.
 */

@font-face {
  font-family: Geist;
  src: url("fonts/geist-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Radix Colors: gray 1 bg, 2 surface, 3 hover, 4 selected, 6 separators,
   7 control borders, 8 hovered borders, 11 secondary text, 12 text;
   blue 8 focus ring, 11 links. */
:root {
  --g-bg: #fcfcfc;
  --g-surface: #f9f9f9;
  --g-fg: #202020;
  --g-muted: #646464;
  --g-border: #d9d9d9;
  --g-border-control: #cecece;
  --g-border-strong: #bbb;
  --g-hover: #f0f0f0;
  --g-active: #e8e8e8;
  --g-link: #0d74ce;
  --g-focus: #5eb1ef;
  --g-hairline: 0.5px;
  --g-radius-sm: 6px;
  /* Four sizes: 12 meta, 14 UI, 16 reading, 24 titles. */
  --g-text-sm: 12px;
  --g-text-md: 14px;
  --g-text-lg: 16px;
  --g-text-xl: 24px;
  --g-sans: "Geist", -apple-system, blinkmacsystemfont, "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC",
    "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --g-mono: "Geist Mono", "SFMono-Regular", consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --g-bg: #111;
    --g-surface: #191919;
    --g-fg: #eee;
    --g-muted: #b4b4b4;
    --g-border: #3a3a3a;
    --g-border-control: #484848;
    --g-border-strong: #606060;
    --g-hover: #222;
    --g-active: #2a2a2a;
    --g-link: #70b8ff;
    --g-focus: #2870bd;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

html body {
  background: var(--g-bg);
  color: var(--g-fg);
  font: var(--g-text-md)/1.6 var(--g-sans);
  -webkit-font-smoothing: antialiased;
}

body a {
  color: var(--g-fg);
}

body a:hover {
  color: var(--g-fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

body :is(input, textarea, select, button) {
  font-family: var(--g-sans);
}

body :is(.xg1, .xg1 a, .xg2, .xg2 a, .xi1) {
  color: var(--g-muted);
}

/* Inline "|" separators become plain spacing. */
body .pipe {
  color: transparent;
}

body :is(a, button, input, textarea, select):focus-visible {
  outline: 2px solid var(--g-focus);
  outline-offset: 2px;
}

/* ---------- Layout: fluid, centered, no sideways scroll ---------- */

body .wp,
body #wp.wp,
body #ct.wp {
  box-sizing: border-box;
  width: auto;
  max-width: 1200px;
  margin-inline: auto;
}

body #wp.wp {
  min-width: 0;
  margin-top: 0;
  padding: 0 24px 48px;
  border: 0;
  background: transparent;
}

body #ct.wp {
  padding: 0;
}

/* The thread view's template indents #ct by 25px off the content edge. */
body #wp #ct.wp {
  margin-inline: 0;
}

body #ct .mn {
  float: none;
  width: auto;
  margin: 0;
}

body > br {
  display: none;
}

/* ---------- Header ---------- */

body #top_nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  min-height: 56px;
  background: color-mix(in srgb, var(--g-bg) 88%, transparent);
  border-bottom: var(--g-hairline) solid var(--g-border);
  backdrop-filter: saturate(180%) blur(8px);
}

body #top_nav .login90sec-topbar,
body #top_nav > .wp {
  height: 56px;
  min-height: 56px;
  padding-inline: 24px;
}

body #top_nav .login90sec-brand img {
  height: 26px;
}

/* The template points at the near-white logo; flip it for the light header. */
@media (prefers-color-scheme: light) {
  body #top_nav .login90sec-brand img {
    filter: invert(1);
  }
}

body #top_nav .login90sec-usernav {
  gap: 4px;
  margin-inline-end: -10px;
}

body #top_nav a.login90sec-brand {
  padding: 0;
}

/* An inline template style forces #top_nav a to #c9c9c9 with !important. */
body #top_nav .login90sec-usernav a,
body #top_nav a {
  color: var(--g-muted) !important;
  font-size: var(--g-text-md);
  line-height: 32px;
  padding: 0 10px;
  border-radius: var(--g-radius-sm);
  text-decoration: none;
}

body #top_nav .login90sec-usernav a:hover {
  background: var(--g-hover);
  color: var(--g-fg) !important;
}

body #top_nav .login90sec-current-user {
  color: var(--g-fg) !important;
  font-weight: 500;
}

/* ---------- Breadcrumb ---------- */

body #pt {
  margin: 0;
  padding: 20px 0 8px;
  border: 0;
  background: none;
}

/* The template floats the trail inside a fixed-height bar; when it wraps on a
   phone the float spills out and squeezes the main column to zero width. */
body #pt {
  height: auto;
}

body #pt .z {
  float: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  padding: 0;
}

body #pt .z > * {
  float: none;
}

body #pt .z,
body #pt .z a,
body #pt .z em {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-style: normal;
}

body #pt .z a:last-child {
  color: var(--g-fg);
}

/* The home link is an off-screen-text icon; it only adds an indent here. */
body #pt .nvhm,
body #pt .nvhm + em {
  display: none;
}

/* ---------- Generic blocks ---------- */

body .bm,
body .bn,
body .bm.bmw,
body .mn .fl .bmw {
  margin-bottom: 24px;
  border: 0;
  background: transparent;
}

body .bm_h,
body .bm .bm_h {
  height: auto;
  padding: 12px 0;
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: none;
  line-height: 1.4;
}

body .bm_h h2,
body .bm_h h2 a,
body .bm_h h1,
body .bm_h h1 a {
  color: var(--g-fg);
  font-size: var(--g-text-lg);
  font-weight: 600;
}

body .bm_c {
  padding: 0;
}

/* ---------- Forum index ---------- */

body .fl {
  border: 0;
  background: transparent;
}

body .fl .bm_h {
  padding: 28px 0 10px;
}

/* A single forum group never needs collapsing. */
body .fl .bm_h .o {
  display: none;
}

body .fl .bm_h h2,
body .fl .bm_h h2 a {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Separate borders: collapsed tables round hairlines to whole pixels and let
   the template's 1px dashed rules win. */
body .fl_tb {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

body .fl_tb td {
  padding: 16px 12px;
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  vertical-align: middle;
}

/* Text starts and ends on the content edges. */
body .fl_tb td.fl_icn + td {
  padding-left: 0;
}

body .fl_tb tr > td:last-child {
  padding-right: 0;
}

/* Forum icons (speech bubbles) add noise without meaning; the column goes. */
body .fl_tb .fl_icn {
  display: none;
}

body .fl_tb h2,
body .fl_tb h2 a {
  margin: 0 0 4px;
  color: var(--g-fg);
  font-size: var(--g-text-lg);
  font-weight: 600;
}

/* Admin-colored forum names fall back to the foreground color. */
body .fl_tb h2 a[style] {
  color: var(--g-fg) !important;
}

body .fl_tb p.xg2,
body .fl_tb .xg2 {
  color: var(--g-muted);
  font-size: var(--g-text-md);
  line-height: 1.6;
}

/* Descriptions repeat in Chinese and English; the first line is enough. */
body .fl_tb p.xg2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

body .fl_tb p.xg2 font,
body .fl_tb .xg2 font {
  color: var(--g-muted) !important;
}

body .fl_tb .fl_i {
  width: 90px;
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

body .fl_tb .fl_i .xi2 {
  color: var(--g-fg);
  font-weight: 500;
}

body .fl_tb .fl_by {
  width: 220px;
  color: var(--g-muted);
  font-size: var(--g-text-sm);
}

body .fl_tb .fl_by a {
  color: var(--g-fg);
}

body .fl_tb .fl_by cite,
body .fl_tb .fl_by cite a {
  color: var(--g-muted);
}

/* Who's online and friend links. */
body #online .bm_h,
body .lk .bm_h {
  padding-top: 28px;
}

body #online .bm_h h3,
body #online .bm_h h3 a,
body .lk .bm_h h3 {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-weight: 500;
}

body .lk .m li {
  border: 0;
}

body .lk_logo {
  padding: 16px 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
}

body .lk_logo img {
  height: 28px;
  width: auto;
  margin-right: 12px;
}

@media (prefers-color-scheme: dark) {
  body .lk_logo img[src*="90sec-logo.svg"] {
    filter: invert(1);
  }
}

body .lk_content h5,
body .lk_content h5 a {
  color: var(--g-fg);
  font-size: var(--g-text-md);
  font-weight: 600;
}

/* ---------- Forum display ---------- */

/* Core sets .xs2 { font-size: 14px !important }. */
body .bml .bm_h h1,
body .bml .bm_h h1.xs2 {
  font-size: var(--g-text-xl) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

body .bml .bm_h h1 a {
  font-size: inherit;
  font-weight: inherit;
}

body .bml .bm_h {
  padding: 8px 0 16px;
}

body .bml .bm_h .xs1 {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  letter-spacing: 0;
}

body .bml .bm_h .xs1 strong,
body .bml .bm_h .xs1 .xi1 {
  color: var(--g-fg);
  font-weight: 500;
}

/* Thread type filter as underline tabs. */
body #thread_types {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: none;
}

body #thread_types li {
  float: none;
  margin: 0;
  border: 0;
  background: none;
}

body #thread_types li a {
  display: block;
  height: auto;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--g-muted);
  font-size: var(--g-text-md);
  line-height: 20px;
}

body #thread_types li a:hover {
  color: var(--g-fg);
  text-decoration: none;
}

body #thread_types li.a a,
body #thread_types li.xw1 a {
  border-bottom-color: var(--g-fg);
  color: var(--g-fg);
  font-weight: 500;
}

body #threadlist {
  border: 0;
  background: transparent;
}

body #threadlist .th {
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: none;
}

body #threadlist .th,
body #threadlist .th a,
body #threadlist .th td,
body #threadlist .th th {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-weight: 400;
}

body #threadlist .th .tf a.xw1,
body #threadlist .th a.a {
  color: var(--g-fg);
  font-weight: 500;
}

body #threadlisttableid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

body #threadlisttableid tbody td,
body #threadlisttableid tbody th {
  padding: 14px 8px;
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: none;
}

body #threadlisttableid th a.s.xst,
body #threadlisttableid th .xst {
  color: var(--g-fg);
  font-size: var(--g-text-lg);
  font-weight: 500;
}

body #threadlisttableid th a.s.xst[style] {
  color: var(--g-fg) !important;
}

body #threadlisttableid th em a,
body #threadlisttableid th em {
  color: var(--g-muted);
  font-style: normal;
}

body #threadlisttableid td.by cite,
body #threadlisttableid td.by cite a {
  color: var(--g-fg);
  font-size: var(--g-text-sm);
}

body #threadlisttableid td.by cite a[style],
body #threadlisttableid td.by cite font {
  color: var(--g-fg) !important;
}

body #threadlisttableid td.by em,
body #threadlisttableid td.by em a,
body #threadlisttableid td.by em span,
body #threadlisttableid td.num,
body #threadlisttableid td.num a,
body #threadlisttableid td.num em {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

/* Pin markers are inline SVGs. */
body #threadlisttableid .tpin svg {
  width: 14px;
  height: 14px;
}

body #threadlisttableid .tpin svg path {
  fill: var(--g-muted);
}

body #threadlisttableid td.icn img {
  opacity: 0.45;
  filter: grayscale(1);
}

body #threadlisttableid #separatorline th,
body #threadlisttableid #separatorline td {
  padding: 4px 0;
  background: var(--g-surface);
}

body #autopbn {
  height: auto;
  margin: 16px 0;
  padding: 10px 0;
  border: var(--g-hairline) solid var(--g-border-control);
  border-radius: var(--g-radius-sm);
  background: var(--g-bg);
  color: var(--g-fg);
  font-size: var(--g-text-md);
  line-height: 20px;
  text-align: center;
}

body #autopbn:hover {
  background: var(--g-hover);
  text-decoration: none;
}

/* ---------- Pagination & buttons ---------- */

body .pg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  float: right;
}

body .pg a,
body .pg strong,
body .pg label,
body .pgb a {
  float: none;
  height: auto;
  min-width: 32px;
  margin: 0;
  padding: 0 10px;
  box-sizing: border-box;
  border: var(--g-hairline) solid var(--g-border-control);
  border-radius: var(--g-radius-sm);
  background: var(--g-bg);
  color: var(--g-fg);
  font-size: var(--g-text-md);
  line-height: 30px;
  text-align: center;
}

body .pg a:hover,
body .pgb a:hover {
  background: var(--g-hover);
  text-decoration: none;
}

/* Previous / next are text buttons, not arrow sprites. */
body .pg a.nxt,
body .pg a.prev {
  width: auto;
  padding: 0 10px;
  background-image: none;
}

body .pg strong {
  border-color: var(--g-fg);
  background: var(--g-fg);
  color: var(--g-bg);
}

body .pg label .px {
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--g-fg);
}

body .pgb a {
  display: inline-block;
  padding-left: 12px;
  background-image: none;
}

body .pgsbtn,
body #newspecial,
body #newspecialtmp {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: var(--g-fg);
  color: var(--g-bg);
  font-size: var(--g-text-md);
  font-weight: 500;
  line-height: 32px;
}

body .pn,
body button.pn,
body .pnc {
  height: 32px;
  padding: 0 14px;
  border: var(--g-hairline) solid var(--g-border-control);
  border-radius: var(--g-radius-sm);
  background: var(--g-bg);
  box-shadow: none;
  color: var(--g-fg);
  font-size: var(--g-text-md);
  font-weight: 500;
}

body .pn em,
body .pn span,
body .pn strong {
  padding: 0;
  background: none;
  color: inherit;
  line-height: 30px;
}

body .pnc,
body button.pnc {
  border-color: var(--g-fg);
  background: var(--g-fg);
  color: var(--g-bg);
}

body .px,
body .pt,
body textarea.pt,
body select.ps {
  box-sizing: border-box;
  padding: 6px 10px;
  border: var(--g-hairline) solid var(--g-border-strong);
  border-radius: var(--g-radius-sm);
  background: var(--g-bg);
  box-shadow: none;
  color: var(--g-fg);
  font-size: var(--g-text-md);
}

/* ---------- Thread view ---------- */

body #postlist {
  border: 0;
  background: transparent;
}

body #postlist > table:first-child td.plc,
body #postlist td.vwthd {
  padding: 8px 80px 20px 0;
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: none;
}

body #postlist h1.ts {
  color: var(--g-fg);
  font-size: var(--g-text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

body #postlist h1.ts a,
body #postlist h1.ts span {
  color: var(--g-fg);
}

body #postlist h1.ts #thread_subject {
  font-size: inherit;
}

body #postlist .plhin {
  width: 100%;
  border: 0;
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: transparent;
}

body #postlist .plhin td.plc,
body #postlist .plhin td.pls {
  border: 0;
  background: transparent;
}

body #postlist .pi,
body #postlist .authi {
  border: 0;
  color: var(--g-muted);
  font-size: var(--g-text-md);
}

body #postlist .authi a.xw1 {
  color: var(--g-fg);
  font-weight: 600;
}

body #postlist .avatar img,
body #postlist .avtm img,
body #postlist img.user_avatar {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}

/* Post body keeps its own height; the template padded every post to 100px. */
body #postlist .t_fsz {
  min-height: 0;
}

/* Status stamp stays as a quiet marker. */
body #threadstamp img {
  opacity: 0.35;
  filter: grayscale(1);
}

body #postlist .t_f,
body #postlist .t_fsz,
body #postlist .pcb {
  color: var(--g-fg);
  font-size: var(--g-text-lg);
  line-height: 1.8;
}

body #postlist .t_f a {
  color: var(--g-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

body #postlist .t_f font[color] {
  color: inherit;
}

/* Reply subjects, legacy <font size> and post numbers join the type scale. */
body #postlist .pcb h2 {
  margin-bottom: 8px;
  font-size: var(--g-text-lg);
  font-weight: 600;
}

body #postlist .t_f font[size] {
  font-size: inherit;
}

body #postlist sup {
  font-size: var(--g-text-sm);
}

body .blockcode,
body #postlist .blockcode {
  margin: 12px 0;
  padding: 0;
  border: var(--g-hairline) solid var(--g-border);
  border-radius: var(--g-radius-sm);
  background: var(--g-surface);
  overflow: auto;
}

body .blockcode ol,
body .blockcode li,
body .blockcode div {
  background: transparent;
  color: var(--g-fg);
  font: var(--g-text-md)/1.65 var(--g-mono);
}

body .blockcode em {
  margin: 0;
  padding: 6px 12px;
  color: var(--g-muted);
  font-size: var(--g-text-sm);
  font-style: normal;
}

body .quote,
body #postlist .quote {
  margin: 12px 0;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--g-radius-sm);
  background: var(--g-surface);
  color: var(--g-fg);
}

body .quote blockquote {
  margin: 0;
  padding: 0;
  background: none;
}

/* The template fades post actions to 20% until hover. */
body #postlist .po,
body #postlist .po.hin,
body #postlist .pob {
  border: 0;
  background: transparent;
  opacity: 1;
}

body #postlist .pob a,
body #postlist .po a {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
}

/* Action icons are colored GIFs; keep them neutral like the text. */
body #postlist .po a,
body #postlist .pob a {
  filter: grayscale(1);
}

body #postlist .sign {
  border-top: var(--g-hairline) solid var(--g-border);
  color: var(--g-muted);
  font-size: var(--g-text-sm);
}

/* Rating buttons use a light sprite; draw them as surface buttons instead. */
body #p_btn a {
  height: auto;
  margin: 0 4px;
  padding: 0 12px;
  border: var(--g-hairline) solid var(--g-border-control);
  border-radius: var(--g-radius-sm);
  background: var(--g-bg);
  color: var(--g-fg);
  font-size: var(--g-text-md);
  line-height: 30px;
}

body #p_btn a i,
body #p_btn a span {
  padding: 0;
  background: none;
  color: inherit;
}

body #p_btn a:hover {
  background: var(--g-hover);
  text-decoration: none;
}

/* Template rules and frames that stay light in dark mode. */
body #pgt {
  border-bottom-color: var(--g-border);
}

body #postlist td.pls {
  border-color: var(--g-border);
  background: transparent;
}

body #postlist a[id^="postnum"] {
  border-color: transparent;
  color: var(--g-muted);
}

body #modmenu,
body #modmenu a,
body .xi2.mbm.pbm,
body .xi2.mbm.pbm a {
  color: var(--g-muted);
  font-size: var(--g-text-sm);
}

/* ---------- Search landing (search/pubsearch.htm) ----------
   The page embeds an old "90WiKi" landing whose Bootstrap CSS and logo file
   no longer exist; draw its navbar and form with the site tokens instead. */

body#nv_search .navbar {
  border-bottom: var(--g-hairline) solid var(--g-border);
  background: var(--g-bg);
}

body#nv_search .navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  max-width: 1200px;
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
}

body#nv_search .navbar-brand {
  display: block;
  width: 60px;
  height: 28px;
  background: url("../../../static/image/common/90sec-logo.svg?v=2") left center / contain no-repeat;
}

@media (prefers-color-scheme: dark) {
  body#nv_search .navbar-brand {
    background-image: url("../../../static/image/common/90sec-logo-dark.svg?v=2");
  }
}

body#nv_search .navbar-brand img,
body#nv_search .navbar-toggler {
  display: none;
}

body#nv_search .navbar-collapse {
  display: block;
}

body#nv_search .navbar-nav {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body#nv_search .navbar-nav .nav-link {
  display: block;
  padding: 0 10px;
  border-radius: var(--g-radius-sm);
  color: var(--g-muted);
  font-size: var(--g-text-md);
  line-height: 32px;
}

body#nv_search .navbar-nav .nav-link:hover {
  background: var(--g-hover);
  color: var(--g-fg);
  text-decoration: none;
}

body#nv_search .navbar ~ br {
  display: none;
}

body#nv_search #scform {
  width: 100%;
  max-width: 640px;
  margin: 72px auto 32px !important;
}

body#nv_search #scform_form {
  width: 100%;
  table-layout: fixed;
  background: none;
}

body#nv_search #scform_form .td_srchbtn {
  width: 96px;
}

body#nv_search #scform_form td {
  padding: 0;
  border: 0;
  background: none;
}

body#nv_search #scform_form .td_srchtxt {
  width: 100%;
}

body#nv_search #scform_srchtxt {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: var(--g-hairline) solid var(--g-border-strong);
  border-radius: var(--g-radius-sm) 0 0 var(--g-radius-sm);
  background: var(--g-bg);
  color: var(--g-fg);
  font-size: var(--g-text-lg);
}

/* Core search CSS hides the real button (opacity: 0) behind a sprite. */
body#nv_search #scform_submit {
  opacity: 1;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background-image: none;
  font-size: var(--g-text-lg);
  border: var(--g-hairline) solid var(--g-fg);
  border-radius: 0 var(--g-radius-sm) var(--g-radius-sm) 0;
  background: var(--g-fg);
  color: var(--g-bg);
  cursor: pointer;
}

body#nv_search #scform_submit strong {
  color: inherit;
  font-size: var(--g-text-lg);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 760px) {
  body#nv_search .navbar .container {
    padding: 0 12px;
  }

  body#nv_search #scform {
    margin: 40px auto 24px !important;
    padding: 0 16px;
    box-sizing: border-box;
  }
}

/* ---------- Messages, login, footer ---------- */

body #messagetext,
body .alert_info,
body .alert_right,
body .alert_error {
  border: var(--g-hairline) solid var(--g-border);
  border-radius: var(--g-radius-sm);
  background: var(--g-surface);
  color: var(--g-fg);
  font-size: var(--g-text-md);
}

body #messagetext p,
body .alert_info p {
  color: var(--g-fg);
}

body #messagetext a {
  color: var(--g-link);
}

body #ft {
  margin-top: 24px;
  padding: 20px 24px 32px;
  border-top: var(--g-hairline) solid var(--g-border);
  color: var(--g-muted);
  font-size: var(--g-text-sm);
}

body #ft a,
body #ft p,
body #ft strong,
body #ft em {
  color: var(--g-muted);
  font-weight: 400;
}

body #scrolltop {
  border: 0;
  background: none;
}

body #scrolltop a {
  border: var(--g-hairline) solid var(--g-border-control);
  border-radius: var(--g-radius-sm);
  background-color: var(--g-bg);
}

/* ---------- Dark mode: template colors baked into the old CSS ---------- */

@media (prefers-color-scheme: dark) {
  body :is(#wp, #ct, .mn, .bm, .bm_c, .fl, .tl, table, tbody, tr) {
    background-color: transparent;
  }

  body :is(.fl_tb td, #threadlisttableid td, #threadlisttableid th) {
    border-color: var(--g-border);
  }

  body :is(h1, h2, h3, h4, h5, strong, b, td, th, p, li, span, em, label) {
    color: inherit;
  }

  body .icn img {
    filter: grayscale(1) invert(1);
  }

  body .menu,
  body .p_pop,
  body .p_pof,
  body .sllt {
    border-color: var(--g-border);
    background: var(--g-surface);
    color: var(--g-fg);
  }
}

/* ---------- Small screens (header.htm sets width=device-width) ---------- */

@media (max-width: 760px) {
  body #wp.wp {
    padding-inline: 16px;
  }

  body #top_nav,
  body #top_nav .login90sec-topbar {
    height: 52px;
    min-height: 52px;
  }

  body #top_nav .login90sec-topbar {
    padding-inline: 12px;
  }

  body #top_nav .login90sec-brand img {
    height: 22px;
  }

  body #top_nav .login90sec-usernav {
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body #top_nav .login90sec-usernav a {
    padding: 0 7px;
    font-size: var(--g-text-md);
  }

  body #pt {
    padding-top: 14px;
  }

  /* Forum index: title + description only, counts stay on one line. */
  body .fl_tb .fl_by {
    display: none;
  }

  body .fl_tb td {
    padding: 14px 4px;
  }

  body .fl_tb .fl_i {
    width: 60px;
    font-size: var(--g-text-sm);
    white-space: nowrap;
  }

  /* Forum display. */
  body .bml .bm_h h1,
  body .bml .bm_h h1.xs2 {
    font-size: var(--g-text-xl) !important;
  }

  body .bml .bm_h .xs1 {
    display: block;
    margin-top: 4px;
  }

  /* Recycle bin / admin links drop below the title instead of overlapping. */
  body .bml .bm_h > .y {
    float: none;
    display: block;
    margin-bottom: 8px;
  }

  body #thread_types {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body #thread_types li a {
    white-space: nowrap;
  }

  body #threadlisttableid td.by,
  body #threadlisttableid td.num,
  body #threadlist .th td.by,
  body #threadlist .th td.num {
    display: none;
  }

  /* Fixed layout keeps the hidden columns' widths; let the title column grow. */
  body #threadlisttableid {
    table-layout: auto;
  }

  body #threadlisttableid tbody th {
    width: auto;
  }

  body #threadlisttableid tbody td,
  body #threadlisttableid tbody th {
    padding: 12px 4px;
  }

  body #threadlisttableid th a.s.xst,
  body #threadlisttableid th .xst {
    font-size: var(--g-text-lg);
  }

  body .pg {
    float: none;
    justify-content: flex-start;
    margin-top: 8px;
  }

  /* Thread view. */
  body #postlist h1.ts {
    font-size: var(--g-text-xl);
  }

  body #postlist > table:first-child td.plc,
  body #postlist td.vwthd {
    padding-right: 0;
  }

  body #threadstamp {
    display: none;
  }

  body #postlist .plhin td.plc {
    padding-inline: 0;
  }

  body #postlist .t_f,
  body #postlist .t_fsz,
  body #postlist .pcb {
    font-size: var(--g-text-lg);
    line-height: 1.75;
    overflow-wrap: anywhere;
  }

  body #postlist .t_f img,
  body #postlist .pcb img {
    max-width: 100%;
    height: auto;
  }

  body #postlist .t_table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  body #modmenu,
  body .xi2.mbm.pbm {
    line-height: 1.9;
  }

  /* Forms. */
  body :is(.px, .pt, textarea.pt, select.ps) {
    max-width: 100%;
    font-size: var(--g-text-lg);
  }

  body #ft {
    padding-inline: 16px;
  }
}
