[hidden] { display: none !important; }

/* Colours, frames and faces come from the HUD tokens in _shared.css. Only the
   wiki's own meanings live here: the two diff tints and the colour of a page
   nobody has written yet. */
:root {
  --diff-add: #15301f;
  --diff-add-ink: #bfe8c8;
  --diff-remove: #3a1622;
  --diff-remove-ink: #ffc6d0;
  /* Rust, not alarm coral: an unwritten page is an invitation, not a fault. */
  --wanted: #d98b6a;
  --wanted-hover: #f0b08f;
}

.codex-page { min-height: 100vh; padding: 0 clamp(1rem, 4vw, 3rem) 3rem; background: var(--bg); }
/* 82rem, not the 76rem the other archive pages use: the wiki gained a 19rem
   navigation rail, and at 76rem the article column it leaves behind is
   narrower than the 52rem the body text is set for. */
.codex-header, .codex-shell, .codex-footer { width: min(82rem, 100%); margin-inline: auto; }
.codex-header { display: flex; align-items: center; justify-content: space-between; min-height: 5rem; border-bottom: 1px solid var(--frame-dim); }
.header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.wiki-shell { max-width: 82rem; }
.wiki-intro { max-width: 52rem; padding: 0 0 .9rem; }
/* Page titles are player-written, so a long word has to be allowed to break
   rather than push a phone sideways in a face this wide. */
.wiki-intro h1 { margin: 0 0 .5rem; color: var(--fg); font-size: 24px; overflow-wrap: anywhere; }
/* The byline under the title: one line naming who made the page and who
   touched it last, set as a readout rather than as body copy. */
.wiki-intro p:last-child { max-width: 44rem; margin: 0; color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .03em; line-height: 1.25; }
/* A state worth knowing (locked, removed, a category, a revision view), set
   as a HUD readout under the title rather than an eyebrow above it. */
.wiki-route-tag { display: inline-flex; align-items: center; min-height: 1.75rem; margin: 0 0 .6rem; padding: .15rem .55rem; border: 1px solid var(--frame); border-radius: 4px; color: var(--sky); font-family: var(--font-readout); font-size: 20px; letter-spacing: .05em; line-height: 1; text-transform: uppercase; }
.catalog-status { color: var(--sky); font-family: var(--font-readout); font-size: 22px; letter-spacing: .04em; line-height: 1.2; text-transform: uppercase; }

/* ── The two-pane shell ────────────────────────────────────────────────────
   Rail left, one content pane right. The rail is the wiki's contents page --
   search, section tabs, the page tree, the category strip -- and it is drawn
   once at boot; everything that changes per route lives in .wiki-main beside
   it. The rail sticks while the article scrolls, and scrolls inside itself
   once the tree outgrows the viewport, so a long article never leaves the
   reader with no way back to the rest of the wiki. */
.wiki-layout { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 2rem; align-items: start; padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.wiki-main { min-width: 0; }
.wiki-rail { position: sticky; top: 1rem; display: grid; gap: .75rem; min-width: 0; }
.wiki-rail-panel { display: grid; gap: 1rem; align-content: start; max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.wiki-rail-section { min-width: 0; }
.wiki-rail-label { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; font-weight: 400; letter-spacing: .05em; line-height: 1.1; text-transform: uppercase; }
.wiki-rail-new { width: 100%; }
.wiki-rail-status { margin: .6rem 0 0; }
/* Only ever shown below the two-pane breakpoint; the rules that give it a
   shape live with the rest of the folded layout at the foot of this file. */
.wiki-rail-toggle { display: none; }
.wiki-rail-toggle-glyph { display: grid; gap: .16rem; }
.wiki-rail-toggle-glyph span { display: block; width: .75rem; height: 2px; background: var(--sky); }
.wiki-rail-toggle-glyph span:nth-child(2) { width: .55rem; margin-left: .2rem; }
.wiki-rail-toggle-glyph span:nth-child(3) { width: .4rem; margin-left: .4rem; }
.wiki-rail-caret { width: 0; height: 0; margin-left: auto; border-top: .36rem solid currentColor; border-right: .3rem solid transparent; border-left: .3rem solid transparent; }

/* ── Two panes, two scrollbars ─────────────────────────────────────────────
   Above the fold breakpoint the page stops scrolling as one document: the
   shell is exactly the viewport, and the rail and the article each scroll
   inside themselves.

   The point is that they are independent. A reader who scrolls the tree down
   to find a page and clicks it should still be looking at that part of the
   tree afterwards, and the article beside it should start at its own top --
   which is what one shared scrollbar cannot do, because moving either one
   moved both. wiki.mjs owns the article pane's position from here (see
   readScroll/writeScroll); nothing touches the rail's.

   62.01rem, not 62rem: the folded-rail rules below use max-width 62rem, and a
   shared edge would leave both shapes true at exactly 992px. Below it the
   page is one ordinary scrolling column again, which is what a phone wants
   and what the in-game reader already does. */
@media (min-width: 62.01rem) {
  .wiki-page { display: flex; flex-direction: column; height: 100vh; padding-bottom: 0; overflow: hidden; }
  .wiki-page > .codex-header { flex: 0 0 auto; }
  .wiki-shell { display: flex; flex: 1 1 auto; min-height: 0; }
  /* min-height: 0 on every one of these: a flex child defaults to min-content,
     which would let the article push the shell taller than the viewport and
     hand the scrollbar straight back to the document. */
  .wiki-layout { flex: 1 1 auto; align-items: stretch; min-height: 0; padding-bottom: 1rem; }
  .wiki-rail { position: static; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: .35rem; }
  .wiki-rail-panel { max-height: none; overflow: visible; }
  /* A flex column so the footer can take the slack: margin-top: auto pins it
     to the bottom of the pane on a short page and simply follows the content
     on a long one, which is the same gesture either way -- the end of the
     article is the end of the page. */
  .wiki-main { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: .5rem; }
  .wiki-main > .codex-footer { width: 100%; margin-top: auto; padding: 1.25rem 0 .25rem; }
  /* A heading jumped to from the contents list would otherwise land flush
     against the top edge of its own scroller. */
  .wiki-body h2, .wiki-body h3, .wiki-body h4 { scroll-margin-top: 1rem; }

  /* Two scrollbars are now part of the furniture rather than an accident of
     the document, so they are drawn like it: a steel thumb on the deep-space
     track, going sky under the pointer like the links. Both spellings are set
     on purpose -- browsers that understand scrollbar-color use it and ignore
     the ::-webkit- rules, and older WebKit does the reverse. */
  .wiki-rail, .wiki-main { scrollbar-width: thin; scrollbar-color: var(--frame-dim) var(--bg-deep); }
  .wiki-rail:hover, .wiki-main:hover { scrollbar-color: var(--frame) var(--bg-deep); }
  .wiki-rail::-webkit-scrollbar, .wiki-main::-webkit-scrollbar { width: .6rem; }
  .wiki-rail::-webkit-scrollbar-track, .wiki-main::-webkit-scrollbar-track { background: var(--bg-deep); border-left: 1px solid var(--frame-dim); }
  .wiki-rail::-webkit-scrollbar-thumb, .wiki-main::-webkit-scrollbar-thumb { background: var(--frame-dim); }
  .wiki-rail::-webkit-scrollbar-thumb:hover, .wiki-main::-webkit-scrollbar-thumb:hover { background: var(--sky); }
}

/* Shared HUD pieces: the game panel, and the inset well that sits inside one. */
.wiki-tabs, .wiki-article, .wiki-form, .wiki-diff, .wiki-moderation-grid section {
  border: 2px solid var(--frame-dim);
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: var(--panel-shadow);
}

.wiki-tabs { display: flex; flex-wrap: wrap; gap: .25rem; padding: .3rem; }
.wiki-tabs a { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; min-height: 2.75rem; padding: .5rem .6rem; border: 2px solid transparent; border-radius: 4px; color: var(--fg-dim); font-family: var(--font-readout); font-size: 22px; letter-spacing: .04em; line-height: 1; text-align: center; text-decoration: none; text-transform: uppercase; }
.wiki-tabs a:hover { color: var(--fg); background: var(--panel); }
.wiki-tabs a[aria-current="page"] { border-color: var(--frame); color: var(--accent); background: var(--panel); }
/* The moderators' way out of the archive and into their own tools. Styled as
   a quiet link rather than a third tab: the tabs above filter the same list of
   pages, this one leaves for a different screen, and only a moderator ever
   sees it. */
.wiki-rail-moderation { display: flex; align-items: center; min-height: 2.75rem; padding: .35rem .5rem; color: var(--accent); font-family: var(--font-readout); font-size: 22px; letter-spacing: .05em; line-height: 1; text-decoration: none; text-transform: uppercase; }
.wiki-rail-moderation:hover, .wiki-rail-moderation:focus-visible { color: var(--accent-soft); text-decoration: underline; }
.wiki-rail-moderation[aria-current="page"] { color: var(--accent-soft); text-decoration: underline; }
.wiki-search { display: flex; gap: .4rem; width: 100%; }
.wiki-search input { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; padding: .5rem .7rem; border: 2px solid var(--frame-dim); border-radius: 4px; background: var(--bg-deep); color: var(--fg); font: inherit; }
.wiki-search input::placeholder, .wiki-form input::placeholder { color: var(--fg-dim); }
.wiki-search input:focus, .wiki-form input:focus, .wiki-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.wiki-search button, .wiki-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .5rem .9rem; border: 2px solid var(--frame-dim); border-radius: var(--radius); background: var(--panel); color: var(--fg); font-family: var(--font-readout); font-size: 22px; font-weight: 400; letter-spacing: .05em; line-height: 1; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.wiki-search button:hover, .wiki-button:hover, .wiki-button:focus-visible { border-color: var(--frame); color: var(--sky-soft); }
.wiki-button:focus-visible, .wiki-search button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wiki-button.is-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px 0 #00000038; }
.wiki-button.is-primary:hover, .wiki-button.is-primary:focus-visible { background: var(--accent-soft); color: var(--accent-ink); }
.wiki-button.is-danger { border-color: var(--accent-hot); color: var(--accent-hot); background: var(--panel); }
.wiki-button.is-danger:hover, .wiki-button.is-danger:focus-visible { border-color: var(--accent-hot); color: var(--fg); background: var(--accent-hot); }
.wiki-button:disabled { cursor: wait; opacity: .6; }
/* Icon-only actions: square, so a row of them reads as a toolbar rather than
   as buttons that lost their words. The name lives in aria-label and title --
   see iconOnlyLink in wiki.mjs -- so nothing is lost by dropping the text. */
.wiki-button.is-icon-only, .reference-favorite-button.is-icon-only { min-width: 2.75rem; padding-inline: .6rem; }
.wiki-status { margin: .4rem 0; }
.wiki-notice { margin: 0 0 1rem; padding: .75rem 1rem; border: 2px solid var(--warn-border); border-radius: var(--radius); background: var(--warn-bg); color: var(--fg); font-size: 1rem; }
.wiki-view { margin-top: .25rem; }
.wiki-view h2 { margin: 0 0 1rem; padding: 0; border: 0; color: var(--fg); font-family: var(--font-pixel); font-size: 16px; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; text-transform: uppercase; }
.wiki-index-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.wiki-index-head h2 { margin: 0; }
.wiki-page-list, .wiki-revision-list, .wiki-plain-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.wiki-page-list li, .wiki-revision-list li, .wiki-plain-list li { margin: 0; }
.wiki-page-list li a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; min-height: 3.5rem; padding: .7rem 1rem; border: 2px solid var(--frame-dim); border-radius: var(--radius); background: var(--panel-2); color: var(--fg); text-decoration: none; }
.wiki-page-list li a:hover, .wiki-page-list li a:focus-visible { border-color: var(--frame); background: var(--panel); }
.wiki-page-list strong { display: block; font-weight: 700; }
.wiki-page-list .wiki-meta, .wiki-revision-list .wiki-meta { margin: 0; }
.wiki-search-status { margin: 0 0 .75rem; }
.wiki-search-results li a { grid-template-columns: 1fr; align-items: start; min-height: 0; gap: .3rem; }
.wiki-snippet { margin: 0; color: var(--fg-dim); font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.wiki-snippet mark { background: var(--accent); color: var(--accent-ink); padding: 0 .15rem; border-radius: 2px; }
.wiki-search-results .empty-state { margin: 0; }
.wiki-search-results li.wiki-search-create { border: 0; background: none; padding: 0; }
.wiki-meta { color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .03em; line-height: 1.2; text-transform: uppercase; }
.wiki-revision-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: .7rem 1rem; border: 2px solid var(--frame-dim); border-radius: var(--radius); background: var(--panel-2); }
/* The live revision: an amber frame, doubled in weight by the inset ring so
   it reads as different without the colour. */
.wiki-revision-list li.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wiki-revision-list li.is-selected { background: var(--panel); border-color: var(--frame); }
.wiki-revision-list strong { display: block; color: var(--fg); }
.wiki-revision-list .wiki-summary { display: block; color: var(--fg-dim); font-size: .95rem; }
.wiki-revision-list .wiki-actions { justify-content: flex-end; }
.wiki-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.reference-slot:empty { display: none; }
.reference-actions-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.reference-copy-button, .reference-favorite-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .5rem .9rem; border: 2px solid var(--frame-dim); border-radius: var(--radius); background: var(--panel); color: var(--fg); font-family: var(--font-readout); font-size: 22px; letter-spacing: .05em; line-height: 1; text-transform: uppercase; cursor: pointer; }
.reference-copy-button:hover, .reference-favorite-button:hover, .reference-favorite-button:focus-visible { border-color: var(--frame); color: var(--sky-soft); }
.reference-favorite-button.is-favorited { border-color: var(--accent); color: var(--accent); }
.reference-favorite-button:disabled { cursor: wait; opacity: .6; }
.reference-status { margin: .3rem 0 0; color: var(--sky); font-family: var(--font-readout); font-size: 20px; line-height: 1.3; }
.reference-status:empty { display: none; }
.reference-copy-fallback:not(:empty) { margin-top: .4rem; }
.reference-copy-fallback input { display: block; width: 100%; min-height: 2.75rem; padding: .5rem .7rem; border: 2px solid var(--frame-dim); border-radius: 4px; background: var(--bg-deep); color: var(--fg); font: .95rem/1.3 var(--font-body); }
.wiki-article { padding: clamp(1rem, 3vw, 1.75rem); }
.wiki-article-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding-bottom: .6rem; border-bottom: 1px solid var(--frame-dim); }
/* Pushed right whether or not the meta line beside it has anything to say. */
.wiki-article-head .wiki-actions { margin-left: auto; }
.wiki-body { max-width: 52rem; color: var(--fg); font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.wiki-body h2, .wiki-body h3, .wiki-body h4 { margin: 1.75rem 0 .5rem; padding: 0; border: 0; color: var(--fg); font-weight: 700; line-height: 1.3; }
.wiki-body h2 { font-size: 1.45rem; border-bottom: 1px solid var(--frame-dim); padding-bottom: .3rem; }
.wiki-body h3 { font-size: 1.2rem; }
.wiki-body h4 { font-size: 1.05rem; }
.wiki-body p { margin: .75rem 0; }
.wiki-body a.wiki-link { color: var(--sky); }
.wiki-body a.wiki-external { color: var(--sky); }
/* Leaves the site: a small corner bracket, drawn, so it never waits on a font. */
.wiki-body a.wiki-external::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .3em; border-top: 2px solid currentColor; border-right: 2px solid currentColor; vertical-align: .35em; }
.wiki-body ul, .wiki-body ol { padding-left: 1.4rem; }
.wiki-body blockquote { margin: 1rem 0; padding: .6rem 1rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); color: var(--fg-dim); font-style: italic; }
.wiki-body pre { overflow-x: auto; padding: .8rem 1rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--bg-deep); font-size: .88rem; }
.wiki-body code { background: var(--bg-deep); border: 1px solid var(--frame-dim); }
.wiki-body pre code { border: 0; background: transparent; padding: 0; }
.wiki-body hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--frame-dim); }
.wiki-table-wrap { overflow-x: auto; margin: 1rem 0; }
.wiki-body table { min-width: 0; }
.wiki-body th { color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; font-weight: 400; letter-spacing: .04em; }
.wiki-body p.wiki-figure { margin: 1.25rem 0; }
.wiki-image { display: block; max-width: 100%; height: auto; border: 1px solid var(--frame-dim); border-radius: 4px; }
.wiki-body a.wiki-codex-link { display: inline-flex; align-items: center; padding: 0 .4rem; border: 1px solid var(--sky); border-radius: 4px; color: var(--sky); font-family: var(--font-readout); font-size: 20px; letter-spacing: .03em; line-height: 1.3; text-decoration: none; }
.wiki-body a.wiki-codex-link:hover, .wiki-body a.wiki-codex-link:focus-visible { background: var(--sky); color: var(--bg-deep); }
.wiki-form { display: grid; gap: 1rem; padding: clamp(1rem, 3vw, 1.75rem); }
.wiki-form label { display: grid; gap: .3rem; color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .05em; line-height: 1.1; text-transform: uppercase; }
.wiki-form input, .wiki-form textarea { width: 100%; min-height: 3rem; padding: .7rem .8rem; border: 2px solid var(--frame-dim); border-radius: 4px; background: var(--bg-deep); color: var(--fg); font: 1rem/1.4 var(--font-body); letter-spacing: 0; text-transform: none; }
/* Markup source is code, so it is the one place a monospace face belongs. */
.wiki-form textarea { min-height: 18rem; font: .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.wiki-hint { margin: -.5rem 0 0; color: var(--fg-dim); font-size: .9rem; }
.wiki-editor-field { position: relative; display: grid; gap: .4rem; min-width: 0; }
.wiki-field-label { color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .05em; line-height: 1.1; text-transform: uppercase; }
.wiki-editor-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; padding: .3rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); }
.wiki-editor-tool { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .4rem .6rem; border: 2px solid transparent; border-radius: 4px; background: var(--panel-2); color: var(--fg); font-family: var(--font-readout); font-size: 22px; letter-spacing: .04em; line-height: 1; text-transform: uppercase; cursor: pointer; }
.wiki-editor-tool:hover, .wiki-editor-tool:focus-visible { border-color: var(--frame); color: var(--sky-soft); }
.wiki-editor-tool[data-editor-action="italic"] { font-style: italic; }
.wiki-editor-host { min-width: 0; }
/* Breadcrumbs sit with the page title, above every view. */
.wiki-breadcrumbs { margin: 0 0 .35rem; }
.wiki-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .55rem; margin: 0; padding: 0; list-style: none; font-family: var(--font-readout); font-size: 20px; letter-spacing: .04em; line-height: 1.2; text-transform: uppercase; }
.wiki-breadcrumbs li { margin: 0; }
.wiki-breadcrumbs li + li::before { content: '/'; margin-right: .55rem; color: var(--frame); }
.wiki-breadcrumbs a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--fg-dim); text-decoration: none; }
.wiki-breadcrumbs a:hover, .wiki-breadcrumbs a:focus-visible { color: var(--sky); text-decoration: underline; }
.wiki-breadcrumb-current { color: var(--fg); }

/* Category chips: the same object on the article, the index and the picker.
   Deliberately below the 44px tap-target floor used elsewhere in this file --
   a chip is a label the reader glances at, not a primary control, and a wall
   of full-height pills was the actual complaint. */
.wiki-chip-list { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.wiki-chip-list li { margin: 0; }
.wiki-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 1.5rem; padding: .1rem .5rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .03em; line-height: 1; text-decoration: none; text-transform: uppercase; }
.wiki-chip:hover, .wiki-chip:focus-visible { border-color: var(--frame); color: var(--sky-soft); }
.wiki-chip-count { color: var(--sky); }
#wiki-article-categories { margin-top: .5rem; }
.wiki-category-index { margin: 0; padding-top: .5rem; border-top: 1px solid var(--frame-dim); }
.wiki-category-index .wiki-chip-list { margin: 0; }

/* Table of contents, before the body. Depth is a class, never an inline style.
   Numbering is a counter on the flat <li> list, not the markup: wiki.mjs hands
   us depth-only classes, so "1. / 2. / 3." runs straight across every depth
   rather than restarting per section. */
.wiki-toc { max-width: 52rem; margin: 0 0 1rem; padding: .6rem .9rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); }
.wiki-toc-title { margin: 0 0 .3rem; color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; }
.wiki-toc ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.wiki-toc li { margin: 0; counter-increment: toc; }
.wiki-toc li::before { content: counter(toc) '.'; margin-right: .4em; color: var(--sky); font-family: var(--font-readout); font-size: 20px; line-height: 1; }
.wiki-toc a { display: inline-flex; align-items: center; min-height: 1.75rem; color: var(--fg); font-size: .95rem; line-height: 1.35; text-decoration: none; }
.wiki-toc a:hover, .wiki-toc a:focus-visible { color: var(--sky); text-decoration: underline; }
.wiki-toc-depth-1 { padding-left: .85rem; }
.wiki-toc-depth-2 { padding-left: 1.7rem; }

/* A red link is a page nobody has written. The dotted underline and the
   trailing marker carry the same meaning as the colour, for readers who do not
   see it; the renderer already sets the title attribute. */
.wiki-body a.wiki-link.is-missing { color: var(--wanted); text-decoration: underline dotted; text-underline-offset: .2em; }
.wiki-body a.wiki-link.is-missing::after { content: '?'; margin-left: .1em; font-weight: 700; vertical-align: super; font-size: .75em; }
.wiki-body a.wiki-link.is-missing:hover, .wiki-body a.wiki-link.is-missing:focus-visible { color: var(--wanted-hover); }

/* Sub-pages and Linked from, below the body. */
.wiki-relations { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--frame-dim); }
.wiki-relations h2 { font-size: 16px; }
.wiki-relation-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.wiki-relation-list li { margin: 0; }
.wiki-relation-list a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .8rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); color: var(--fg); font-size: .95rem; text-decoration: none; }
.wiki-relation-list a:hover, .wiki-relation-list a:focus-visible { border-color: var(--frame); color: var(--sky-soft); }
#wiki-backlinks-more { margin: .6rem 0 0; }

/* Credits: who started the page, and who has worked on it since. Names, not
   links -- an editor is not a page, and wiki_revisions hands the browser a
   display name and nothing it could resolve to an account. */
.wiki-credits { display: grid; gap: .6rem; margin: 0; }
.wiki-credit-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin: 0; }
.wiki-credit-row dt { flex: 0 0 auto; min-width: 6rem; color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .05em; line-height: 1.3; text-transform: uppercase; }
.wiki-credit-row dd { flex: 1 1 14rem; min-width: 0; margin: 0; color: var(--fg); font-weight: 700; overflow-wrap: anywhere; }
.wiki-credit-list { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: 0; padding: 0; list-style: none; }
.wiki-credit { display: inline-flex; align-items: baseline; gap: .4rem; margin: 0; }
.wiki-credit-count { color: var(--sky); font-family: var(--font-readout); font-size: 20px; font-weight: 400; letter-spacing: .03em; line-height: 1; text-transform: uppercase; }

/* The rail tree. Indentation is padding on the nested list, so a deep branch
   wraps its titles rather than pushing the rail sideways.

   A branch is a button beside the row, never inside it: the row is a link to
   the page and folding its children is a different action, and an <a> may not
   contain a <button>. Leaf rows are indented by the width of the button they
   do not have, so every title in a branch starts on the same line. */
.wiki-tree, .wiki-tree-branch { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.wiki-tree li { margin: 0; }
.wiki-tree-branch { margin-top: .25rem; padding-left: .75rem; border-left: 1px solid var(--frame-dim); }
/* The LINE is the box, and the chevron sits inside it: one row, drawn once,
   with the fold control taking a chevron's worth of it rather than a button's.
   The two are siblings because an <a> may not contain a <button>; the shared
   border is what makes them read as one row. */
.wiki-tree-line { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel-2); }
.wiki-tree-line:hover, .wiki-tree-line:focus-within { border-color: var(--frame); background: var(--panel); }
/* Where the reader is: an amber frame, doubled in weight by the inset ring so
   the row reads as different for anyone who does not see the colour. */
.wiki-tree-line.is-current { border-color: var(--accent); background: var(--panel); box-shadow: inset 0 0 0 1px var(--accent); }
.wiki-tree-line.is-current .wiki-tree-title { color: var(--accent); }
.wiki-tree-toggle { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 1.75rem; min-height: 2.75rem; padding: 0; border: 0; background: transparent; color: var(--fg-dim); cursor: pointer; }
.wiki-tree-toggle:hover, .wiki-tree-toggle:focus-visible { color: var(--sky); }
/* A right-pointing caret that falls to point down when the branch is open.
   Drawn with borders rather than a glyph so it never depends on a font. */
.wiki-tree-caret { width: 0; height: 0; border-left: .34rem solid currentColor; border-top: .28rem solid transparent; border-bottom: .28rem solid transparent; }
.wiki-tree-toggle[aria-expanded="true"] .wiki-tree-caret { transform: rotate(90deg); }
.wiki-tree-row { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; min-width: 0; min-height: 2.75rem; padding: .45rem .7rem .45rem .15rem; color: var(--fg); text-decoration: none; }
/* A leaf carries no chevron, so its title is indented by the width of the one
   it does not have: every title in a branch starts on the same line. */
.wiki-tree-line.is-leaf > .wiki-tree-row { padding-left: 1.9rem; }
.wiki-tree-title { font-weight: 700; overflow-wrap: anywhere; }
.wiki-tree-count { color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .03em; line-height: 1; text-transform: uppercase; }

/* Placement controls in the editor. */
.wiki-placement { display: grid; gap: 1rem; }
.wiki-form select { width: 100%; min-height: 2.75rem; padding: .6rem .7rem; border: 2px solid var(--frame-dim); border-radius: 4px; background: var(--bg-deep); color: var(--fg); font: 1rem/1.3 var(--font-body); letter-spacing: 0; text-transform: none; }
.wiki-form select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.wiki-category-picker { margin: 0; padding: .75rem 1rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); }
.wiki-category-picker legend { padding: 0 .4rem; color: var(--fg-dim); font-family: var(--font-readout); font-size: 20px; letter-spacing: .05em; line-height: 1; text-transform: uppercase; }
.wiki-category-options { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.wiki-category-option { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; color: var(--fg); font-family: var(--font-body); font-size: 1rem; letter-spacing: normal; text-transform: none; }
.wiki-category-option input { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--accent); }
.wiki-category-picker .wiki-hint { margin: 0; }

/* CodeMirror takes over the visible editing, but the textarea stays the form's
   field: it keeps required, maxlength and name, and stays rendered and
   focusable so constraint validation still has somewhere to point. */
.wiki-editor-field.is-enhanced > #wiki-edit-content { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; resize: none; }
.wiki-help { padding: .6rem .9rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); color: var(--fg-dim); font-size: .95rem; }
.wiki-help summary { display: flex; align-items: center; min-height: 2.25rem; cursor: pointer; color: var(--sky); font-family: var(--font-readout); font-size: 22px; letter-spacing: .05em; line-height: 1; text-transform: uppercase; }
.wiki-help ul { margin: .6rem 0 0; }
.wiki-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.form-status { min-height: 1.6rem; margin: 0; color: var(--sky); font-size: .95rem; }
#wiki-preview { margin-top: 1rem; }
.wiki-diff { margin-top: 1rem; padding: 1rem; }
.wiki-diff pre { margin: .5rem 0 0; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.wiki-diff .diff-add { display: block; background: var(--diff-add); color: var(--diff-add-ink); }
.wiki-diff .diff-remove { display: block; background: var(--diff-remove); color: var(--diff-remove-ink); text-decoration: line-through; }
.wiki-diff .diff-same { display: block; color: var(--fg-dim); }
.wiki-moderation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.wiki-moderation-grid section { display: grid; gap: .6rem; align-content: start; padding: .8rem 1rem; }
.wiki-plain-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .6rem .8rem; border: 1px solid var(--frame-dim); border-radius: 4px; background: var(--panel); }
.wiki-view h3 { margin: 0; color: var(--fg-dim); font-family: var(--font-readout); font-size: 22px; font-weight: 400; letter-spacing: .05em; line-height: 1.1; text-transform: uppercase; }
/* The moderator category manager: one form that both mints and edits, with
   the vocabulary it writes listed under it. */
.wiki-category-admin { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.wiki-category-form { gap: .75rem; }
/* The article textarea is 18rem tall; a 400-character blurb is not. */
.wiki-category-form textarea { min-height: 5.5rem; font: 1rem/1.4 var(--font-body); }
.wiki-category-name { display: block; color: var(--fg); font-weight: 700; overflow-wrap: anywhere; }
.wiki-category-description { margin: .2rem 0 0; color: var(--fg-dim); font-size: .95rem; overflow-wrap: anywhere; }
.wiki-category-admin .wiki-actions { justify-content: flex-end; }
.wiki-inline-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.wiki-inline-form input, .wiki-inline-form select { min-height: 2.75rem; padding: .4rem .6rem; border: 2px solid var(--frame-dim); border-radius: 4px; background: var(--bg-deep); color: var(--fg); font: inherit; font-size: .95rem; }
.empty-state { padding: 2rem 1rem; border: 2px dashed var(--frame-dim); border-radius: var(--radius); color: var(--fg-dim); text-align: center; }
.codex-footer { display: flex; justify-content: space-between; gap: 1rem; max-width: none; margin-top: 4rem; }
.codex-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (min-width: 48rem) {
  .wiki-intro h1 { font-size: 32px; }
  .wiki-view h2 { font-size: 24px; }
  .wiki-relations h2 { font-size: 16px; }
}

@media (min-width: 80rem) {
  .wiki-intro h1 { font-size: 40px; }
}

/* ── Folded rail ───────────────────────────────────────────────────────────
   Below this the rail and the article cannot both have a usable width, so the
   rail folds behind its own button and the page becomes the single scrolling
   column a phone wants -- the same shape the in-game wiki reader already has.

   Closed is the CSS default and open is an attribute wiki.mjs sets, not the
   other way round: a page whose script fails to load shows a button that does
   nothing rather than an empty drawer sitting on top of the article. */
@media (max-width: 62rem) {
  .wiki-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .wiki-rail { position: static; top: auto; gap: 0; }
  .wiki-rail-toggle { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.75rem; padding: .6rem .9rem; border: 2px solid var(--frame-dim); border-radius: var(--radius); background: var(--panel-2); color: var(--fg); font-family: var(--font-readout); font-size: 22px; letter-spacing: .05em; line-height: 1; text-transform: uppercase; cursor: pointer; }
  .wiki-rail-toggle:hover, .wiki-rail-toggle[aria-expanded="true"] { border-color: var(--frame); color: var(--sky-soft); }
  .wiki-rail-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .wiki-rail-toggle[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .wiki-rail-toggle[aria-expanded="true"] .wiki-rail-caret { transform: rotate(180deg); }
  .wiki-rail:not([data-rail-open]) .wiki-rail-panel { display: none; }
  .wiki-rail-panel { max-height: none; overflow: visible; padding: 1rem .9rem; border: 2px solid var(--frame); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel-2); }
  .wiki-rail-panel .wiki-tabs { box-shadow: none; }
}

@media (max-width: 760px) {
  .wiki-tree-branch { padding-left: .6rem; }
  .wiki-tree-row { justify-content: flex-start; }
  .wiki-toc-depth-1 { padding-left: .6rem; }
  .wiki-toc-depth-2 { padding-left: 1.2rem; }
  .wiki-search { width: 100%; }
  .wiki-moderation-grid { grid-template-columns: 1fr; }
  .wiki-revision-list li, .wiki-page-list li a, .wiki-plain-list li { grid-template-columns: 1fr; }
  .wiki-revision-list .wiki-actions, .wiki-category-admin .wiki-actions { justify-content: flex-start; }
  .codex-footer { align-items: flex-start; flex-direction: column; }
}

/* Inline SVG icons (site/icons.mjs) sit beside a label inside a button,
   inherit its colour through currentColor, and must never be the thing that
   shrinks when the label is long. */
.ui-icon { flex: 0 0 auto; }
