/* ==========================================================================
   Xiuno Modern — presentation layer for Bootstrap 5 (front end).
   Structure: tokens → base → shell → components → pages → dark → responsive.
   Local, no build step; served with a content-hashed query string.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* surfaces — neutral black / white / gray */
  --page: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceef2;
  --ink: #0f1115;
  --ink-soft: #3f444d;
  --muted: #6e747e;
  --line: #e3e5ea;
  --line-strong: #d1d5dc;

  /* brand — the single accent: #345de3 */
  --primary: #345de3;
  --primary-hover: #2547c4;
  --primary-soft: #e9eefc;
  --primary-soft-2: #d5e0fa;
  --accent: #0f1115;
  --accent-soft: #e7e9ee;
  --warm: #6e747e;
  --warm-soft: #eef0f3;
  --danger: #0f1115;
  --danger-soft: #e7e9ee;

  /* depth */
  --shadow-xs: 0 1px 2px rgba(15, 17, 21, .05);
  --shadow-sm: 0 2px 8px -2px rgba(15, 17, 21, .07);
  --shadow: 0 14px 34px -18px rgba(15, 17, 21, .22);
  --shadow-lg: 0 32px 70px -30px rgba(15, 17, 21, .28);

  /* shape & motion — square-corner theme */
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --bs-border-radius: 0;
  --bs-border-radius-sm: 0;
  --bs-border-radius-lg: 0;
  --bs-border-radius-xl: 0;
  --bs-border-radius-xxl: 0;
  --bs-border-radius-pill: 0;
  --ring: 0 0 0 3px rgba(31, 35, 40, .10);
  --focus: #1f2328;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* header & hero */
  --header-bg: rgba(255, 255, 255, .88);
  --hero-bg: #f5f7fc;
  --hero-border: #e0e5ef;
  --hero-glow-a: rgba(52, 93, 227, .13);
  --hero-glow-b: rgba(15, 17, 21, .045);
  --hero-ink: #0f1115;
  --hero-copy: #4a505b;
  --glass: rgba(255, 255, 255, .74);
  --glass-line: rgba(255, 255, 255, .95);

  color-scheme: light;
}

html[data-theme="dark"] {
  --page: #0b0d10;
  --surface: #141619;
  --surface-2: #191c20;
  --surface-3: #20242a;
  --ink: #f2f4f7;
  --ink-soft: #c2c7d0;
  --muted: #8b919b;
  --line: #262a31;
  --line-strong: #353a43;

  --primary: #7d97f2;
  --primary-hover: #93aaf8;
  --primary-soft: #1a2340;
  --primary-soft-2: #232e55;
  --accent: #f2f4f7;
  --accent-soft: #262a31;
  --warm: #9aa0aa;
  --warm-soft: #22262c;
  --danger: #f2f4f7;
  --danger-soft: #262a31;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, .5);
  --shadow: 0 16px 40px -20px rgba(0, 0, 0, .65);
  --shadow-lg: 0 40px 80px -36px rgba(0, 0, 0, .8);

  --ring: 0 0 0 3px rgba(232, 237, 243, .16);
  --focus: #e8edf3;

  --header-bg: rgba(11, 13, 16, .86);
  --hero-bg: #101319;
  --hero-border: #242a35;
  --hero-glow-a: rgba(52, 93, 227, .32);
  --hero-glow-b: rgba(255, 255, 255, .04);
  --hero-ink: #f4f6fa;
  --hero-copy: #aab1bc;
  --glass: rgba(14, 17, 22, .6);
  --glass-line: rgba(255, 255, 255, .07);

  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  min-height: 100vh;
  height: auto;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  transition: color .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}

a:hover {
  color: var(--primary);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  letter-spacing: -.02em;
}

::selection {
  background: var(--surface-3);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--focus) !important;
  outline-offset: 3px;
  box-shadow: var(--ring);
}

.form-control:focus-visible,
.form-select:focus-visible,
textarea:focus-visible {
  outline: none !important;
}

#body:focus {
  outline: none;
}

.container {
  max-width: 1200px;
}

.row {
  margin-left: -12px;
  margin-right: -12px;
}

.row > [class*="col-"] {
  padding-left: 12px;
  padding-right: 12px;
}

.media-body {
  min-width: 0;
}

.text-muted,
.text-grey {
  color: var(--muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-danger,
.text-success,
.text-info,
.text-warning {
  color: var(--ink) !important;
}

.text-danger {
  font-weight: 650;
}

.badge {
  border-radius: 0;
  font-weight: 650;
}

.badge-primary {
  background: var(--primary);
  color: #fff;
}

.badge-secondary,
.badge-light,
.badge-dark,
.badge-success,
.badge-info,
.badge-warning,
.badge-danger {
  background: var(--surface-3);
  color: var(--ink-soft);
}

.bg-light,
.bg-white {
  background-color: var(--surface) !important;
}

/* UID badge: shown next to author names, profile headers and editors. */
.uid-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.5;
  vertical-align: 1px;
  white-space: nowrap;
}

.auth-login-hint {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.auth-login-hint code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 11px;
}

@media (max-width: 767px) {
  .thread-uid {
    display: none;
  }
}

hr {
  border-color: var(--line);
}

.skip-link {
  position: fixed;
  z-index: 2000;
  left: 20px;
  top: -100px;
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 0;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 14px;
  color: #fff;
}

/* --- Header -------------------------------------------------------------- */
.modern-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 68px;
  padding: 9px 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(22, 27, 52, .02);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .modern-header {
    background: var(--surface);
  }
}

.modern-header .container {
  flex-wrap: wrap;
  gap: 8px;
}

.modern-header .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 240px;
  margin-right: 26px;
  color: var(--ink);
}

.modern-header .navbar-brand:hover {
  color: var(--primary);
}

.modern-header .logo-2 {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-title {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-context {
  padding-left: 9px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modern-header .navbar-nav {
  align-items: center;
  gap: 2px;
}

/* 版块入口不再出现在顶部导航；节点保留以兼容插件 hook */
.modern-header .navbar-nav > .nav-item[hidden] {
  display: none !important;
}

.modern-header .navbar-nav .nav-link {
  padding: 8px 12px !important;
  border-radius: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
}

.modern-header .navbar-nav .nav-link:hover,
.modern-header .navbar-nav .nav-link:focus {
  color: var(--primary);
  background: var(--primary-soft);
}

.modern-header .navbar-nav .nav-item.active > .nav-link {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}

.modern-header .navbar-nav .nav-register {
  margin-left: 8px;
  padding: 9px 16px !important;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.modern-header .navbar-nav .nav-register:hover,
.modern-header .navbar-nav .nav-register:focus {
  background: var(--primary-hover);
  color: #fff;
}

.modern-header .navbar-nav .nav-register:after,
.modern-header .nav-link .icon-chevron-down:after {
  display: none;
}

.modern-header .avatar-1 {
  width: 26px;
  height: 26px;
  margin-right: 5px;
  box-shadow: 0 0 0 1px var(--line);
}

.modern-header .navbar-toggler {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
}

.modern-header .navbar-toggler-icon {
  position: relative;
  width: 21px;
  height: 20px;
  background-image: none;
  border-top: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
}

.modern-header .navbar-toggler-icon:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  border-top: 2px solid var(--ink-soft);
}

.theme-toggle {
  order: 3;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background-color .16s var(--ease);
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
}

.logout-form {
  margin: 0;
}

.logout-form button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* --- Footer -------------------------------------------------------------- */
.modern-footer {
  margin-top: 8px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.modern-footer,
.modern-footer a,
.modern-footer b {
  color: var(--muted) !important;
  font-size: 12.5px;
}

.modern-footer b {
  color: var(--ink-soft) !important;
  font-weight: 600;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  padding: 10px 18px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.5;
  box-shadow: none;
  transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 0;
  font-size: 12.5px;
}

.btn-lg {
  padding: 13px 26px;
  border-radius: 0;
  font-size: 15px;
}

.btn-primary {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(52, 93, 227, .55);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
  background: var(--primary-hover);
  border-color: transparent;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -10px rgba(52, 93, 227, .6);
}

.btn-primary:focus-visible {
  box-shadow: var(--ring), 0 12px 22px -10px rgba(52, 93, 227, .6);
}

.btn-outline-primary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--primary);
}

.btn-outline-primary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-secondary,
.btn-light {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.btn-secondary:hover,
.btn-light:hover {
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-link {
  color: var(--primary);
}

.btn-danger {
  border-color: transparent;
  background: var(--ink);
  color: var(--surface);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:not(:disabled):not(.disabled):active {
  border-color: transparent;
  background: var(--ink-soft);
  color: var(--surface);
}

.btn-success,
.btn-info,
.btn-warning {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.btn:disabled,
.btn.disabled {
  opacity: .55;
  transform: none;
  box-shadow: none;
}

/* --- Cards --------------------------------------------------------------- */
.card {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.card > .card-header {
  padding: 15px 22px;
  border-color: var(--line);
  background: var(--surface);
  background-image: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 680;
}

.card-header:first-child {
  border-radius: 0;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-color: var(--line);
  background: var(--surface-2);
}

.card-footer:last-child {
  border-radius: 0;
}

.card-footer table td {
  padding: 7px 0;
}

.card-footer table b {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card-header-tabs {
  gap: 22px;
  margin: -4px 0 -15px;
  border: 0;
}

.card-header-tabs .nav-link {
  padding: 10px 0 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 640;
}

.card-header-tabs .nav-link:hover {
  color: var(--primary);
}

.card-header-tabs > .nav-item > .nav-link,
.card-header-tabs > .nav-item > .nav-link:hover:not(.active) {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  background-image: none;
  color: var(--muted);
}

.card-header-tabs > .nav-item > .nav-link.active {
  border: 0;
  border-bottom: 2px solid var(--primary);
  background: transparent;
  background-image: none;
  color: var(--primary);
}

.card-header-dropdown {
  font-size: 12.5px;
}

.card-header-dropdown .text-muted {
  margin-right: 4px;
}

.nav-tabs {
  border-color: var(--line);
}

/* --- Home: hero ---------------------------------------------------------- */
.community-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr);
  align-items: center;
  gap: 40px;
  min-height: 268px;
  margin-bottom: 34px;
  padding: 42px 46px;
  overflow: hidden;
  border: 1px solid var(--hero-border);
  border-radius: 0;
  background:
    radial-gradient(120% 130% at 100% 0%, var(--hero-glow-a) 0%, transparent 55%),
    radial-gradient(90% 130% at 0% 100%, var(--hero-glow-b) 0%, transparent 58%),
    var(--hero-bg);
}

.community-hero:before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -90px;
  top: -120px;
  width: 460px;
  height: 460px;
  border: 1px solid var(--hero-border);
  border-radius: 0;
  opacity: .3;
}

.community-hero:after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 40px;
  bottom: -180px;
  width: 380px;
  height: 380px;
  border: 1px solid var(--hero-border);
  border-radius: 0;
  opacity: .22;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 680;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.community-hero h1 {
  margin: 0 0 14px;
  color: var(--hero-ink);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.035em;
}

.community-hero p {
  max-width: 48ch;
  margin: 0 0 26px;
  color: var(--hero-copy);
  font-size: 14.5px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.hero-actions .btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
}

.hero-explore {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--hero-copy);
  font-size: 13.5px;
  font-weight: 600;
}

.hero-explore:hover {
  color: var(--primary);
}

.hero-explore span {
  transition: transform .18s var(--ease);
}

.hero-explore:hover span {
  transform: translate(2px, -2px);
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid var(--glass-line);
  border-radius: 0;
  background: var(--glass);
  box-shadow: 0 18px 40px -30px rgba(15, 17, 21, .35);
}

.hero-stats > div {
  display: flex;
  flex-direction: row-reverse;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--hero-border);
}

.hero-stats > div:last-child {
  border-bottom: 0;
}

.hero-stats strong {
  color: var(--hero-ink);
  font-size: 26px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.hero-stats span {
  color: var(--hero-copy);
  font-size: 12.5px;
}

.hero-orbit {
  display: none;
}

/* --- Home: sections & forum grid ---------------------------------------- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18.5px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.section-heading > span {
  color: var(--muted);
  font-size: 12.5px;
}

.forum-directory {
  margin-bottom: 32px;
  scroll-margin-top: 92px;
}

.forum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.forum-tile {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.forum-tile:hover {
  border-color: var(--primary-soft-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.forum-tile img {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 0;
  object-fit: cover;
}

.forum-tile-copy {
  flex: 1;
  min-width: 0;
}

.forum-tile strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 680;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-tile small {
  color: var(--muted);
  font-size: 11.5px;
}

.tile-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  transition: color .16s var(--ease), background-color .16s var(--ease), transform .16s var(--ease);
}

.forum-tile:hover .tile-arrow {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translate(1px, -1px);
}

/* --- Home: sidebars ------------------------------------------------------ */
.sidebar-cta,
.sidebar-cta:hover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}

.sidebar-cta:hover,
.sidebar-cta:focus-visible {
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-cta:before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-cta:hover:before {
  background: var(--surface);
}

.sidebar-kicker {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.sidebar-title {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -.02em;
}

.card-site-info .m-3 {
  margin: 22px !important;
}

.card-site-info .small {
  color: var(--muted);
  line-height: 1.9;
}

.card-site-info .card-footer table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.card-site-info .card-footer td {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}

.card-site-info .card-footer td b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 720;
}

.community-note {
  padding: 14px 4px;
}

.community-note > i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 19px;
}

.community-note h3 {
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 680;
  line-height: 1.7;
}

.community-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
}

.aside > .btn-primary {
  min-height: 46px;
  border-radius: 0;
  font-size: 14.5px;
}

/* --- Thread list --------------------------------------------------------- */
.card-threadlist > .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-threadlist > .card-body {
  padding: 0 20px;
}

.threadlist {
  margin-bottom: 0;
}

.threadlist > .thread {
  align-items: flex-start;
  margin: 0;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  transition: background-color .16s var(--ease);
}

.threadlist > .thread:last-child {
  border-bottom: 0;
}

.threadlist > .thread:hover {
  background: var(--surface-2);
}

.threadlist > .thread:hover .subject a {
  color: var(--primary);
}

.threadlist .thread > a {
  margin-top: 1px !important;
  margin-left: 0 !important;
}

.avatar-1,
.avatar-2,
.avatar-3,
.avatar-4,
.avatar-5 {
  border-radius: 0;
  background: var(--surface-3);
  object-fit: cover;
}

.threadlist .avatar-3,
.postlist .avatar-3 {
  width: 42px;
  height: 42px;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--line);
}

.threadlist .subject {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 620;
  line-height: 1.6;
  letter-spacing: -.015em;
}

.threadlist .subject a {
  color: var(--ink);
}

.threadlist .subject .badge,
.threadlist .subject .text-muted {
  vertical-align: 2px;
}

.thread-meta {
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.thread-meta > div:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

.thread-meta .username {
  color: var(--ink-soft);
  font-weight: 600;
}

.thread-meta .username:hover {
  color: var(--primary);
}

.thread-meta .date,
.thread-meta .thread-views {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.thread-views {
  font-size: 11.5px;
}

.reply-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 9px;
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

/* --- Empty / pagination / breadcrumb ------------------------------------ */
.empty-state {
  padding: 54px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 24px;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 13px;
}

.pagination {
  gap: 6px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.page-link:hover {
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
  color: var(--primary);
}

.page-link .icon-angle-left,
.page-link .icon-angle-right {
  font-size: 16px;
}

.page-item.active .page-link {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.page-item.disabled .page-link {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.breadcrumb,
.breadcrumb:hover {
  gap: 0;
  padding: 0 0 10px;
  border: 0;
  background: transparent !important;
  box-shadow: none;
  font-size: 12.5px;
}

.breadcrumb .active,
.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--muted);
  opacity: .55;
}

/* --- Forum page ---------------------------------------------------------- */
.forum-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    radial-gradient(90% 140% at 0% 0%, var(--primary-soft) 0%, transparent 60%),
    var(--surface);
}

.forum-hero-icon {
  width: 64px;
  height: 64px;
  padding: 11px;
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

.forum-hero-copy {
  flex: 1;
  min-width: 0;
}

.forum-hero .eyebrow {
  margin-bottom: 6px;
  font-size: 10.5px;
}

.forum-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 760;
  letter-spacing: -.03em;
}

.forum-hero p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.forum-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.card-forum-info .card-body,
.card-user-info .card-body {
  padding-top: 24px;
  text-align: center;
}

.card-forum-info h5,
.card-user-info h5 {
  margin-top: 0;
  font-size: 18px;
  font-weight: 720;
}

.card-forum-info .line-height-2 {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.card-user-info .avatar-5 {
  width: 76px;
  height: 76px;
  margin-top: 6px;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--line);
}

/* --- Thread page --------------------------------------------------------- */
.card-thread > .card-body {
  padding: 30px 34px;
}

.thread-title {
  margin-bottom: 14px;
  font-size: clamp(24px, 2.7vw, 32px);
  font-weight: 780;
  line-height: 1.42;
  letter-spacing: -.035em;
}

.xn-back {
  display: block !important;
  max-width: 260px;
  margin: 18px auto 24px !important;
  background: var(--surface);
  color: var(--ink-soft);
}

.card-thread > .card-body > .media > a {
  padding-top: 5px;
}

.card-thread > .card-body > .media > a .avatar-3 {
  width: 44px;
  height: 44px;
  border-radius: 0;
}

.card-thread .small {
  flex-wrap: wrap;
  row-gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.card-thread hr {
  margin: 26px 0;
  border-color: var(--line);
}

.message {
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.95;
  overflow-wrap: anywhere;
  word-break: normal !important;
}

.message p {
  margin-bottom: 1.2em;
}

.message img,
.message video {
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.message a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.message blockquote,
.quote {
  margin: 1.2em 0;
  padding: 14px 18px;
  border: 0;
  border-left: 3px solid var(--primary);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
}

.message pre {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
}

.card-postlist .card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 680;
}

.postlist {
  margin-bottom: 0;
}

.postlist > .post {
  padding: 20px 0;
  border-color: var(--line);
}

.postlist > .post:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.postlist .post .small {
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
}

.postlist .post .small a {
  color: var(--muted);
}

.postlist .post .small a:hover {
  color: var(--primary);
}

.postlist .message {
  padding-top: 6px;
  font-size: 14.5px;
  line-height: 1.9;
}

.postlist .post .message h6 {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 620;
}

.floor-parent {
  color: var(--muted);
  font-size: 11.5px;
}

.floor-parent .floor {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.postlist .newpost {
  margin-top: 16px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
}

.postlist .newpost .avatar-3 {
  width: 38px;
  height: 38px;
}

.postlist .newpost .media-body > div:first-child {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

#quick_reply_form #message {
  min-height: 108px;
  height: auto;
  padding: 14px 16px;
  border-radius: 0;
  background: var(--surface);
  line-height: 1.8;
}

#quick_reply_form .btn {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.reply-signin {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 30px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.reply-signin > i {
  color: var(--primary);
  font-size: 20px;
}

/* --- Forms --------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-control,
.form-select,
.input-group-text {
  border-color: var(--line);
  border-radius: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.form-control,
.form-select {
  min-height: 44px;
  padding: 10px 14px;
}

.form-control::placeholder {
  color: var(--muted);
  opacity: .75;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--ring);
}

.form-control:disabled,
.form-control[readonly] {
  background: var(--surface-2);
  color: var(--muted);
}

.form-label,
.col-form-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.input-group-text {
  min-width: 46px;
  justify-content: center;
  border-right: 0;
  background: var(--surface-2);
  color: var(--muted);
}

.input-group > .form-control:not(:first-child) {
  border-left: 0;
}

.input-group > .form-control:last-of-type {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:last-of-type) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group:focus-within .input-group-text {
  border-color: var(--primary);
  color: var(--primary);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.progress {
  height: 8px;
  border-radius: 0;
  background: var(--surface-3);
}

.progress-bar {
  background: var(--primary);
}

/* --- Auth pages ---------------------------------------------------------- */
.auth-shell {
  margin-top: 18px;
  margin-bottom: 36px;
}

/* Centre the auth block in the space left by the shell (progressive: :has). */
body.modern-community #body:has(.auth-shell) {
  display: flex;
  flex-direction: column;
}

body.modern-community #body:has(.auth-shell) > .container {
  margin-top: auto;
  margin-bottom: auto;
}

.auth-intro {
  max-width: 540px;
  margin: 0 auto 26px;
  text-align: center;
}

.auth-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 24px;
  box-shadow: var(--shadow-sm);
}

.auth-intro h1 {
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -.035em;
}

.auth-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.85;
}

.auth-shell > .col-lg-6 {
  max-width: 460px;
  flex-basis: 460px;
}

.auth-shell .card {
  border-radius: 0;
  box-shadow: var(--shadow);
}

.auth-shell .card-header {
  padding: 20px 28px;
  font-size: 15px;
}

.auth-shell .card-body {
  padding: 28px;
}

.auth-shell .w-100 {
  min-height: 46px;
  border-radius: 0;
}

.auth-shell .input-group {
  margin-bottom: 20px;
}

.auth-shell .media-body {
  min-width: 0;
}

/* --- Editor -------------------------------------------------------------- */
.editor-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 6px 0 22px;
}

.editor-heading > i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 21px;
}

.editor-heading h1 {
  margin: 0 0 3px;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -.03em;
}

.editor-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.editor-card > .card-header {
  display: none;
}

.editor-card label.editor-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 620;
}

.editor-card #subject {
  min-height: 52px;
  font-size: 18px;
  font-weight: 600;
}

.editor-card #message {
  min-height: 340px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.9;
  resize: vertical;
}

.editor-card .addattach {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 0;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.editor-card .addattach:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.editor-card .addattach:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.editor-card .addattach input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  visibility: visible !important;
}

.editor-footer {
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.fieldset {
  margin-top: 15px;
  padding: 16px;
  border-color: var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--ink);
}

.fieldset > legend {
  width: auto;
  padding: 0 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.attachlist {
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
}

.attachlist a {
  color: var(--primary);
}

.attachlist .filetype {
  color: var(--muted);
}

/* --- Misc components ----------------------------------------------------- */
.list-group-item {
  padding: 13px 18px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.list-group-item.active {
  border-color: var(--line);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 640;
}

.list-group-item-action:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.dropdown-menu {
  padding: 7px;
  border-color: var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.dropdown-item {
  padding: 9px 12px;
  border-radius: 0;
  color: var(--ink);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--primary-soft);
  color: var(--primary);
}

.modal-content {
  border-color: var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  padding: 18px 22px;
  border-color: var(--line);
}

.modal-title {
  font-size: 17px;
  font-weight: 680;
}

.modal-body {
  padding: 22px;
}

.modal .btn-close {
  opacity: .7;
}

.alert {
  border-radius: 0;
  font-size: 13.5px;
}

.alert,
.alert-primary,
.alert-secondary,
.alert-success,
.alert-info,
.alert-warning,
.alert-danger,
.alert-light,
.alert-dark {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.alert-danger {
  border-left-color: var(--ink);
}

.alert-success,
.alert-info,
.alert-warning {
  border-left-color: var(--line-strong);
}

.table {
  color: var(--ink);
}

.table td,
.table th {
  border-color: var(--line);
}

.table thead th {
  border-bottom-width: 1px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.table-striped tbody tr:nth-of-type(odd) {
  background: var(--surface-2);
}

pre {
  color: var(--ink);
}

/* --- Dark specific tweaks ------------------------------------------------ */
html[data-theme="dark"] .modern-header {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .btn-primary {
  color: #0b1020;
  box-shadow: 0 10px 22px -12px rgba(125, 151, 242, .7);
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus,
html[data-theme="dark"] .btn-primary:not(:disabled):not(.disabled):active {
  color: #0b1020;
}

html[data-theme="dark"] .page-item.active .page-link {
  color: #0b1020;
}

html[data-theme="dark"] .skip-link {
  color: #0b1020;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  border-color: var(--line-strong);
  background-color: var(--surface-2);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  border-color: var(--primary);
  background-color: var(--surface-3);
}

html[data-theme="dark"] .input-group-text {
  border-color: var(--line-strong);
  background-color: var(--surface-3);
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly] {
  background-color: var(--surface-2);
}

html[data-theme="dark"] .forum-tile img {
  filter: brightness(.94);
}

html[data-theme="dark"] .bg-dark {
  background-color: #0b0d10 !important;
}

html[data-theme="dark"] .bg-warning {
  color: #0f1115;
}

html[data-theme="dark"] .badge-light {
  background: var(--surface-3);
  color: var(--ink);
}

html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .alert-primary {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
}

html[data-theme="dark"] .message img,
html[data-theme="dark"] .postlist img {
  filter: brightness(.92);
}

/* --- Responsive ---------------------------------------------------------- */
@media (min-width: 992px) {
  .modern-header .navbar-collapse {
    min-width: 0;
  }

  .modern-header .navbar-nav.me-auto {
    flex: 1;
    flex-wrap: wrap;
  }
}

@media (max-width: 1199.98px) {
  .container {
    max-width: 1080px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .modern-header .navbar-brand {
    max-width: 200px;
    margin-right: 12px;
  }

  .modern-header .nav-link {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 13px;
  }

  .community-hero {
    gap: 28px;
    padding: 36px 34px;
  }

  .hero-stats strong {
    font-size: 23px;
  }

  .forum-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 991.98px) {
  .modern-header .container {
    gap: 10px;
  }

  .modern-header .navbar-brand {
    max-width: calc(100% - 180px);
    margin-right: auto;
  }

  .modern-header .hidden-lg.navbar-brand {
    width: 30px;
    margin: 0;
    justify-content: center;
  }

  .modern-header .navbar-collapse {
    order: 5;
    flex-basis: 100%;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .modern-header .navbar-nav {
    align-items: stretch;
  }

  .modern-header .nav-link {
    padding: 10px 12px !important;
    font-size: 14px;
  }

  .theme-toggle {
    order: 4;
  }

  .community-hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    padding: 4px;
  }

  .hero-stats > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 13px 15px;
    border-right: 1px solid var(--hero-border);
    border-bottom: 0;
  }

  .hero-stats > div:last-child {
    border-right: 0;
  }

  .hero-stats strong {
    font-size: 22px;
  }

  .card-thread .small > div:last-child {
    margin-left: auto;
  }
}

@media (max-width: 767.98px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  #body {
    padding-top: 22px;
    padding-bottom: 26px;
  }

  .modern-header {
    min-height: 62px;
    padding: 8px 0;
  }

  .brand-title {
    font-size: 17.5px;
  }

  .brand-context {
    display: none !important;
  }

  .modern-header .logo-2 {
    width: 29px;
    height: 29px;
  }

  .modern-header .navbar-brand {
    gap: 7px;
  }

  .community-hero {
    padding: 28px 24px;
    border-radius: 0;
  }

  .community-hero:before {
    right: -220px;
  }

  .community-hero h1 {
    font-size: 30px;
  }

  .community-hero p {
    margin-bottom: 22px;
    font-size: 13.5px;
  }

  .hero-actions {
    gap: 16px;
  }

  .hero-explore {
    font-size: 12.5px;
  }

  .section-heading h2 {
    font-size: 17.5px;
  }

  .forum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .forum-tile {
    padding: 13px 12px;
    gap: 10px;
  }

  .forum-tile img {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 0;
  }

  .forum-hero {
    flex-wrap: wrap;
    gap: 16px;
    padding: 22px;
  }

  .forum-hero-copy {
    flex-basis: calc(100% - 82px);
  }

  .forum-hero > .btn {
    margin-left: 80px;
  }

  .card-thread > .card-body {
    padding: 24px 22px;
  }

  .card-header-dropdown .text-muted {
    display: none;
  }

  .card-header-dropdown {
    font-size: 11.5px !important;
  }

  .card-postlist .card-body {
    padding: 20px;
  }

  .threadlist > .thread {
    padding: 16px 0;
  }

  .threadlist .subject {
    font-size: 15px;
  }

  .thread-meta {
    gap: 6px;
    font-size: 11.5px;
  }

  .thread-views {
    display: none;
  }

  .auth-shell {
    margin-top: 6px;
  }

  .auth-intro h1 {
    font-size: 26px;
  }

  .auth-shell .card-body {
    padding: 24px;
  }

  .card-header-tabs {
    gap: 18px;
  }

  .card-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .card-threadlist > .card-body {
    padding: 0 16px;
  }
}

@media (max-width: 479.98px) {
  body {
    font-size: 14.5px;
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modern-header .container {
    gap: 7px;
  }

  .modern-header .navbar-brand {
    max-width: calc(100% - 150px);
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .modern-header .navbar-toggler {
    padding: 5px 7px;
  }

  .community-hero {
    padding: 24px 20px;
    margin-bottom: 26px;
  }

  .community-hero h1 {
    font-size: 27px;
  }

  .eyebrow {
    font-size: 10px;
    letter-spacing: .12em;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats > div {
    flex-direction: row-reverse;
    align-items: baseline;
    border-right: 0;
    border-bottom: 1px solid var(--hero-border);
  }

  .hero-stats > div:last-child {
    border-bottom: 0;
  }

  .forum-grid {
    gap: 9px;
  }

  .forum-tile {
    padding: 12px 10px;
    gap: 8px;
  }

  .forum-tile img {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    padding: 5px;
    border-radius: 0;
  }

  .forum-tile strong {
    font-size: 13px;
  }

  .forum-tile small {
    font-size: 10px;
  }

  .tile-arrow {
    display: none;
  }

  .card {
    margin-bottom: 18px;
    border-radius: 0;
  }

  .card-body {
    padding: 18px;
  }

  .card-threadlist > .card-body {
    padding: 0 14px;
  }

  .threadlist .avatar-3,
  .postlist .avatar-3 {
    width: 34px;
    height: 34px;
    border-radius: 0;
  }

  .threadlist .thread > a {
    margin-right: 10px !important;
  }

  .thread-meta {
    align-items: flex-end;
  }

  .thread-meta .mx-2 {
    margin-left: 3px !important;
    margin-right: 3px !important;
  }

  .thread-meta > div:first-child {
    line-height: 1.65;
  }

  .reply-count {
    min-width: 28px;
    height: 21px;
    padding: 0 7px;
    font-size: 10.5px;
  }

  .thread-title {
    font-size: 23px;
  }

  .card-thread > .card-body {
    padding: 20px 17px;
  }

  .card-thread > .card-body > .media {
    display: block;
  }

  .card-thread > .card-body > .media > a {
    float: left;
    padding: 0;
  }

  .card-thread > .card-body > .media > a .avatar-3 {
    width: 34px;
    height: 34px;
    margin-right: 10px !important;
  }

  .card-thread .thread-title {
    min-height: 34px;
    margin-bottom: 14px;
  }

  .card-thread .small {
    clear: both;
  }

  .card-thread .small > div:last-child {
    margin-left: 0;
  }

  .message {
    font-size: 14.5px;
  }

  .card-postlist .card-body {
    padding: 18px 15px;
  }

  .postlist .media > a {
    margin-right: 10px !important;
  }

  .postlist .text-end.text-grey {
    margin-left: 0;
  }

  .postlist .post .small {
    font-size: 11px;
  }

  .postlist .post .small .me-3 {
    margin-right: 9px !important;
  }

  .forum-hero {
    padding: 18px;
  }

  .forum-hero h1 {
    font-size: 23px;
  }

  .forum-hero-icon {
    width: 50px;
    height: 50px;
    padding: 8px;
  }

  .forum-hero-copy {
    flex-basis: calc(100% - 68px);
  }

  .forum-hero > .btn {
    margin-left: 0;
    width: 100%;
  }

  .auth-shell .card-body {
    padding: 22px;
  }

  .auth-shell .card-header {
    padding: 18px 22px;
  }

  .auth-intro {
    margin-bottom: 20px;
  }

  .auth-mark {
    width: 50px;
    height: 50px;
    font-size: 21px;
  }

  .editor-heading h1 {
    font-size: 22px;
  }

  .editor-card #message {
    min-height: 290px;
  }

  .editor-footer > .text-end {
    width: 100%;
  }

  .editor-footer #submit {
    width: 100%;
  }

  .modern-footer .row {
    row-gap: 8px;
  }

  .modern-footer .col {
    flex-basis: 100%;
    text-align: center !important;
  }
}

/* --- Motion & print ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *:before,
  *:after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  #header,
  #footer,
  .aside,
  .forum-directory,
  .hero-actions,
  #quick_reply_form,
  .post_reply,
  .post_delete,
  .post_update,
  .mod-button,
  .theme-toggle {
    display: none !important;
  }

  body,
  .card {
    background: #fff;
    color: #000;
    box-shadow: none;
  }

  .main {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #body {
    padding: 0;
  }
}

/* --- Square-corner theme -------------------------------------------------- */
/* All project components are authored with 0 radii; this also squares the
   Bootstrap rounding utilities that ship their values with !important. */
[class^="rounded"],
[class*=" rounded"] {
  border-radius: 0 !important;
}

.form-check-input[type="checkbox"],
.form-check-input[type="radio"],
.form-switch .form-check-input,
.form-range::-webkit-slider-thumb,
.form-range::-webkit-slider-runnable-track,
.form-range::-moz-range-thumb,
.form-range::-moz-range-track,
.btn-close {
  border-radius: 0 !important;
}


/* --- Wallet, private messages and reactions ----------------------------- */
.wallet-amount {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}
.wallet-card-balance {
  border-color: rgba(13, 110, 253, .25);
}
.wallet-ledger td {
  white-space: nowrap;
}
.pm-conversation-list {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}
.pm-conversation-item + .pm-conversation-item {
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}
.pm-conversation-item > a {
  padding: .75rem .25rem;
  color: inherit;
  text-decoration: none;
}
.pm-conversation-item > a:hover {
  background: rgba(13, 110, 253, .05);
}
.pm-avatar-placeholder {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  flex: 0 0 auto;
}
.pm-chat {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-height: 18rem;
  max-height: 55vh;
  overflow-y: auto;
  padding: .75rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: .5rem;
  background: #f8f9fa;
}
.pm-chat-wrap {
  position: relative;
}
.pm-date-sep {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .25rem 0;
  color: #6c757d;
  font-size: .72rem;
}
.pm-date-sep::before,
.pm-date-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bs-border-color, #dee2e6);
}
.pm-date-sep span {
  padding: 0 .35rem;
  background: #f8f9fa;
}
.pm-new-bottom {
  position: absolute;
  right: 50%;
  bottom: .6rem;
  transform: translateX(50%);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .65rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 999px;
  background: #fff;
  color: #0d6efd;
  font-size: .78rem;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
  z-index: 2;
}
.pm-new-bottom[hidden] {
  display: none;
}
.pm-new-count {
  min-width: 1.2rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  text-align: center;
  font-size: .7rem;
}
.pm-status {
  min-height: 1.2rem;
  color: #dc3545;
}
.pm-composer textarea {
  resize: none;
  overflow-y: auto;
  max-height: 10rem;
}
.pm-message {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
}
.pm-message.is-mine {
  justify-content: flex-end;
}
.pm-bubble {
  max-width: min(75%, 42rem);
  padding: .5rem .75rem;
  border-radius: .75rem;
  background: #fff;
  border: 1px solid var(--bs-border-color, #dee2e6);
}
.pm-message.is-mine .pm-bubble {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
.pm-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pm-time {
  margin-top: .15rem;
  font-size: .7rem;
  opacity: .65;
}
.post-actions .btn-link {
  padding: 0;
  color: #6c757d;
  text-decoration: none;
}
.post-actions .btn-link:hover,
.post-actions .btn-link.is-active {
  color: #0d6efd;
}
.post-actions .btn-link.is-busy {
  opacity: .5;
}

/* Floating page scroll controls (site-wide) ---------------------------- */
.scroll-jump {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.scroll-jump.is-visible { opacity: 1; visibility: visible; transform: none; }
.scroll-jump-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(17, 24, 39, .12);
  cursor: pointer;
}
.scroll-jump-btn:hover { background: var(--surface-2); }
.scroll-jump-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroll-jump-btn:disabled { opacity: .45; cursor: default; }
.scroll-jump-btn .icon-angle-up,
.scroll-jump-btn .icon-angle-down { font-size: 16px; }
body.lightbox-open .scroll-jump,
body.reply-composer-visible .scroll-jump { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 575.98px) {
  .scroll-jump { right: 12px; bottom: 12px; gap: 6px; }
  .scroll-jump-btn { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-jump { transition: none; }
}
@media print { .scroll-jump { display: none; } }
