/* WWW Forum stylesheet.
   The five legacy skins (dark, dark_green, default, clean, plain) are colour
   themes selected by <html data-skin="...">; each keeps its original palette's
   character (khaki-on-black with navy or green accents; lavender-on-white;
   grey-on-white). */

/* ------------------------------------------------------------- themes */
:root,
[data-skin="dark"] {
  color-scheme: dark;
  --bg: #0e1014;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a303b;
  --text: #dfe2e8;
  --muted: #959cab;
  --link: #e0d28c;
  --link-hover: #f3e7a8;
  --accent: #3a3e86;
  --accent-text: #ffffff;
  --admin: #e0d28c;
  --pending: #3a1515;
  --pending-border: #8a2b2b;
  --new: #ff6b5f;
  --input-bg: #0f1218;
  --hot: #ff5a4f; --warmer: #ff7d47; --warm: #ffa94d; --cold: #d8cc84; --colder: #a7a17d;
}
[data-skin="dark_green"] {
  --accent: #2f6a3a;
  --link: #d6d08c;
}
[data-skin="default"],
[data-skin="clean"] {
  color-scheme: light;
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f6f6fb;
  --border: #dcdeea;
  --text: #1c2030;
  --muted: #646b80;
  --link: #3d3f99;
  --link-hover: #23256b;
  --accent: #5d5f9f;
  --accent-text: #ffffff;
  --admin: #7a3cb0;
  --pending: #fbe4e4;
  --pending-border: #d68080;
  --new: #d42a1e;
  --input-bg: #ffffff;
  --hot: #e01b1b; --warmer: #c43a10; --warm: #b8640a; --cold: #8a6a12; --colder: #6e5a3a;
}
[data-skin="plain"] {
  color-scheme: light;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --border: #dadada;
  --text: #1b1b1b;
  --muted: #666666;
  --link: #1d2a73;
  --link-hover: #0d1440;
  --accent: #555555;
  --accent-text: #ffffff;
  --admin: #8f2a2a;
  --pending: #f6e3e3;
  --pending-border: #c08a8a;
  --new: #c62828;
  --input-bg: #ffffff;
  --hot: #c62828; --warmer: #bf5a00; --warm: #8d6a00; --cold: #6b5a2e; --colder: #5a4a3a;
}

/* --------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }
pre { font-size: 13px; white-space: pre-wrap; overflow-x: auto; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------- header */
.banner { display: block; text-align: center; padding: 12px 16px 0; }
.banner img { max-height: 260px; border-radius: 10px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  margin-top: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); margin-right: auto; }
.brand:hover { color: var(--text); }
.topbar form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.topbar .who { color: var(--muted); font-size: 14px; }
.topbar .who strong { color: var(--text); }
.search input[type=search] { width: 200px; }

/* ------------------------------------------------------------- layout */
main { padding-top: 26px; padding-bottom: 24px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--link); }
.crumbs .sep { margin: 0 6px; opacity: .6; }
.crumbs .here { color: var(--text); font-weight: 600; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin: 0 0 14px; }
.page-head h1 { font-size: 22px; line-height: 1.25; margin: 0; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 18px;
  overflow: hidden;
}
.panel-body { padding: 16px 18px; }
.panel-foot {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.alert {
  border: 1px solid var(--pending-border); background: var(--pending);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 14px;
}
.notice { text-align: center; padding: 28px 18px; color: var(--muted); }

/* ------------------------------------------------------------- tables */
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.list thead th {
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2);
}
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.list .num { text-align: center; width: 1%; white-space: nowrap; color: var(--muted); }
.list .last { width: 1%; white-space: nowrap; font-size: 13px; }
.list .pick { width: 1%; }
.list tr.group th {
  background: var(--accent); color: var(--accent-text);
  font-size: 13px; letter-spacing: .03em; text-transform: none; font-weight: 600;
}
.list tr.pending td { background: var(--pending); }
.title-link { font-weight: 600; font-size: 15px; }
.desc { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.meta-mobile { display: none; }

/* age colouring of "last post" (dsp_forum's hot/cold scale) */
.age-hot { color: var(--hot); font-weight: 600; }
.age-warmer { color: var(--warmer); font-weight: 600; }
.age-warm { color: var(--warm); }
.age-cold { color: var(--cold); }
.age-colder { color: var(--colder); }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px; vertical-align: 2px; margin-left: 4px;
  border: 1px solid currentColor; letter-spacing: .02em; white-space: nowrap;
}
.badge-new { color: var(--new); }
.badge-admin { color: var(--admin); }
.author-admin { color: var(--admin); font-weight: 600; }
.badge-state { color: var(--muted); }
.badge-pending { color: var(--pending-border); }

/* -------------------------------------------------------------- posts */
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  margin: 0 0 14px; overflow: hidden; scroll-margin-top: 80px;
}
.post:target { box-shadow: 0 0 0 2px var(--link); }
.post.pending { border-color: var(--pending-border); }
.post.pending .post-head { background: var(--pending); }
.post-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.post-head .author { font-weight: 700; }
.post.by-admin .author { color: var(--admin); }
.post-head .real, .post-head .email { color: var(--muted); font-size: 13px; }
.post-head .meta { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.post-head .meta a { color: var(--muted); }
.post-head .meta a:hover { color: var(--link); }
.post-body { padding: 14px 16px; overflow-wrap: anywhere; }
.post-body img { border-radius: 6px; }
.post-context { font-size: 13px; color: var(--muted); margin: 18px 0 6px; }

/* -------------------------------------------------------------- forms */
input[type=text], input[type=password], input[type=search], select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; max-width: 100%;
}
textarea { width: 100%; min-height: 180px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent); }
.btn, button, input[type=submit] {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: 7px; padding: 6px 14px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  display: inline-block; text-decoration: none; line-height: 1.4;
}
.btn:hover, button:hover, input[type=submit]:hover { border-color: var(--link); text-decoration: none; color: var(--text); }
.btn-primary, input[type=submit].btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}
.btn-primary:hover, input[type=submit].btn-primary:hover { filter: brightness(1.15); color: var(--accent-text); border-color: var(--accent); }
.btn-danger:hover { border-color: var(--new); color: var(--new); }
.form { display: grid; gap: 16px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
  cursor: pointer; font-size: 14px;
}
.choice:has(input:checked) { border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.choice input[type=text] { padding: 2px 8px; width: 9em; }
.error { color: var(--new); font-size: 13px; margin-top: 4px; }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------- footer */
.site-footer { padding-bottom: 32px; }
.footer-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  border-top: 1px solid var(--border); padding-top: 14px; font-size: 14px; color: var(--muted);
}
.footer-bar form { display: flex; align-items: center; gap: 6px; margin: 0; }
.online strong { color: var(--text); font-weight: 600; }
details.account { margin: 0 0 14px; }
details.account > summary { cursor: pointer; color: var(--link); font-size: 14px; font-weight: 600; }
details.account .panel { margin-top: 10px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.fnord { text-align: center; font-size: 12px; color: var(--muted); font-style: italic; margin-top: 18px; }

/* ------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .banner img { max-height: 150px; }
  .topbar { position: static; }
  .brand { width: 100%; }
  .search input[type=search] { width: 150px; }
  .list .hide-sm { display: none; }
  .list th, .list td { padding: 9px 10px; }
  .meta-mobile { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
  .post-head .meta { margin-left: 0; width: 100%; }
  .page-head h1 { font-size: 19px; }
  .stats-table th:nth-child(n+3), .stats-table td:nth-child(n+3) { font-size: 12px; }
}
