@font-face {
  font-family: 'DescScor';
  src: url('/fonts/DescScor.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --wiki-page-bg: #1b1b1f;
  --wiki-surface: #26262b;
  --wiki-surface-2: #2e2e35;
  --wiki-header-bg: #0d0d10;
  --wiki-header-height: 40px;
  --wiki-sidebar-width: 230px;
  --wiki-article-bg: #ffffff;
  --wiki-article-text: #202122;
  --wiki-accent: #e05a00;
  --wiki-accent-hover: #c44d00;
  --wiki-link: #3366cc;
  --wiki-link-visited: #795cb2;
  --wiki-link-new: #cc0000;
  --wiki-border: #a2a9b1;
  --wiki-border-light: #eaecf0;
  --wiki-sidebar-text: #c8c8cc;
  --wiki-sidebar-heading: #a0a0a8;
  --wiki-muted: #7a7a80;
  --wiki-success: #2d7a2d;
  --wiki-error: #cc0000;
  --wiki-font-display: 'DescScor', 'Arial Narrow', Arial, sans-serif;
  --wiki-font-article: Georgia, 'Linux Libertine', 'Times New Roman', serif;
  --wiki-font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --wiki-font-mono: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  --wiki-radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--wiki-font-ui);
  background: var(--wiki-page-bg) url('/images/descentspace.webp') center center / cover fixed;
  color: var(--wiki-sidebar-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ */
/* TOP HEADER */
/* ------------------------------------------------------------------ */
#wiki-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--wiki-header-height);
  background: var(--wiki-header-bg);
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

#wiki-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

#wiki-logo img {
  height: 24px;
  width: auto;
}

#wiki-logo-text {
  font-size: 17px;
  font-family: var(--wiki-font-display);
  font-weight: normal;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
#wiki-logo-text span {
  color: var(--wiki-accent);
}

#wiki-search-form {
  flex: 1;
  max-width: 380px;
  display: flex;
  gap: 0;
}
#wiki-search-input {
  flex: 1;
  height: 26px;
  padding: 0 9px;
  background: #1e1e24;
  border: 1px solid #383838;
  border-right: none;
  border-radius: var(--wiki-radius) 0 0 var(--wiki-radius);
  color: #ffffff;
  font-size: 12px;
  outline: none;
}
#wiki-search-input::placeholder { color: #666; }
#wiki-search-input:focus { border-color: var(--wiki-accent); background: #252530; }
#wiki-search-btn {
  height: 26px;
  padding: 0 10px;
  background: var(--wiki-accent);
  border: 1px solid var(--wiki-accent);
  border-radius: 0 var(--wiki-radius) var(--wiki-radius) 0;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--wiki-font-ui);
}
#wiki-search-btn:hover { background: var(--wiki-accent-hover); }

#wiki-header-spacer { flex: 1; }

#wiki-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.wiki-header-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
  font-family: var(--wiki-font-ui);
}
.wiki-header-btn--primary {
  background: var(--wiki-accent);
  color: #fff;
  border: none;
}
.wiki-header-btn--primary:hover { background: var(--wiki-accent-hover); }
.wiki-header-btn--ghost {
  background: transparent;
  color: #ccc;
  border: 1px solid #555;
}
.wiki-header-btn--ghost:hover { border-color: #888; color: #fff; }

#wiki-user-display {
  font-size: 13px;
  color: #ccc;
}
#wiki-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--wiki-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* BODY LAYOUT */
/* ------------------------------------------------------------------ */
#wiki-body {
  display: flex;
  margin-top: var(--wiki-header-height);
  flex: 1;
  min-height: calc(100vh - var(--wiki-header-height));
}

/* ------------------------------------------------------------------ */
/* LEFT SIDEBAR */
/* ------------------------------------------------------------------ */
#wiki-sidebar {
  width: var(--wiki-sidebar-width);
  flex-shrink: 0;
  background: var(--wiki-surface);
  border-right: 1px solid #333;
  padding: 16px 0;
  min-height: 100%;
  position: sticky;
  top: var(--wiki-header-height);
  max-height: calc(100vh - var(--wiki-header-height));
  overflow-y: auto;
}

.wiki-sidebar-section {
  padding: 4px 0 12px;
  border-bottom: 1px solid #333;
  margin-bottom: 4px;
}
.wiki-sidebar-section:last-child { border-bottom: none; }

.wiki-sidebar-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--wiki-sidebar-heading);
  padding: 8px 16px 4px;
}

.wiki-sidebar-link {
  display: block;
  padding: 5px 16px 5px 20px;
  color: var(--wiki-sidebar-text);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.1s, color 0.1s;
  border-left: 3px solid transparent;
}
.wiki-sidebar-link:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.wiki-sidebar-link.active {
  border-left-color: var(--wiki-accent);
  background: rgba(224,90,0,0.1);
  color: #fff;
}

/* Signed-in username label in sidebar */
.wiki-sidebar-username {
  display: block;
  padding: 5px 16px 5px 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ */
/* MAIN CONTENT AREA */
/* ------------------------------------------------------------------ */
#wiki-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ------------------------------------------------------------------ */
/* RIGHT TOC PANEL */
/* ------------------------------------------------------------------ */
#wiki-toc-panel {
  width: 210px;
  flex-shrink: 0;
  background: var(--wiki-surface);
  border-left: 1px solid #333;
  padding: 20px 0;
  position: sticky;
  top: var(--wiki-header-height);
  height: calc(100vh - var(--wiki-header-height));
  overflow-y: auto;
}
#wiki-toc-panel:empty { display: none; }
.wiki-toc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--wiki-sidebar-heading);
  padding: 0 16px 10px;
}
.wiki-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wiki-toc-list > li { margin: 0; }
.wiki-toc-list > li > a {
  display: block;
  padding: 4px 12px 4px 16px;
  color: var(--wiki-sidebar-text);
  text-decoration: none;
  font-size: 12.5px;
  border-left: 3px solid transparent;
  transition: background 0.1s, color 0.1s;
}
.wiki-toc-list > li > a:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.wiki-toc-list > li > a.wiki-toc-active {
  border-left-color: var(--wiki-accent);
  background: rgba(224,90,0,0.1);
  color: #fff;
}
.wiki-toc-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wiki-toc-sub li a {
  display: block;
  padding: 3px 12px 3px 26px;
  color: var(--wiki-sidebar-text);
  font-size: 12px;
  text-decoration: none;
  opacity: 0.8;
  transition: color 0.1s;
}
.wiki-toc-sub li a:hover {
  color: #fff;
  opacity: 1;
}
.wiki-toc-sub li a.wiki-toc-active {
  color: var(--wiki-accent);
  opacity: 1;
}

/* Offset anchor targets so the fixed header doesn't cover them */
#wiki-article-body h2,
#wiki-article-body h3,
#wiki-article-body h4 {
  scroll-margin-top: calc(var(--wiki-header-height) + 12px);
}

/* ------------------------------------------------------------------ */
/* ARTICLE SHELL */
/* ------------------------------------------------------------------ */
#wiki-article-shell {
  flex: 1;
  background: var(--wiki-article-bg);
  padding: 20px 28px 40px;
  max-width: 1400px;
  width: 100%;
  min-height: calc(100vh - var(--wiki-header-height));
}

/* Article title bar */
#wiki-article-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 0;
  margin-bottom: 16px;
  gap: 12px;
}
#wiki-article-title {
  font-family: var(--wiki-font-display);
  font-size: 28px;
  font-weight: normal;
  color: var(--wiki-article-text);
  line-height: 1.2;
  flex: 1;
  letter-spacing: 0.5px;
}
.wiki-article-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-end;
  margin-bottom: -1px;
}
.wiki-tab-btn {
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid #ccc;
  background: #f6f6f6;
  color: #333;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  border-bottom: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--wiki-font-ui);
  transition: background 0.1s;
}
.wiki-tab-btn:hover { background: #e8e8e8; }
.wiki-tab-btn--edit {
  background: var(--wiki-accent);
  border-color: var(--wiki-accent-hover);
  color: #fff;
}
.wiki-tab-btn--edit:hover { background: var(--wiki-accent-hover); }
.wiki-tab-btn--new {
  background: #2d7a2d;
  border-color: #256025;
  color: #fff;
}
.wiki-tab-btn--new:hover { background: #256025; }

/* ------------------------------------------------------------------ */
/* ARTICLE BODY TYPOGRAPHY */
/* ------------------------------------------------------------------ */
#wiki-article-body {
  font-family: var(--wiki-font-ui);
  font-size: 14px;
  line-height: 1.6;
  color: var(--wiki-article-text);
}

#wiki-article-body h1,
#wiki-article-body h2,
#wiki-article-body h3,
#wiki-article-body h4,
#wiki-article-body h5 {
  font-family: var(--wiki-font-display);
  font-weight: normal;
  color: var(--wiki-article-text);
  margin: 1.4em 0 0.4em;
  line-height: 1.3;
  letter-spacing: 0.3px;
}
#wiki-article-body h2 {
  font-size: 19px;
  border-bottom: 1px solid var(--wiki-border-light);
  padding-bottom: 4px;
}
#wiki-article-body h3 { font-size: 16px; }
#wiki-article-body h4 { font-size: 14px; }

#wiki-article-body p { margin: 0 0 0.8em; }

#wiki-article-body a {
  color: var(--wiki-link);
  text-decoration: none;
}
#wiki-article-body a:hover { text-decoration: underline; }
#wiki-article-body a:visited { color: var(--wiki-link-visited); }
#wiki-article-body a.wiki-new-link { color: var(--wiki-link-new); }

#wiki-article-body ul,
#wiki-article-body ol {
  margin: 0 0 0.8em 2em;
}
#wiki-article-body li { margin: 0.2em 0; }

#wiki-article-body table {
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 13px;
}
#wiki-article-body table th,
#wiki-article-body table td {
  border: 1px solid var(--wiki-border);
  padding: 6px 10px;
  text-align: left;
}
#wiki-article-body table th {
  background: #eaecf0;
  font-weight: 600;
}
#wiki-article-body table tr:nth-child(even) td { background: #f8f9fa; }

#wiki-article-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--wiki-border);
}

#wiki-article-body code {
  font-family: var(--wiki-font-mono);
  font-size: 12px;
  background: #f4f4f4;
  border: 1px solid #ddd;
  padding: 1px 4px;
  border-radius: 2px;
}
#wiki-article-body pre {
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-left: 4px solid var(--wiki-accent);
  padding: 12px;
  overflow-x: auto;
  margin: 0.8em 0;
  border-radius: 0 4px 4px 0;
}
#wiki-article-body pre code {
  background: none;
  border: none;
  padding: 0;
}
#wiki-article-body blockquote {
  border-left: 4px solid #ddd;
  padding-left: 16px;
  color: #555;
  margin: 0.8em 0;
}
#wiki-article-body hr {
  border: none;
  border-top: 1px solid var(--wiki-border-light);
  margin: 1.5em 0;
}

/* Infobox (floated right table) */
.wiki-infobox {
  float: right;
  clear: right;
  margin: 0 0 16px 20px;
  border: 1px solid var(--wiki-border);
  background: #f8f9fa;
  font-size: 12.5px;
  min-width: 180px;
  max-width: 260px;
}
.wiki-infobox caption,
.wiki-infobox th[colspan] {
  background: var(--wiki-accent);
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 5px 8px;
  font-size: 13px;
}
.wiki-infobox th {
  background: #eaecf0;
  padding: 4px 8px;
  white-space: nowrap;
}
.wiki-infobox td { padding: 4px 8px; }

/* Float table wrapper — {right} or {left} before a markdown table */
.wiki-table-float { clear: both; max-width: 360px; }
.wiki-table-float--right { float: right; clear: right; margin: 4px 0 18px 24px; }
.wiki-table-float--left { float: left; clear: left; margin: 4px 24px 18px 0; }
.wiki-table-float table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: rgba(12, 12, 16, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--wiki-radius);
  overflow: hidden;
}
.wiki-table-float table th {
  background: rgba(224, 90, 0, 0.18);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}
.wiki-table-float table td {
  padding: 5px 10px;
  color: #ccc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}
.wiki-table-float table tr:last-child td { border-bottom: none; }

/* Article TOC */
#wiki-toc {
  background: #f8f9fa;
  border: 1px solid var(--wiki-border);
  display: inline-block;
  padding: 10px 16px;
  margin: 0 0 16px;
  font-size: 13px;
  min-width: 180px;
}
#wiki-toc-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--wiki-article-text);
}
#wiki-toc ol { margin-left: 16px; }
#wiki-toc a { color: var(--wiki-link); text-decoration: none; }
#wiki-toc a:hover { text-decoration: underline; }

/* Categories */
#wiki-article-categories {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 1px solid var(--wiki-border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #555;
}
.wiki-category-label { font-weight: 600; color: #333; }
.wiki-category-tag {
  padding: 2px 10px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 12px;
  color: var(--wiki-link);
  text-decoration: none;
  font-size: 12px;
  transition: background 0.1s;
}
.wiki-category-tag:hover { background: #e0e0e0; }

/* Article meta (last edited) */
#wiki-article-meta {
  margin-top: 10px;
  font-size: 11.5px;
  color: #888;
}
#wiki-article-meta a { color: #888; }

/* ------------------------------------------------------------------ */
/* EMPTY / NOT FOUND STATE */
/* ------------------------------------------------------------------ */
.wiki-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
.wiki-empty-state h2 {
  font-size: 20px;
  color: var(--wiki-article-text);
  margin-bottom: 10px;
  font-weight: normal;
}
.wiki-empty-state p { margin-bottom: 16px; font-size: 14px; }
.wiki-not-found-create {
  display: inline-block;
  padding: 8px 20px;
  background: #2d7a2d;
  color: #fff;
  text-decoration: none;
  border-radius: var(--wiki-radius);
  font-size: 13px;
  font-weight: 600;
}
.wiki-not-found-create:hover { background: #256025; text-decoration: none; color: #fff; }

/* ------------------------------------------------------------------ */
/* MESSAGES / ALERTS */
/* ------------------------------------------------------------------ */
.wiki-alert {
  padding: 10px 14px;
  border-radius: var(--wiki-radius);
  margin-bottom: 14px;
  font-size: 13px;
  border-left: 4px solid;
  display: none;
}
.wiki-alert.visible { display: block; }
.wiki-alert--success { background: #e8f5e9; border-color: #2d7a2d; color: #1a4d1a; }
.wiki-alert--error   { background: #fdecea; border-color: #cc0000; color: #7a0000; }
.wiki-alert--info    { background: #e8f0fe; border-color: #3366cc; color: #1a3a8a; }
.wiki-alert--warning { background: #fff8e1; border-color: #f5a623; color: #7a5400; }

/* ------------------------------------------------------------------ */
/* FOOTER */
/* ------------------------------------------------------------------ */
#wiki-footer {
  background: var(--wiki-header-bg);
  border-top: 1px solid #333;
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: auto;
}
#wiki-footer a { color: #888; text-decoration: none; }
#wiki-footer a:hover { color: #aaa; }
body.wiki-home #wiki-footer {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-top-color: rgba(255,255,255,0.07);
}

/* ------------------------------------------------------------------ */
/* LOADING SPINNER */
/* ------------------------------------------------------------------ */
.wiki-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: var(--wiki-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wiki-loading-full {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; gap: 12px; color: #999; font-size: 14px;
}

/* ------------------------------------------------------------------ */
/* SEARCH RESULTS PAGE */
/* ------------------------------------------------------------------ */
.wiki-search-result {
  padding: 12px 0;
  border-bottom: 1px solid var(--wiki-border-light);
}
.wiki-search-result:last-child { border-bottom: none; }
.wiki-search-result-title a {
  font-size: 16px;
  font-weight: 600;
  color: var(--wiki-link);
  text-decoration: none;
}
.wiki-search-result-title a:hover { text-decoration: underline; }
.wiki-search-result-excerpt {
  font-size: 13px;
  color: #555;
  margin-top: 3px;
}
.wiki-search-result-meta { font-size: 12px; color: #999; margin-top: 2px; }

/* Dark context: recent articles on homepage */
.wiki-main-section .wiki-search-result {
  border-bottom-color: rgba(255,255,255,0.07);
}
.wiki-main-section .wiki-search-result-title a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-size: 14px;
}
.wiki-main-section .wiki-search-result-title a:hover { color: #fff; }
.wiki-main-section .wiki-search-result-meta { color: rgba(255,255,255,0.3); }
.wiki-main-section .wiki-category-tag {
  background: rgba(224,90,0,0.15);
  color: rgba(224,90,0,0.8);
  border-color: rgba(224,90,0,0.25);
}

/* ------------------------------------------------------------------ */
/* RECENT CHANGES TABLE */
/* ------------------------------------------------------------------ */
.wiki-changes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wiki-changes-table th {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 2px solid var(--wiki-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
}
.wiki-changes-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--wiki-border-light);
  vertical-align: top;
}
.wiki-changes-table tr:hover td { background: #f8f9fa; }
.wiki-diff-new { color: #2d7a2d; font-weight: 600; font-size: 12px; }
.wiki-diff-edit { color: var(--wiki-link); font-size: 12px; }

/* ------------------------------------------------------------------ */
/* HISTORY PAGE */
/* ------------------------------------------------------------------ */
.wiki-history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wiki-border-light);
  font-size: 13px;
}
.wiki-history-time { color: var(--wiki-link); cursor: pointer; min-width: 130px; flex-shrink: 0; }
.wiki-history-time:hover { text-decoration: underline; }
.wiki-history-user { font-weight: 600; color: #333; min-width: 120px; flex-shrink: 0; }
.wiki-history-summary { color: #555; font-style: italic; flex: 1; }
.wiki-history-restore {
  font-size: 11px;
  color: var(--wiki-link);
  cursor: pointer;
  white-space: nowrap;
}
.wiki-history-restore:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* LOGIN PAGE */
/* ------------------------------------------------------------------ */
.wiki-login-wrap {
  max-width: 380px;
  width: 100%;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  padding: 28px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.wiki-login-title {
  font-size: 22px;
  font-weight: normal;
  font-family: var(--wiki-font-display);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--wiki-article-text);
}
.wiki-login-sub {
  font-size: 13px;
  color: #555;
  margin-bottom: 20px;
}
.wiki-form-group { margin-bottom: 14px; }
.wiki-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}
.wiki-form-group input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: var(--wiki-radius);
  font-size: 13px;
  outline: none;
  font-family: var(--wiki-font-ui);
  transition: border-color 0.15s;
}
.wiki-form-group input:focus { border-color: var(--wiki-accent); }
.wiki-form-submit {
  width: 100%;
  height: 36px;
  background: var(--wiki-accent);
  color: #fff;
  border: none;
  border-radius: var(--wiki-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--wiki-font-ui);
  margin-top: 6px;
  transition: background 0.15s;
}
.wiki-form-submit:hover { background: var(--wiki-accent-hover); }
.wiki-login-note {
  font-size: 12px;
  color: #888;
  margin-top: 14px;
  text-align: center;
}
.wiki-login-note a { color: var(--wiki-link); text-decoration: none; }

/* ------------------------------------------------------------------ */
/* MAIN PAGE HERO */
/* ------------------------------------------------------------------ */
.wiki-hero {
  position: relative;
  padding: 90px 40px 70px;
  color: #e8e8e8;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.wiki-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}
.wiki-hero > * { position: relative; z-index: 1; }

/* Wordmark */
.wiki-hero-wordmark {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  line-height: 1;
  flex-wrap: wrap;
  justify-content: center;
}
.wiki-hero-wordmark-descent {
  font-family: var(--wiki-font-display);
  font-size: 62px;
  font-weight: normal;
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.8);
}
.wiki-hero-wordmark-nexus {
  font-family: var(--wiki-font-display);
  font-size: 62px;
  font-weight: normal;
  color: var(--wiki-accent);
  letter-spacing: 4px;
  text-shadow: 0 4px 24px rgba(224,90,0,0.5);
}
.wiki-hero-wordmark-wiki {
  font-family: var(--wiki-font-ui);
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 3px;
  text-transform: uppercase;
  align-self: flex-end;
  padding-bottom: 10px;
}

.wiki-hero-sub {
  font-size: 13.5px;
  color: rgba(255,255,255,0.5);
  max-width: 420px;
  line-height: 1.7;
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

/* Hero search bar */
.wiki-hero-search-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-top: 20px;
}
.wiki-hero-search {
  display: flex;
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  transition: border-color 0.15s, background 0.15s;
}
.wiki-hero-search:focus-within {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
}
.wiki-hero-search input {
  flex: 1;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  font-family: var(--wiki-font-ui);
}
.wiki-hero-search input::placeholder { color: rgba(255,255,255,0.45); }
.wiki-hero-search button {
  height: 38px;
  width: 42px;
  padding: 0;
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: none;
  font-size: 16px;
  cursor: pointer;
  font-family: var(--wiki-font-ui);
  transition: color 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wiki-hero-search button:hover { color: #fff; }

/* Hero search dropdown */
#wiki-hero-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--wiki-surface);
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
  overflow: hidden;
}

/* Quick links */
.wiki-hero-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.wiki-hero-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  letter-spacing: 0.3px;
}
.wiki-hero-links a:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

/* Hide header search on home page — it lives in the hero instead */
body.wiki-home #wiki-search-wrap { display: none; }

.wiki-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wiki-hero-btn {
  padding: 9px 24px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: var(--wiki-font-ui);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.15s;
}
.wiki-hero-btn--primary {
  background: var(--wiki-accent);
  color: #fff;
}
.wiki-hero-btn--primary:hover { background: var(--wiki-accent-hover); }
.wiki-hero-btn--outline {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
}
.wiki-hero-btn--outline:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* Main page portal grid */
.wiki-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 24px 28px;
  max-width: 960px;
}
.wiki-portal-card {
  background: rgba(15,15,18,0.65);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--wiki-radius);
  padding: 0 0 14px 0;
  text-decoration: none;
  color: #ddd;
  backdrop-filter: blur(6px);
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.wiki-portal-card:hover {
  border-color: var(--wiki-accent);
  background: rgba(224,90,0,0.1);
  color: #fff;
  text-decoration: none;
}
/* Hosted image at the top of a card */
.wiki-portal-card-img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--wiki-radius) var(--wiki-radius) 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 12px;
}
/* Placeholder when no image is set */
.wiki-portal-card-placeholder {
  width: 100%;
  height: 80px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--wiki-radius) var(--wiki-radius) 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}
/* Admin-only edit button overlaid on the card */
.wiki-portal-card-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}
.wiki-portal-card-edit:hover {
  background: var(--wiki-accent);
  border-color: transparent;
  color: #fff;
}
.wiki-portal-card-icon {
  display: inline-block;
  font-family: var(--wiki-font-display);
  font-size: 10px;
  font-weight: normal;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--wiki-accent);
  border: 1px solid rgba(224,90,0,0.5);
  border-radius: 2px;
  padding: 2px 7px;
  margin-bottom: 10px;
  line-height: 1.6;
}
.wiki-portal-card-title {
  font-family: var(--wiki-font-display);
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.5px;
  color: #eee;
  padding: 0 10px;
}

/* Live search dropdown */
#wiki-search-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
#wiki-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #18181c;
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
  border-radius: 0 0 var(--wiki-radius) var(--wiki-radius);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
}
.wiki-search-drop-item {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #ccc;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.1s, color 0.1s;
}
.wiki-search-drop-item:last-child { border-bottom: none; }
.wiki-search-drop-item:hover {
  background: rgba(224,90,0,0.15);
  color: #fff;
}

.wiki-main-section {
  padding: 20px 28px;
  max-width: 960px;
  background: rgba(10,10,13,0.7);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.wiki-main-section h2 {
  font-family: var(--wiki-font-display);
  font-size: 16px;
  font-weight: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 6px;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.5);
}
.wiki-stats-row {
  display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 20px;
}
.wiki-stat { text-align: center; }
.wiki-stat-num { font-size: 26px; font-weight: 700; color: var(--wiki-accent); }
.wiki-stat-label { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* ALL ARTICLES PAGE                                                    */
/* ------------------------------------------------------------------ */
.wiki-allarticles-filterbar {
  margin-bottom: 20px;
}
.wiki-allarticles-filterbar input {
  width: 340px;
  max-width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  background: #f8f9fa;
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  color: var(--wiki-article-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--wiki-font-ui);
}
.wiki-allarticles-filterbar input:focus {
  border-color: var(--wiki-accent);
  box-shadow: 0 0 0 2px rgba(224,90,0,0.12);
}
.wiki-allarticles-filterbar input::placeholder { color: #999; }

.wiki-allarticles-jumpnav {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 28px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid var(--wiki-border-light);
  border-radius: 6px;
}
.wiki-allarticles-jumpletter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: #444;
  text-decoration: none;
  background: transparent;
  transition: background 0.12s, color 0.12s;
}
.wiki-allarticles-jumpletter:hover {
  background: var(--wiki-accent);
  color: #fff;
}

.wiki-allarticles-count {
  font-size: 12px;
  color: #777;
  margin-bottom: 24px;
  font-style: italic;
}

.wiki-allarticles-section {
  margin-bottom: 32px;
  scroll-margin-top: calc(var(--wiki-header-height) + 12px);
}
.wiki-allarticles-letter {
  font-size: 15px;
  font-weight: 700;
  color: var(--wiki-article-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--wiki-accent);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.wiki-allarticles-letter-count {
  font-size: 11px;
  font-weight: 400;
  color: #999;
  letter-spacing: 0;
  text-transform: none;
}

.wiki-allarticles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wiki-allarticles-card {
  background: #f8f9fa;
  border: 1px solid var(--wiki-border-light);
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
  min-width: 0;
}
.wiki-allarticles-card:hover {
  border-color: var(--wiki-accent);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wiki-allarticles-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--wiki-link);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.wiki-allarticles-card:hover .wiki-allarticles-card-title {
  color: var(--wiki-accent);
}
.wiki-allarticles-card-cats {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.wiki-allarticles-cat {
  font-size: 10px;
  background: #eaecf0;
  color: #555;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}

.wiki-allarticles-empty,
.wiki-allarticles-error {
  font-size: 13px;
  color: #777;
  margin-top: 16px;
}
.wiki-allarticles-error { color: var(--wiki-error); }

@media (max-width: 1000px) {
  .wiki-allarticles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .wiki-allarticles-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE */
/* ------------------------------------------------------------------ */
@media (max-width: 780px) {
  #wiki-sidebar { display: none; }
  #wiki-toc-panel { display: none; }
  #wiki-article-shell { padding: 14px 16px 32px; }
  .wiki-hero { padding: 52px 16px 40px; }
  .wiki-hero-wordmark-descent,
  .wiki-hero-wordmark-nexus { font-size: 42px; letter-spacing: 2px; }
  .wiki-hero-search { max-width: 100%; }
  .wiki-portal-grid { padding: 16px; }
}

@media (max-width: 1100px) {
  #wiki-toc-panel { display: none; }
}

/* Center homepage content within main column */
body.wiki-home #wiki-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.wiki-home .wiki-hero,
body.wiki-home .wiki-portal-grid,
body.wiki-home .wiki-main-section {
  width: 100%;
  max-width: 860px;
}

/* ------------------------------------------------------------------ */
/* RENAME MODAL */
/* ------------------------------------------------------------------ */
#wiki-rename-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#wiki-rename-box {
  background: #fff;
  border-radius: 6px;
  padding: 28px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
#wiki-rename-box h3 {
  font-family: var(--wiki-font-display);
  font-size: 18px;
  font-weight: normal;
  margin: 0 0 6px;
  color: var(--wiki-header-bg);
}
#wiki-rename-box p {
  font-size: 13px;
  color: #555;
  margin: 0 0 14px;
}
#wiki-rename-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  outline: none;
}
#wiki-rename-input:focus {
  border-color: var(--wiki-accent);
  box-shadow: 0 0 0 2px rgba(106,154,210,0.2);
}
#wiki-rename-error {
  font-size: 12px;
  color: #c0392b;
  min-height: 18px;
  margin-top: 4px;
}
#wiki-rename-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
#wiki-rename-save {
  padding: 7px 18px;
  background: var(--wiki-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
#wiki-rename-save:hover { background: var(--wiki-accent-dark, #4a7fbf); }
#wiki-rename-save:disabled { opacity: 0.6; cursor: default; }
#wiki-rename-cancel {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: #555;
}
#wiki-rename-cancel:hover { background: #f0f0f0; }

#wiki-user-display {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* ARTICLE: FLOATED IMAGES                                             */
/* ------------------------------------------------------------------ */
.wiki-img-float {
  display: table;
  border: 1px solid var(--wiki-border-light);
  background: #f8f8f8;
  padding: 4px;
  margin: 0 0 12px 16px;
  font-size: 11px;
  color: #555;
  max-width: 300px;
  box-sizing: border-box;
}
.wiki-img-float--right {
  float: right;
  margin: 0 0 12px 16px;
}
.wiki-img-float--left {
  float: left;
  margin: 0 16px 12px 0;
}
.wiki-img-float img {
  display: block;
  max-width: 100%;
  height: auto;
}
.wiki-img-float figcaption {
  display: table-caption;
  caption-side: bottom;
  padding: 4px 2px 2px;
  text-align: center;
  line-height: 1.3;
}
/* Clear floats after article body */
#wiki-article-body::after {
  content: '';
  display: table;
  clear: both;
}

/* ------------------------------------------------------------------ */
/* DISCUSSION BOARD                                                     */
/* ------------------------------------------------------------------ */
.wiki-discuss-new {
  background: rgba(15,15,18,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--wiki-radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.wiki-discuss-new-label {
  font-family: var(--wiki-font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}
.wiki-discuss-auth-note {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.wiki-discuss-auth-note a { color: var(--wiki-accent); }
.wiki-discuss-textarea {
  display: block;
  width: 100%;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: #ddd;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.wiki-discuss-textarea:focus { border-color: rgba(224,90,0,0.5); }
.wiki-discuss-textarea--reply { font-size: 13px; }
.wiki-discuss-form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.wiki-discuss-btn {
  background: var(--wiki-accent);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.wiki-discuss-btn:hover { background: var(--wiki-accent-hover); }
.wiki-discuss-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wiki-discuss-btn--cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.45);
}
.wiki-discuss-btn--cancel:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.wiki-discuss-btn--reply { font-size: 12px; }
.wiki-discuss-status {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.wiki-discuss-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.wiki-discuss-divider::before,
.wiki-discuss-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}
.wiki-discuss-empty {
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  padding: 12px 0;
}
.wiki-discuss-list { display: flex; flex-direction: column; gap: 12px; }
.wiki-discuss-thread {
  background: rgba(12,12,16,0.7);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--wiki-radius);
  overflow: hidden;
}
.wiki-discuss-post {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wiki-discuss-post:last-of-type { border-bottom: none; }
.wiki-discuss-post--reply {
  background: rgba(255,255,255,0.025);
  border-left: 2px solid rgba(224,90,0,0.3);
  margin-left: 16px;
  padding-left: 14px;
}
.wiki-discuss-post-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.wiki-discuss-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--wiki-accent);
}
.wiki-discuss-date {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}
.wiki-discuss-post-body {
  font-size: 14px;
  color: #ccc;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.wiki-discuss-replies {
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
}
.wiki-discuss-reply-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.wiki-discuss-reply-toggle:hover { color: var(--wiki-accent); }
.wiki-discuss-reply-form {
  padding: 10px 16px 14px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
}
