:root {
  --ink: #14213d;
  --ink-soft: #1a2d4d;
  --gold: #eaa117;
  --gold-soft: #f6e7c4;
  --bg: #f4f1ea;
  --panel: #ffffff;
  --border: #ddd6c8;
  --muted: #6b7280;
  --text: #243044;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  /* Overridden by brand_assets.php to match Super Admin branding settings. */
  --font-display: "Jost", "Futura PT", "Futura", "Century Gothic", Arial, sans-serif;
  --font-brand-name: var(--font-display);
  --brand-name-size: 1rem;
  --shadow: 0 1px 2px rgba(20, 33, 61, 0.04), 0 8px 24px rgba(20, 33, 61, 0.06);
  /* Match main site Bootstrap .container so header + body share one edge. */
  --wiki-max: 100%;
  --wiki-gutter: 0.75rem;
}
@media (min-width: 576px) {
  :root { --wiki-max: 540px; }
}
@media (min-width: 768px) {
  :root { --wiki-max: 720px; }
}
@media (min-width: 992px) {
  :root { --wiki-max: 960px; }
}
@media (min-width: 1200px) {
  :root { --wiki-max: 1140px; }
}
@media (min-width: 1400px) {
  :root { --wiki-max: 1320px; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Site-wide button font (branding → Button font / --font-button) */
body.wiki .btn,
body.wiki button,
body.wiki input[type="submit"],
body.wiki input[type="button"],
body.wiki .wiki-platform-home,
body.wiki .wiki-admin-btn,
body.wiki .wiki-home-cta,
body.wiki .wiki-home-search button,
body.wiki .wiki-sections a {
  font-family: var(--font-button, var(--font-display), system-ui, sans-serif);
}
body.wiki {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(234, 161, 23, 0.09), transparent 55%),
    var(--bg);
}
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: #9a6a0a; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.wiki-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: #1a1200;
  padding: 0.5rem 0.85rem;
  z-index: 20;
  font-weight: 700;
}
.wiki-skip:focus { left: 0.75rem; top: 0.75rem; }

.wiki-top {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 10;
}
.wiki-top-inner {
  max-width: var(--wiki-max);
  margin: 0 auto;
  padding: 0.65rem var(--wiki-gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  min-height: 68px;
  box-sizing: border-box;
  width: 100%;
}
.wiki-brand {
  display: inline-flex;
  align-items: stretch;
  gap: 0.7rem;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.wiki-brand--stacked {
  align-items: stretch;
}
.wiki-brand-logo {
  display: block;
  height: var(--brand-logo-max-h, 52px);
  width: auto;
  max-height: var(--brand-logo-max-h, 52px);
  max-width: calc(var(--brand-logo-max-h, 52px) * 3.35);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  align-self: center;
}
.wiki-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  align-items: flex-start;
  min-width: 0;
  min-height: var(--brand-logo-max-h, 52px);
  height: var(--brand-logo-max-h, 52px);
  gap: 0;
  line-height: 1.1;
  font-family: var(--font-brand-name, var(--font-display));
  font-weight: 700;
  font-size: var(--brand-name-size, 1.1rem);
  letter-spacing: -0.01em;
  color: #fff;
  box-sizing: border-box;
  padding: 0.05rem 0;
}
.wiki-brand-text--stacked {
  align-self: stretch;
}
.wiki-brand-text .brand-name {
  display: block;
  color: inherit;
  font: inherit;
  line-height: inherit;
}
.wiki-brand-text .brand-name--stacked {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0;
  line-height: 1.05;
  margin: 0;
}
.wiki-brand-text .brand-name-line {
  display: block;
  white-space: nowrap;
  line-height: 1.05;
}
.wiki-brand-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.15;
  margin-top: auto;
}
/* Same style as main site nav items, using brand menu size */
.wiki-sections {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.wiki-sections a {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-button, var(--font-display), system-ui, sans-serif);
  font-size: var(--menu-font-size, 1.05rem);
  font-weight: 650;
  padding: 0.48rem 0.85rem;
  border-radius: 4px;
  border: 1.5px solid transparent;
  background: transparent;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.wiki-sections a:hover,
.wiki-sections a:focus {
  color: #fff;
  background: transparent;
  border-color: var(--gold);
}
.wiki-sections a.is-active {
  color: #fff;
  background: transparent;
  border-color: var(--gold);
  font-weight: 600;
}
.wiki-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.wiki-search input {
  width: min(14rem, 42vw);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 4px;
  padding: 0.48rem 0.85rem;
  font-size: var(--menu-font-size, 1.05rem);
  font-family: inherit;
  line-height: 1.2;
}
.wiki-search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.wiki-search input:focus {
  outline: none;
  border-color: var(--gold);
}
.wiki-platform-home,
.wiki-admin-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.9rem;
  border-radius: 4px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-button, var(--font-display), system-ui, sans-serif);
  font-size: var(--menu-font-size, 1.05rem);
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.wiki-platform-home:hover,
.wiki-platform-home:focus,
.wiki-admin-btn:hover,
.wiki-admin-btn:focus {
  color: #fff;
  background: rgba(234, 161, 23, 0.18);
  border-color: var(--gold);
}

.wiki-shell {
  max-width: var(--wiki-max);
  margin: 0 auto;
  padding: 1.75rem var(--wiki-gutter) 3rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}
.wiki-side {
  background:
    linear-gradient(180deg, #fffdf8 0%, var(--panel) 28%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  position: sticky;
  top: 6.25rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 6rem);
  overflow: auto;
}
.wiki-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.1rem 1.1rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(234, 161, 23, 0.12) 0%, transparent 55%),
    #fffdf8;
}
.wiki-side-head-text { min-width: 0; flex: 1; }
.wiki-side-kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.wiki-side-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a7350;
}
.wiki-side-toggle {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  margin-top: 0.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.wiki-side-toggle:hover {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
  background: var(--gold-soft);
  color: var(--ink);
}
.wiki-side-toggle-icon {
  width: 0.55rem;
  height: 0.55rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.12rem;
  transition: transform 0.15s ease;
}
.wiki-shell.is-side-collapsed .wiki-side {
  display: none;
}
.wiki-shell.is-side-collapsed {
  grid-template-columns: auto 1fr;
}
.wiki-side-reopen {
  position: sticky;
  top: 5.35rem;
  align-self: start;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.wiki-shell.is-side-collapsed .wiki-side-reopen:not([hidden]) {
  display: inline-flex;
}
.wiki-side-reopen:hover {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
  background: var(--gold-soft);
}

.wiki-side-filter-wrap {
  padding: 0.65rem 0.75rem 0;
}
.wiki-side-filter {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
  color: var(--ink);
}
.wiki-side-filter:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.wiki-side-nav {
  padding: 0.85rem 0.75rem 1rem;
}
.wiki-nav-group {
  background: #faf8f3;
  border: 1px solid rgba(221, 214, 200, 0.85);
  border-radius: 9px;
  padding: 0.35rem 0.45rem 0.35rem;
}
.wiki-nav-group.is-open {
  padding-bottom: 0.55rem;
}
.wiki-nav-group + .wiki-nav-group {
  margin-top: 0.7rem;
}
.wiki-side-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.45rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.wiki-side-label:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}
.wiki-nav-group.is-open .wiki-side-label {
  color: var(--ink);
}
.wiki-side-label-text { flex: 1; min-width: 0; }
.wiki-side-label-mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(234, 161, 23, 0.22);
  flex-shrink: 0;
}
.wiki-side-chevron {
  width: 0.48rem;
  height: 0.48rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 0.2rem;
  transition: transform 0.15s ease;
  flex-shrink: 0;
  opacity: 0.85;
}
.wiki-nav-group.is-open .wiki-side-chevron {
  transform: rotate(45deg);
  margin-top: -0.1rem;
}
.wiki-nav {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
}
.wiki-nav[hidden] { display: none !important; }
.wiki-nav li + li { margin-top: 0.12rem; }
.wiki-nav a {
  display: block;
  text-decoration: none;
  padding: 0.42rem 0.65rem 0.42rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink-soft);
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wiki-nav a:hover {
  background: #fff;
  color: var(--ink);
  border-left-color: rgba(234, 161, 23, 0.45);
}
.wiki-nav a.is-active {
  background: var(--gold-soft);
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(234, 161, 23, 0.22);
}

.wiki-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.85rem 2.25rem 1.5rem;
  min-width: 0;
  box-shadow: var(--shadow);
}
.wiki-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.wiki-crumb a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.wiki-crumb a:hover { color: var(--ink); }

.wiki-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  background: #fffdf8;
  border: 1px solid rgba(221, 214, 200, 0.9);
  border-radius: 8px;
  animation: wiki-fade-up 0.35s ease both;
}
.wiki-toc-label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8a7350;
  white-space: nowrap;
}
.wiki-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1 1 12rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.wiki-toc-list li { margin: 0; }
.wiki-toc-list a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(221, 214, 200, 0.95);
  background: #fff;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wiki-toc-list a:hover,
.wiki-toc-list a:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
  background: var(--gold-soft);
}

.prose h1 {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1.25;
  color: var(--ink);
  font-weight: 700;
}
.prose h2,
.prose h3 {
  scroll-margin-top: 5.5rem;
  position: relative;
}
.prose h2 {
  margin: 1.85rem 0 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 {
  margin: 1.35rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 700;
}
.wiki-heading-anchor {
  margin-left: 0.35rem;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.prose h2:hover .wiki-heading-anchor,
.prose h3:hover .wiki-heading-anchor,
.wiki-heading-anchor:focus {
  opacity: 1;
}
.prose p, .prose li {
  line-height: 1.7;
  font-size: 1.02rem;
}
.prose ul { padding-left: 1.3rem; margin: 0.55rem 0 1rem; }
.prose ul li + li { margin-top: 0.28rem; }

/* Process-style numbered steps */
.prose ol {
  list-style: none;
  counter-reset: wiki-step;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
}
.prose ol > li {
  position: relative;
  counter-increment: wiki-step;
  margin: 0 0 0.7rem;
  padding: 0.75rem 0.95rem 0.75rem 3.1rem;
  background: #fcfbf8;
  border: 1px solid var(--border);
  border-radius: 9px;
  line-height: 1.65;
}
.prose ol > li::before {
  content: counter(wiki-step);
  position: absolute;
  left: 0.75rem;
  top: 0.78rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgba(234, 161, 23, 0.22);
}
.prose ol > li > p { margin: 0; }
.prose ol > li > p + p { margin-top: 0.45rem; }

.prose blockquote {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 0.45rem; }

.prose code {
  font-size: 0.9em;
  background: #f3efe6;
  padding: 0.12em 0.4em;
  border-radius: 3px;
}
.prose a { font-weight: 650; }
.prose strong { color: var(--ink); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0 1.25rem;
  font-size: 0.95rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th {
  background: #f7f3ea;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
}
.prose tr:last-child td { border-bottom: 0; }
.prose tr:nth-child(even) td { background: #fcfbf8; }

.wiki-article {
  animation: wiki-fade-up 0.4s ease both;
}
@keyframes wiki-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home landing */
.wiki-home {
  max-width: var(--wiki-max);
  margin: 0 auto;
  padding: 2.25rem var(--wiki-gutter) 3.5rem;
  width: 100%;
  box-sizing: border-box;
}
.wiki-home-hero {
  margin: 0 0 1.75rem;
  padding: 1.75rem 1.85rem;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(234, 161, 23, 0.16) 0%, transparent 45%),
    linear-gradient(180deg, #14213d 0%, #1a2d4d 100%);
  color: #fff;
  box-shadow: var(--shadow);
  animation: wiki-fade-up 0.4s ease both;
}
.wiki-home-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.wiki-home-hero h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.45rem);
  line-height: 1.2;
  color: #fff;
}
.wiki-home-lead {
  margin: 0 0 1.1rem;
  max-width: 38rem;
  font-size: 1.08rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.wiki-home-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 32rem;
}
.wiki-home-search input {
  flex: 1 1 12rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 7px;
  padding: 0.55rem 0.75rem;
  font: inherit;
}
.wiki-home-search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.wiki-home-search button {
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  color: #1a1200;
  font-family: var(--font-button, var(--font-display), system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}
.wiki-home-search button:hover { filter: brightness(1.05); }
.wiki-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.15rem;
}
.wiki-home-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  animation: wiki-fade-up 0.45s ease both;
  animation-delay: calc(var(--delay, 0) * 0.08s);
}
.wiki-home-card-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a7350;
}
.wiki-home-card h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}
.wiki-home-card > p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 0 0 auto;
}
.wiki-home-links {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  flex: 1;
}
.wiki-home-links li + li { margin-top: 0.35rem; }
.wiki-home-links a {
  text-decoration: none;
  font-weight: 650;
  color: var(--ink-soft);
}
.wiki-home-links a:hover { color: var(--ink); }
.wiki-home-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 0.55rem 0.95rem;
  border-radius: 7px;
  background: var(--ink);
  color: #fff !important;
  text-decoration: none;
  font-family: var(--font-button, var(--font-display), system-ui, sans-serif);
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.wiki-home-cta:hover {
  background: #1a2d4d;
  color: var(--gold) !important;
}
.wiki-home-foot {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}
.wiki-home-foot a { font-weight: 650; }

/* Search results — uses header search only */
.wiki-search-article > h1 {
  margin: 0 0 0.75rem;
}
.wiki-search-lead,
.wiki-search-count {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text);
}
.wiki-search-count {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}
.wiki-search-lead a { font-weight: 650; }
.wiki-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.wiki-search-hit-item {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.wiki-search-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  text-decoration: none;
  padding: 1rem 0.15rem 1.05rem;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.15s ease;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.wiki-search-hit:hover {
  background: #fffdf8;
  box-shadow: inset 3px 0 0 var(--gold);
  padding-left: 0.75rem;
  padding-right: 0.5rem;
}
.wiki-search-hit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a7350;
  line-height: 1.3;
}
.wiki-search-hit-sep { opacity: 0.7; }
.wiki-search-hit-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}
.wiki-search-hit:hover .wiki-search-hit-title {
  color: #9a6a0a;
}
.wiki-search-hit-snippet {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  word-break: break-word;
  max-width: 42rem;
}

@media print {
  .wiki-top,
  .wiki-side,
  .wiki-side-reopen,
  .wiki-search,
  .wiki-pager,
  .wiki-toc,
  .wiki-heading-anchor,
  .wiki-foot { display: none !important; }
  .wiki-shell { display: block; max-width: none; padding: 0; }
  .wiki-main {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  body.wiki { background: #fff; }
}

.wiki-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.wiki-pager a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fcfbf8;
  min-width: 0;
}
.wiki-pager a:hover {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
  background: var(--gold-soft);
}
.wiki-pager-next { text-align: right; justify-self: end; }
.wiki-pager-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.wiki-pager-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
}

.wiki-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}
.wiki-foot a { font-weight: 650; }

@media (max-width: 900px) {
  .wiki-shell { grid-template-columns: 1fr; }
  .wiki-shell.is-side-collapsed { grid-template-columns: auto 1fr; }
  .wiki-side {
    position: static;
    max-height: none;
  }
  .wiki-top-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
  .wiki-pager { grid-template-columns: 1fr; }
  .wiki-pager-next { justify-self: stretch; text-align: left; }
  .wiki-home { padding: 1.35rem var(--wiki-gutter) 2.5rem; }
  .wiki-home-hero { padding: 1.35rem 1.25rem; }
}
