:root {
  --soil: #2f4a3a;
  --soil-dark: #1c2f25;
  --leaf: #5f7d5a;
  --sand: #f2eee5;
  --paper: #fffcf7;
  --ink: #1c241f;
  --muted: #5b675f;
  --line: #d9d2c4;
  --shadow: 0 12px 30px rgba(28, 47, 37, 0.08);
  --radius: 0.85rem;
  --header-h: 4.25rem;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--sand);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(95, 125, 90, 0.16), transparent 55%),
    linear-gradient(180deg, #f8f5ee 0%, var(--sand) 100%);
}

img { max-width: 100%; }
a { color: var(--soil); }
a:hover { color: var(--leaf); }

.page-shell {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.site-main {
  flex: 1 0 auto;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1.75rem 0 2.5rem;
}

.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--soil-dark);
  color: #e7efe8;
}

.site-footer a { color: #d5ebca; }
.site-footer .container {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  border-top: 1px solid rgba(231, 239, 232, 0.14);
  padding-top: 1.4rem;
}

@media (max-width: 620px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.05rem;
}

.footer-brand-mark {
  display: inline-flex;
  padding: 0.3rem;
  border-radius: 0.5rem;
  background: rgba(95, 125, 90, 0.28);
  color: #cfe6c4;
}
.footer-brand-mark .icon { width: 1rem; height: 1rem; }

.footer-line { font-size: 0.92rem; margin-bottom: 0.25rem; opacity: 0.92; }
.footer-req { text-align: left; }
@media (min-width: 621px) {
  .footer-req { text-align: right; }
}
.footer-muted { opacity: 0.65; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.container-fluid {
  width: 100%;
  padding-inline: 1rem;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 252, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-nav {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--soil-dark);
}

.brand-mark {
  border: 1px solid var(--soil);
  border-radius: 0.35rem;
  padding: 0.12rem 0.42rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.brand-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--soil);
  border-radius: 0.55rem;
  background: var(--paper);
  cursor: pointer;
  padding: 0;
  place-items: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0 auto;
  background: var(--soil-dark);
  content: "";
  border-radius: 2px;
}

.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after { transform: translateY(4px); }

.site-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-menu a {
  display: block;
  text-decoration: none;
  color: var(--soil-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
}

.site-menu a:hover {
  background: rgba(95, 125, 90, 0.12);
  color: var(--soil);
}

@media (max-width: 980px) {
  .site-nav {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-grid;
    margin-left: auto;
  }

  .site-menu {
    display: none;
    order: 3;
    width: 100%;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.55rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .site-menu.is-open {
    display: flex;
  }

  .site-menu a {
    padding: 0.8rem 0.9rem;
  }
}

@media (min-width: 981px) {
  .nav-toggle {
    display: none;
  }

  .site-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
  }

  .site-menu a {
    white-space: nowrap;
  }
}

/* Content */
.hero { padding: 0.4rem 0 1rem; }
.hero h1,
h1, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--soil-dark);
  line-height: 1.2;
  text-wrap: pretty;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.hero h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  max-width: 18ch;
  margin: 0.2rem 0 0.7rem;
}

.panel {
  overflow-wrap: break-word;
  word-break: normal;
}

.hero p, .lead {
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--leaf);
  font-weight: 600;
}

/* Hero: two-column with decorative illustration */
.hero-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0 1.75rem;
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 15rem; margin: 0 auto; }
}

.hero-art svg { display: block; width: 100%; height: auto; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.hero-stat dt {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-stat dd {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--soil-dark);
}

/* Icons (used throughout: quick links, forum badges, etc.) */
.icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  vertical-align: -0.2em;
}

/* Quick-link cards */
.link-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

@media (max-width: 480px) {
  .link-cards { grid-template-columns: 1fr; }
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper);
  color: var(--soil-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.link-card .icon {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0.35rem;
  border-radius: 0.5rem;
  background: rgba(95, 125, 90, 0.14);
  color: var(--leaf);
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(28, 47, 37, 0.1);
  border-color: var(--leaf);
  color: var(--soil-dark);
}

/* News list */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list-link {
  display: block;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.15s ease, color 0.15s ease;
}

.news-list li:first-child .news-list-link { padding-top: 0.1rem; }
.news-list li:last-child .news-list-link { border-bottom: none; padding-bottom: 0.1rem; }

.news-list-link:hover {
  padding-left: 0.5rem;
  color: var(--leaf);
}

.news-list-date {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.news-list-title {
  color: var(--soil-dark);
  font-weight: 600;
}
.news-list-link:hover .news-list-title { color: var(--leaf); }

.panel {
  background: rgba(255, 252, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.panel:last-child { margin-bottom: 0; }

.charter-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
}

@media (max-width: 860px) {
  .charter-layout { grid-template-columns: 1fr; }
}

.charter-aside {
  padding: 0.85rem 1rem;
}

.charter-toc > summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--soil-dark);
  list-style: none;
}

.charter-toc > summary::-webkit-details-marker {
  display: none;
}

.charter-toc-summary::before {
  content: "▾ ";
  color: var(--leaf);
}

.charter-toc:not([open]) .charter-toc-summary::before {
  content: "▸ ";
}

.charter-toc-count {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.charter-nav a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 0.4rem;
  border-left: 2px solid transparent;
  color: var(--soil-dark);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.charter-nav a:hover {
  background: rgba(95, 125, 90, 0.09);
}

.charter-nav-num {
  flex: 0 0 auto;
  min-width: 1.35em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.charter-nav-title {
  flex: 1 1 auto;
  overflow-wrap: break-word;
}

.charter-nav a.active {
  font-weight: 700;
  color: var(--leaf);
  background: rgba(95, 125, 90, 0.12);
  border-left-color: var(--leaf);
}

.charter-nav a.active .charter-nav-num { color: var(--leaf); }

.charter-body {
  max-width: 68ch;
  font-size: 1.05rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
}

.charter-body p {
  margin: 0 0 0.95rem;
  text-align: justify;
  text-justify: inter-word;
}

.charter-nav {
  max-height: min(70vh, 36rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline: 0.5rem;
  margin: 0.55rem -0.5rem 0;
}

@media (max-width: 860px) {
  .charter-toc {
    margin: 0;
  }

  /* On mobile keep TOC collapsed by default via JS; CSS caps height when open */
  .charter-nav {
    max-height: 40vh;
  }
}

h1.h2 {
  overflow-wrap: normal;
  word-break: normal;
  max-width: none;
}

/* Forms / buttons / tables (shared with admin views) */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--soil);
  border-color: var(--soil);
  color: #fff;
}

.btn-primary:hover {
  background: var(--soil-dark);
  border-color: var(--soil-dark);
  color: #fff;
  box-shadow: 0 6px 16px rgba(28, 47, 37, 0.22);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--soil-dark);
}

.btn-outline-secondary:hover {
  border-color: var(--soil);
  color: var(--soil);
  background: rgba(95, 125, 90, 0.08);
  transform: translateY(-1px);
}

:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--soil);
  padding: 0;
  font-weight: 500;
}

.btn-link.text-danger { color: #a33b2d; }

.form-label { display: block; margin-bottom: 0.3rem; font-weight: 600; }
.form-control,
.form-select,
input.form-control,
textarea.form-control,
select.form-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  background: #fff;
}

.form-check { display: flex; align-items: center; gap: 0.45rem; }
.form-check-input { width: 1rem; height: 1rem; }

.table-responsive { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.alert {
  border-radius: 0.55rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.alert-success {
  background: #e7f3e4;
  color: #245333;
  border: 1px solid #c5dfbf;
}

.text-muted { color: var(--muted); }
.text-danger { color: #a33b2d; }
.text-end { text-align: right; }
.small { font-size: 0.9rem; }
.fw-semibold { font-weight: 600; }
.fs-3 { font-size: 1.75rem; }
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.w-100 { width: 100%; }
.d-inline, .d-inline-block { display: inline-block; }
.d-inline { display: inline; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.py-4 { padding-block: 1.5rem; }

.row {
  display: grid;
  gap: 1rem;
}
.row.g-2 { gap: 0.5rem; }
.row.g-3 { gap: 1rem; }

.col-12 { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .row { grid-template-columns: repeat(12, 1fr); }
  .col-sm-1, .col-md-1 { grid-column: span 1; }
  .col-sm-2, .col-md-2 { grid-column: span 2; }
  .col-sm-3, .col-md-3 { grid-column: span 3; }
  .col-sm-4, .col-md-4 { grid-column: span 4; }
  .col-sm-5, .col-md-5 { grid-column: span 5; }
  .col-sm-6, .col-md-6 { grid-column: span 6; }
  .col-sm-7, .col-md-7 { grid-column: span 7; }
  .col-sm-8, .col-md-8 { grid-column: span 8; }
  .col-sm-9, .col-md-9 { grid-column: span 9; }
  .col-sm-10, .col-md-10 { grid-column: span 10; }
  .col-sm-11, .col-md-11 { grid-column: span 11; }
  .col-sm-12, .col-md-12 { grid-column: span 12; }
}

@media (min-width: 992px) {
  .col-lg-1 { grid-column: span 1; }
  .col-lg-2 { grid-column: span 2; }
  .col-lg-3 { grid-column: span 3; }
  .col-lg-4 { grid-column: span 4; }
  .col-lg-5 { grid-column: span 5; }
  .col-lg-6 { grid-column: span 6; }
  .col-lg-7 { grid-column: span 7; }
  .col-lg-8 { grid-column: span 8; }
  .col-lg-9 { grid-column: span 9; }
  .col-lg-10 { grid-column: span 10; }
  .col-lg-11 { grid-column: span 11; }
  .col-lg-12 { grid-column: span 12; }
}

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
}

dl.row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
}
dl.row dt { font-weight: 600; color: var(--muted); }
dl.row dd { margin: 0; }

@media (max-width: 640px) {
  dl.row { grid-template-columns: 1fr; }
}

/* Admin sidebar layout */
.admin-layout {
  min-height: 100dvh;
  background: #f4f1ea;
  display: flex;
  flex-direction: column;
}

.admin-sidebar {
  background: var(--soil-dark);
  color: #fff;
  padding: 1rem 0.9rem 1.1rem;
}

.admin-sidebar-brand {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.3rem 0.4rem 0.9rem;
}

.admin-sidebar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.admin-sidebar-group { display: contents; }
.admin-sidebar-label { display: none; }

.admin-sidebar a,
.admin-sidebar-footer a {
  color: #dce9d8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  white-space: nowrap;
}
.admin-sidebar a:hover,
.admin-sidebar-footer a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.admin-sidebar a.is-active { background: var(--leaf); color: #fff; }

.admin-sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.admin-sidebar-footer form { margin: 0; }
.admin-sidebar-footer .admin-logout-btn {
  background: none;
  border: 0;
  color: #dce9d8;
  font: inherit;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
}
.admin-sidebar-footer .admin-logout-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.admin-content-wrap { flex: 1; min-width: 0; }
.admin-content {
  width: min(100% - 2rem, 1200px);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

@media (min-width: 900px) {
  .admin-layout { flex-direction: row; }

  .admin-sidebar {
    width: 232px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100dvh;
    overflow-y: auto;
    padding: 1.1rem 0.9rem 1.5rem;
  }

  .admin-sidebar-nav { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .admin-sidebar-group { display: block; margin-bottom: 0.5rem; }
  .admin-sidebar-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #97ab92;
    padding: 0.6rem 0.55rem 0.25rem;
  }
  .admin-sidebar a { display: block; }

  .admin-sidebar-footer { flex-direction: column; }

  .admin-content { width: 100%; max-width: none; margin: 0; padding: 1.75rem 2rem 2.5rem; }
}

/* Admin (legacy top-bar layout, still used by Cabinet/Forum areas) */
.admin-shell {
  min-height: 100dvh;
  background: #f4f1ea;
  display: flex;
  flex-direction: column;
}

.admin-nav {
  background: var(--soil-dark);
  color: #fff;
  padding: 0.85rem 0;
}

.admin-nav-inner {
  width: min(100% - 2rem, 1200px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
}

.admin-nav a {
  color: #dce9d8;
  text-decoration: none;
  font-weight: 500;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.captcha-img {
  border: 1px solid #cdd7c8;
  border-radius: 6px;
  background: #eef3ea;
  display: block;
}

.captcha-refresh {
  padding: 0;
  font-size: 0.9rem;
}

.captcha-input {
  max-width: 260px;
  letter-spacing: 0.15em;
}

.admin-nav .brand-admin {
  color: #fff;
  font-weight: 700;
  margin-right: 0.5rem;
}

.admin-nav .admin-logout-form {
  margin: 0;
  display: inline;
}

.admin-nav .admin-logout-btn {
  background: none;
  border: 0;
  padding: 0;
  color: #dce9d8;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.admin-nav .admin-logout-btn:hover {
  color: #fff;
  text-decoration: underline;
}

.admin-main {
  width: min(100% - 2rem, 1200px);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  flex: 1;
}

.table-warning { background: #fff4d6; }
.h2 { font-size: 1.7rem; }
.h3 { font-size: 1.4rem; }
.h4 { font-size: 1.2rem; }
.h5 { font-size: 1.05rem; }
.h6 { font-size: 0.95rem; }

/* Forum */
.forum-breadcrumb {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.forum-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.forum-breadcrumb a:hover {
  color: var(--soil);
  text-decoration: underline;
}

.forum-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.forum-avatar {
  width: 2.6rem;
  height: 2.6rem;
  min-width: 2.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  font-family: "Source Serif 4", Georgia, serif;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.forum-avatar-sm { width: 2.15rem; height: 2.15rem; min-width: 2.15rem; font-size: 0.88rem; }

.forum-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  line-height: 1.5;
  vertical-align: middle;
}
.forum-badge-pinned { background: #fff1cf; color: #8a6100; }
.forum-badge-locked { background: #eee9dd; color: var(--muted); }
.forum-badge-board { background: var(--soil); color: #fff; }
.forum-badge-hidden { background: #fbe4e0; color: #a33b2d; }

.forum-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.forum-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.forum-row:last-child { border-bottom: none; }
.forum-row:hover { background: rgba(95, 125, 90, 0.08); }
.forum-row.is-hidden { opacity: 0.55; }

.forum-row-main { flex: 1; min-width: 0; }
.forum-row-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-weight: 650;
  color: var(--soil-dark);
  font-size: 1.02rem;
}
.forum-row-meta {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.forum-row-stats {
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.forum-row-stats strong {
  display: block;
  color: var(--soil-dark);
  font-size: 1.05rem;
  font-family: "Source Serif 4", Georgia, serif;
}

.forum-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

.forum-topic-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.forum-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.forum-toolbar-actions form { margin: 0; }

.forum-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.forum-post {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.forum-post.is-board { border-left: 3px solid var(--soil); }
.forum-post.is-hidden { opacity: 0.55; }

.forum-post-body { flex: 1; min-width: 0; }
.forum-post-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.forum-post-author { font-weight: 700; color: var(--soil-dark); }
.forum-post-date { font-size: 0.82rem; color: var(--muted); }
.forum-post-text {
  margin: 0;
  overflow-wrap: break-word;
  line-height: 1.65;
}
.forum-post-text > *:first-child { margin-top: 0; }
.forum-post-text > *:last-child { margin-bottom: 0; }
.forum-post-text p { margin: 0 0 0.7rem; }
.forum-post-text ul, .forum-post-text ol { margin: 0 0 0.7rem 1.3rem; padding: 0; }
.forum-post-text h1, .forum-post-text h2, .forum-post-text h3, .forum-post-text h4 {
  margin: 0.9rem 0 0.5rem;
  font-size: 1.1rem;
}
.forum-post-text table {
  border-collapse: collapse;
  margin: 0 0 0.7rem;
  max-width: 100%;
}
.forum-post-text table td, .forum-post-text table th {
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
}
.forum-post-text a { color: var(--soil); text-decoration: underline; }
.forum-post-text blockquote {
  margin: 0 0 0.7rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.forum-post-text code {
  background: #f0ece2;
  border-radius: 0.3rem;
  padding: 0.05rem 0.35rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
}
.forum-post-text pre {
  background: #f0ece2;
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
  margin: 0 0 0.7rem;
}
.forum-post-text pre code { background: none; padding: 0; }
.forum-post-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.9rem;
  font-size: 0.8rem;
}
.forum-post-actions form { margin: 0; }
.forum-post-actions button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.forum-post-actions button:hover { color: var(--soil); text-decoration: underline; }

.forum-reply {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.forum-reply-form { flex: 1; min-width: 0; }
.forum-reply-label {
  margin: 0 0 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--soil-dark);
}
