/* ==========================================================================
   Residence Support Committee – resident forum
   Brand colours taken from majorhousingassociation.uk:
   deep teal #002B38 and orange #EA8E0D. Headings in Montserrat (as the main
   site), body text in Source Sans 3. Fonts are self-hosted in /assets/fonts.
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-var.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-italic-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --teal-900: #002b38;   /* brand */
  --teal-800: #0a3b4a;
  --teal-700: #145266;
  --teal-600: #0b5c72;   /* links on light backgrounds */
  --teal-100: #e3ecee;
  --teal-50:  #f0f5f6;
  --orange:   #ea8e0d;   /* brand */
  --orange-600: #c97606;
  --orange-ink: #8f5300; /* orange text that passes contrast on light */
  --orange-50: #fdf3e4;

  --bg: #f6f4ef;         /* warm paper */
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #15242b;
  --ink-2: #33444b;
  --muted: #5c6b71;
  --line: #e4e0d7;
  --line-strong: #cfcac0;
  --link: var(--teal-600);
  --focus: #ea8e0d;

  --danger: #b3261e;
  --danger-50: #fbeceb;
  --ok: #1d6b45;
  --ok-50: #e6f3ec;
  --warn-ink: #7a4b00;
  --warn-50: #fdf1dc;

  --btn-bg: var(--teal-900);
  --btn-bg-hover: var(--teal-700);
  --btn-ink: #ffffff;

  --font-head: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 0 rgba(0, 43, 56, .04), 0 1px 2px rgba(0, 43, 56, .06);
  --wrap: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal-600: #7cc7da;
    --teal-100: #1b3640;
    --teal-50:  #142a32;
    --orange-ink: #f3b04d;
    --orange-50: #33260f;
    --bg: #0d1a1f;
    --surface: #132229;
    --surface-2: #172a32;
    --ink: #e7eef0;
    --ink-2: #c8d4d8;
    --muted: #93a6ad;
    --line: #23363e;
    --line-strong: #2f4650;
    --danger: #f08a80;
    --danger-50: #3a1c1a;
    --ok: #7fd3a5;
    --ok-50: #16301f;
    --warn-ink: #f3c46e;
    --warn-50: #33280f;
    --btn-bg: #1f5f72;
    --btn-bg-hover: #287489;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .h3 { font-family: var(--font-head); line-height: 1.22; margin: 0 0 .5rem; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.05rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3, .h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .9rem; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
code { font-size: .88em; background: var(--teal-50); color: var(--ink-2); padding: .08em .35em; border-radius: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
main { flex: 1; }
main.page { padding: 28px 0 64px; }
.muted { color: var(--muted); }
.small, small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--ink-2); }
.eyebrow { font-family: var(--font-head); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-ink); margin: 0 0 .75rem; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: #fff; color: var(--teal-900); padding: 10px 14px; font-weight: 700; }
.icon { width: 22px; height: 22px; flex: none; }

/* ---------- Header ---------- */
.site-header { background: var(--teal-900); color: #fff; border-top: 4px solid var(--orange); position: relative; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; color: #fff; text-decoration: none; margin-right: auto; padding: 12px 0; }
.brand img { width: 124px; height: 40px; }
.brand-rule { width: 1px; align-self: stretch; background: rgba(255, 255, 255, .28); margin: 4px 0; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: .82rem; line-height: 1.25; letter-spacing: .06em; text-transform: uppercase; max-width: 11.5em; }
.site-nav { display: flex; align-items: center; gap: 6px 24px; flex-wrap: wrap; }
.site-nav a, .nav-plain {
  color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 600; font-size: .98rem;
  padding: 6px 0; border-bottom: 2px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit; cursor: pointer;
}
.site-nav a:hover, .nav-plain:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, .5); }
.site-nav a.is-active { color: #fff; border-bottom-color: var(--orange); }
.site-nav .btn { border-bottom: 0; padding: .5rem .95rem; color: var(--teal-900); }
.site-nav .btn:hover { color: var(--teal-900); }
.nav-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .22); }
.nav-user { display: inline-flex; align-items: center; gap: 8px; }
.nav-user span { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; }
.count { display: inline-block; min-width: 1.45em; padding: 0 .4em; margin-left: 4px; border-radius: 999px; background: var(--orange); color: var(--teal-900); font-size: .74rem; font-weight: 700; line-height: 1.45em; text-align: center; vertical-align: 1px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-900); color: rgba(255, 255, 255, .78); font-size: .95rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 40px; padding: 52px 0 40px; }
.footer-brand img { width: 149px; height: 48px; margin-bottom: 16px; }
.footer-brand p { max-width: 30ch; }
.footer-title { font-family: var(--font-head); color: #fff; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-notice { border-left: 3px solid var(--orange); padding-left: 20px; }
.footer-link-strong { font-weight: 700; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .14); padding: 18px 0 24px; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; font-size: .85rem; color: rgba(255, 255, 255, .6); }
.footer-base p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: .66rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid var(--btn-bg);
  background: var(--btn-bg); color: var(--btn-ink); font-family: var(--font-body); font-size: 1rem; font-weight: 700;
  line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); color: var(--btn-ink); }
.btn .icon { width: 18px; height: 18px; }
.btn-accent { background: var(--orange); border-color: var(--orange); color: var(--teal-900); }
.btn-accent:hover { background: #f4a12f; border-color: #f4a12f; color: var(--teal-900); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: currentColor; }
.btn-danger:hover { background: var(--danger-50); color: var(--danger); border-color: currentColor; }
.btn-light { background: #fff; border-color: #fff; color: var(--teal-900); }
.btn-light:hover { background: var(--teal-100); border-color: var(--teal-100); color: var(--teal-900); }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }
.btn-sm { padding: .42rem .8rem; font-size: .9rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.06rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form label { display: grid; gap: 6px; font-weight: 600; color: var(--ink); }
.form label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .66rem .8rem;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-700); box-shadow: 0 0 0 3px rgba(234, 142, 13, .35); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 18px; height: 18px; margin-top: .2em; accent-color: var(--teal-900); flex: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { font-size: .88rem; color: var(--muted); margin: -8px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }
.form-foot a { font-weight: 600; }
.form-links { display: flex; gap: 6px 20px; flex-wrap: wrap; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.empty { text-align: center; padding: 40px 24px; }
.empty .icon { width: 36px; height: 36px; color: var(--muted); margin: 0 auto 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .25rem; }
.page-head p { margin: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }
.crumb-sep { color: var(--line-strong); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel-title h2 { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* ---------- Flash messages ---------- */
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid; border-left-width: 4px; background: var(--surface); }
.flash p:last-child, .flash ul { margin-bottom: 0; }
.flash ul { padding-left: 20px; margin-top: 4px; }
.flash-success { border-color: var(--ok); background: var(--ok-50); color: var(--ink); }
.flash-info { border-color: var(--teal-700); background: var(--teal-50); color: var(--ink); }
.flash-error { border-color: var(--danger); background: var(--danger-50); color: var(--ink); }
.flash-error p:first-child { font-weight: 600; }
.flash-stack { padding-top: 20px; }

/* ---------- Forum masthead (home) ---------- */
.masthead { background: var(--teal-900); color: #fff; padding: 36px 0 34px; position: relative; overflow: hidden; }
.masthead::after {
  content: ""; position: absolute; right: -60px; top: -40px; width: 320px; height: 320px;
  background: repeating-linear-gradient(90deg, rgba(234, 142, 13, .9) 0 22px, transparent 22px 40px);
  border-radius: 28px; opacity: .14; transform: rotate(0deg); pointer-events: none;
}
.masthead-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 24px 48px; align-items: end; position: relative; z-index: 1; }
.masthead h1 { color: #fff; margin-bottom: .35rem; }
.masthead p { color: rgba(255, 255, 255, .78); margin: 0; }
.masthead .eyebrow { color: var(--orange); }
.masthead-search { display: flex; background: #fff; border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.masthead-search input { border: 0; border-radius: 0; color: #15242b; background: #fff; padding: .8rem 1rem; }
.masthead-search input:focus { box-shadow: none; }
.masthead-search button { border: 0; background: var(--orange); color: var(--teal-900); padding: 0 18px; cursor: pointer; display: flex; align-items: center; }
.masthead-search button:hover { background: #f4a12f; }
.masthead-stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.masthead-stats div { display: flex; flex-direction: column; }
.masthead-stats strong { font-family: var(--font-head); font-size: 1.4rem; color: #fff; font-variant-numeric: tabular-nums; }
.masthead-stats span { font-size: .85rem; color: rgba(255, 255, 255, .65); }
.home-body { padding: 32px 0 64px; }

/* ---------- Category & topic lists ---------- */
.list-head, .row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 230px; gap: 20px; align-items: center; padding: 18px 22px; }
.list-head { padding-top: 11px; padding-bottom: 11px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.list-head span:not(:first-child) { text-align: left; }
.row { border-bottom: 1px solid var(--line); position: relative; transition: background-color .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.row-main > div { min-width: 0; }
.row-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--teal-50); color: var(--teal-900); display: grid; place-items: center; flex: none; border: 1px solid var(--teal-100); }
.row-icon.is-staff { background: var(--orange-50); color: var(--orange-ink); border-color: rgba(234, 142, 13, .3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .row-icon { color: var(--teal-600); } }
.row-title { font-family: var(--font-head); font-size: 1.02rem; font-weight: 700; margin: 0 0 3px; line-height: 1.35; }
.row-title a { color: var(--ink); text-decoration: none; }
.row-title a::after { content: ""; position: absolute; inset: 0; } /* whole row clickable */
.row-title a:hover { color: var(--link); }
.row-main p { margin: 0; color: var(--muted); font-size: .95rem; }
.row-num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.row-num small { display: none; }
.row-latest { display: flex; flex-direction: column; font-size: .9rem; min-width: 0; line-height: 1.4; position: relative; z-index: 1; }
.row-latest a { color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-latest a:hover { color: var(--link); text-decoration: underline; }
.row.pinned { background: linear-gradient(90deg, var(--orange-50), transparent 60%); }
.row.pinned::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
.topics .list-head, .topics .row { grid-template-columns: minmax(0, 1fr) 90px 90px 180px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-body); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .16em .5em; border-radius: 3px; background: var(--teal-50); color: var(--ink-2); border: 1px solid var(--line); vertical-align: 2px; margin-right: 4px; white-space: nowrap; }
.tag .icon { width: 12px; height: 12px; }
.tag-pin { background: var(--orange-50); color: var(--orange-ink); border-color: rgba(234, 142, 13, .35); }
.tag-staff { background: var(--orange-50); color: var(--orange-ink); border-color: rgba(234, 142, 13, .35); }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .14em .45em; border-radius: 3px; vertical-align: 2px; }
.badge-admin { background: var(--teal-900); color: #fff; }
.badge-mod { background: var(--orange-50); color: var(--orange-ink); border: 1px solid rgba(234, 142, 13, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-admin { background: var(--teal-600); color: #0d1a1f; } }

.avatar {
  --hue: 190;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  background: hsl(var(--hue) 28% 90%); color: hsl(var(--hue) 45% 22%);
  font-family: var(--font-head); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--hue) 22% 26%); color: hsl(var(--hue) 40% 88%); } }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; }
.site-header .avatar.sm { background: var(--orange); color: var(--teal-900); }
.avatar.lg { width: 60px; height: 60px; font-size: 1.15rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.9rem; }

/* ---------- Sidebar ---------- */
.sidebar .card { padding: 20px 22px; }
.sidebar .card p:last-child { margin-bottom: 0; }
.row-stats { display: contents; }
.side-title { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; line-height: 1.4; }
.recent li:first-child { padding-top: 0; }
.recent li:last-child { border-bottom: 0; padding-bottom: 0; }
.recent a { color: var(--ink); font-weight: 600; text-decoration: none; }
.recent a:hover { color: var(--link); text-decoration: underline; }
.side-note { border-left: 3px solid var(--orange); background: var(--surface); }
.side-note p { font-size: .95rem; color: var(--ink-2); }
.side-note p:last-child { margin: 0; }

/* ---------- Posts ---------- */
.thread-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.thread-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .94rem; }
.post { display: grid; grid-template-columns: 200px minmax(0, 1fr); padding: 0; overflow: hidden; scroll-margin-top: 20px; }
.post:target { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(234, 142, 13, .25); }
.post.is-op { border-top: 3px solid var(--teal-900); }
.post-author { padding: 22px 20px; border-right: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.post-author > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.author-name { font-family: var(--font-head); font-weight: 700; font-size: .98rem; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.author-name:hover { color: var(--link); text-decoration: underline; }
.author-meta { font-size: .84rem; color: var(--muted); line-height: 1.45; }
.post-content { padding: 20px 26px 18px; display: flex; flex-direction: column; min-width: 0; }
.post-meta { display: flex; gap: 12px; align-items: baseline; font-size: .88rem; color: var(--muted); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.post-meta a { color: var(--muted); text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.post-meta .post-no { margin-left: auto; font-variant-numeric: tabular-nums; }
.post-body { overflow-wrap: anywhere; font-size: 1.04rem; color: var(--ink); }
.post-body p:last-child { margin-bottom: 0; }
blockquote { margin: 0 0 1rem; padding: 10px 16px; border-left: 3px solid var(--orange); background: var(--surface-2); color: var(--ink-2); overflow-wrap: anywhere; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.post-actions { margin-top: auto; padding-top: 16px; display: flex; gap: 18px; font-size: .9rem; flex-wrap: wrap; }
.post-actions a, .post-actions button.link { color: var(--muted); text-decoration: none; font-weight: 600; }
.post-actions a:hover, .post-actions button.link:hover { color: var(--link); text-decoration: underline; }
.post-actions button.link.danger:hover { color: var(--danger); }
.deleted { font-style: italic; }
.mod-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.reply { border-top: 3px solid var(--orange); }
.reply textarea { min-height: 170px; }
.notice-bar { display: flex; gap: 12px; align-items: center; padding: 16px 20px; }
.notice-bar .icon { color: var(--muted); }
.notice-bar p { margin: 0; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 20px; }
.pagination a, .pagination span { min-width: 38px; padding: .4rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: .92rem; text-align: center; color: var(--ink-2); font-weight: 600; }
.pagination a:hover { border-color: var(--ink-2); }
.pagination .current { background: var(--teal-900); color: #fff; border-color: var(--teal-900); }
.pagination .gap { border: 0; background: none; min-width: 0; }

/* ---------- Welcome page ---------- */
.hero { position: relative; color: #fff; background: var(--teal-900); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(0, 43, 56, .96) 0%, rgba(0, 43, 56, .9) 38%, rgba(0, 43, 56, .45) 70%, rgba(0, 43, 56, .25) 100%); }
.hero-inner { position: relative; z-index: 2; padding: 96px 0 104px; max-width: 620px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; margin-bottom: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero .lead { color: rgba(255, 255, 255, .85); font-size: 1.18rem; max-width: 34em; }
.hero .eyebrow { color: var(--orange); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 26px; }
.hero-trust { display: flex; gap: 8px 22px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; font-size: .95rem; color: rgba(255, 255, 255, .78); }
.hero-trust li { display: flex; align-items: center; gap: 8px; }
.hero-trust .icon { width: 18px; height: 18px; color: var(--orange); }
.hero-credit { position: absolute; z-index: 2; right: 16px; bottom: 10px; font-size: .72rem; color: rgba(255, 255, 255, .55); margin: 0; }

.section { padding: 76px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 800; letter-spacing: -.015em; }
.section-head p { color: var(--ink-2); font-size: 1.08rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.step { padding: 28px 32px 8px 0; position: relative; }
.step + .step { padding-left: 32px; border-left: 1px solid var(--line); }
.step-no { font-family: var(--font-head); font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--orange); letter-spacing: -.03em; display: block; margin-bottom: 16px; }
.step h3 { font-size: 1.12rem; }
.step p { color: var(--ink-2); margin: 0; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.split-media { position: relative; margin: 0; }
.split-media img { width: 100%; aspect-ratio: 4 / 3.2; object-fit: cover; border-radius: var(--radius); }
.split-media::after { content: ""; position: absolute; left: -14px; bottom: -14px; width: 42%; height: 42%; border-left: 4px solid var(--orange); border-bottom: 4px solid var(--orange); border-radius: 0 0 0 var(--radius); pointer-events: none; }
.split-media figcaption { font-size: .78rem; color: var(--muted); margin-top: 22px; }
.uses { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.uses li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; align-items: start; }
.uses .row-icon { width: 46px; height: 46px; }
.uses h3 { margin-bottom: 2px; }
.uses p { margin: 0; color: var(--ink-2); }

.band { background: var(--teal-900); color: #fff; padding: 64px 0; position: relative; overflow: hidden; }
.band::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--orange); }
.band-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.band h2 { color: #fff; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 800; margin-bottom: .5rem; }
.band p { color: rgba(255, 255, 255, .8); margin: 0; max-width: 46em; font-size: 1.06rem; }
.band .actions { flex-wrap: nowrap; }

/* ---------- Auth (split screen) ---------- */
body.is-auth { background: var(--surface); }
.auth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: calc(100vh - 80px); }
.auth-art { position: relative; background: var(--teal-900); overflow: hidden; color: #fff; }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 43, 56, .35) 0%, rgba(0, 43, 56, .75) 45%, rgba(0, 43, 56, .97) 100%); }
.auth-art-copy { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 48px 48px 52px; max-width: 520px; }
.auth-art .eyebrow { color: var(--orange); }
.auth-quote { font-family: var(--font-head); font-size: clamp(1.25rem, 1rem + .9vw, 1.65rem); font-weight: 700; line-height: 1.3; color: #fff; margin-bottom: 24px; }
.auth-points { list-style: none; margin: 0; padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, .22); display: grid; gap: 8px; color: rgba(255, 255, 255, .82); font-size: .98rem; }
.auth-points li { padding-left: 22px; position: relative; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 2px; background: var(--orange); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 56px 24px 64px; background: var(--surface); }
.auth-panel-inner { width: 100%; max-width: 460px; }
.auth-panel h1 { margin-bottom: .4rem; }
.auth-panel .lead { font-size: 1.04rem; color: var(--muted); margin-bottom: 28px; }
.status-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-900); margin-bottom: 20px; }
.status-icon.ok { background: var(--ok-50); color: var(--ok); }
.status-icon.warn { background: var(--danger-50); color: var(--danger); }
.status-icon .icon { width: 28px; height: 28px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status-icon { color: var(--teal-600); } }

.steps-mini { margin: 0 0 8px; padding: 0; list-style: none; counter-reset: mini; display: grid; gap: 12px; }
.steps-mini li { counter-increment: mini; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: baseline; color: var(--ink-2); }
.steps-mini li::before { content: counter(mini); font-family: var(--font-head); font-weight: 700; font-size: .85rem; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-50); color: var(--orange-ink); border: 1px solid rgba(234, 142, 13, .35); }

/* ---------- Content pages ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 2rem; }
.prose li { margin-bottom: .55rem; }
.prose ol, .prose ul { padding-left: 1.3rem; }
.prose .note { border-left: 3px solid var(--orange); background: var(--orange-50); padding: 10px 14px; font-size: .95rem; }
.profile { display: flex; gap: 24px; align-items: flex-start; }
.profile h1 { margin-bottom: .3rem; }
.results li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.results li:first-child { padding-top: 4px; }
.results li:last-child { border-bottom: 0; padding-bottom: 0; }
.results li > a { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; margin-right: 8px; }
.results li > a:hover { color: var(--link); text-decoration: underline; }
.results p { margin: 6px 0 0; color: var(--muted); }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 700; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--orange); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 4px; }
.stat { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); padding: 20px 22px; border-top: 3px solid var(--teal-900); }
.stat strong { font-family: var(--font-head); font-size: 2.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .92rem; }
a.stat:hover { border-color: var(--line-strong); border-top-color: var(--orange); color: var(--ink); }
.stat.attention { border-top-color: var(--orange); }
.checks li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; margin-bottom: 12px; }
.ok { color: var(--ok); font-weight: 700; }
.warn { color: var(--warn-ink); background: var(--warn-50); padding: .1em .45em; border-radius: 3px; font-weight: 700; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.actions-cell { min-width: 230px; }
.actions-cell form { display: inline-flex; gap: 6px; flex-wrap: wrap; margin: 0 6px 6px 0; }
.role-form select { width: auto; padding: .34rem .5rem; font-size: .9rem; }
.status { font-size: .8rem; font-weight: 700; padding: .18em .55em; border-radius: 3px; white-space: nowrap; }
.status-active { background: var(--ok-50); color: var(--ok); }
.status-pending { background: var(--warn-50); color: var(--warn-ink); }
.status-unverified { background: var(--teal-50); color: var(--muted); }
.status-banned { background: var(--danger-50); color: var(--danger); }
.cat-fields { display: grid; grid-template-columns: 1fr 2fr 110px; gap: 14px; }
.report { border-left: 3px solid var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .list-head, .row, .topics .list-head, .topics .row { grid-template-columns: minmax(0, 1fr) 80px 180px; }
  .list-head .col-posts, .row .row-num.col-posts { display: none; }
  .split { gap: 40px; }
}
@media (max-width: 860px) {
  .layout, .grid-2 { grid-template-columns: 1fr; }
  .masthead-inner, .band-inner { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .list-head { display: none; }
  .row, .topics .row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 18px; }
  .row-num { display: inline; font-weight: 400; color: var(--muted); font-size: .9rem; }
  .row-num small { display: inline; font-size: inherit; }
  .row .row-num.col-posts { display: inline; }
  .row-stats { display: flex; gap: 16px; padding-left: 60px; }
  .row-latest { flex-direction: row; gap: 6px; padding-left: 60px; align-items: baseline; }
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .step, .step + .step { padding: 22px 0; border-left: 0; border-top: 1px solid var(--line-strong); }
  .split { grid-template-columns: 1fr; }
  .split-media::after { display: none; }
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-art { min-height: 240px; }
  .auth-art-copy { padding: 28px 20px; }
  .auth-points { display: none; }
  .auth-panel { padding: 36px 16px 48px; }
  .cat-fields { grid-template-columns: 1fr; }
  .band .actions { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 64px; gap: 12px; }
  .brand { gap: 12px; }
  .brand img { width: 99px; height: 32px; }
  .brand-name { font-size: .7rem; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; background: none; color: #fff;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--radius-sm); padding: .45rem .75rem;
    font: inherit; font-weight: 600; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -5px; }
  .nav-toggle-bars::after { top: 5px; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 16px; border-top: 1px solid rgba(255, 255, 255, .14); }
  .site-nav.open { display: flex; }
  .site-nav a, .nav-plain { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); text-align: left; }
  .site-nav a.is-active { border-bottom-color: rgba(255, 255, 255, .1); box-shadow: inset 3px 0 0 var(--orange); padding-left: 12px; }
  .site-nav .btn { margin-top: 12px; padding: .7rem 1rem; }
  .nav-sep { display: none; }
  .site-nav form.inline { display: block; }
  .nav-plain { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 28px; }
  .hero-inner { padding: 64px 0 72px; }
  .hero::before { background: linear-gradient(180deg, rgba(0, 43, 56, .82) 0%, rgba(0, 43, 56, .94) 100%); }
  .section { padding: 52px 0; }
  .post { grid-template-columns: 1fr; }
  .post-author { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 12px; }
  .post-author .avatar.lg { width: 42px; height: 42px; font-size: .9rem; }
  .post-author > div { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
  .post-content { padding: 14px 16px 16px; }
  .card:not(.post):not(.flush) { padding: 18px; }
  .profile { flex-direction: column; }
  .search-form { flex-direction: column; }
  .page-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .site-footer, .post-actions, .reply, .mod-tools, .pagination { display: none; }
  body { background: #fff; }
}
