/* wiki.css — Star Skies wiki + timeline. Deliberately overrides the global
   bitmap/pixel inheritance to use normal smooth text and images. */

/* ===================== STAR SKIES WIKI ===================== */
/* The wiki deliberately breaks the site's 640x480 pixel rule: it uses normal
   anti-aliased web fonts and a plain white/grey Wikipedia-style layout. The
   surrounding shell (sidebar, footer, scrollbar) keeps its retro pixel look; only
   the wiki content area is reset here. */

/* ----- Shared page shell: reset the global bitmap/pixel inheritance ----- */
.wiki-page {
  --w-text:        #202122; /* body text            */
  --w-muted:       #54595d; /* secondary text       */
  --w-faint:       #72777d; /* captions / dates     */
  --w-border:      #a2a9b1; /* standard rule / box  */
  --w-border-soft: #c8ccd1; /* light divider        */
  --w-bg:          #ffffff; /* page                 */
  --w-bg-soft:     #f8f9fa; /* infobox / soft fill  */
  --w-link:        #3366cc; /* link blue            */
  --w-link-hover:  #2a4b8d; /* link hover           */

  --w-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --w-serif: "Linux Libertine", Georgia, "Times New Roman", serif;

  /* Undo the global pixel-font rendering for everything inside the wiki */
  font-family: var(--w-sans);
  font-size: 9px;
  line-height: 1.35;
  color: var(--w-text);
  font-kerning: normal;
  font-feature-settings: normal;
  text-rendering: optimizeLegibility;
  font-smooth: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: auto;

  background: var(--w-bg);
  border: 1px solid var(--w-border);
  padding: 8px;
  /* Fill the scroll viewport's content height so the box reaches the bottom with
     the same 8px gap #content-scroll's padding gives it at the top, instead of
     floating short on pages with little content. (border-box: this min-height
     already accounts for the box's own border + padding; the 16px is the
     scroller's 8px top + 8px bottom padding.) */
  min-height: calc(100vh - 16px);
}

/* The wiki uses real fonts (w-sans/w-serif) with true bold + italic faces, so it
   opts out of the global pixel-font fakery (text-shadow bold / skew italic) and
   uses the font's own weight and style. */
.wiki-page strong, .wiki-page b {
  font-weight: bold;
  text-shadow: none;
}
.wiki-page em, .wiki-page i {
  font-style: italic;
  display: inline;
  transform: none;
}

/* The landing hugs its content instead of stretching, so the gap below the last
   recent-list entry equals the 8px padding on the other sides (no filler). */
.wiki-page--landing,
.wiki-page--category {   /* category/landing pages size to content, like the home page */
  min-height: 0;
}

/* Early-development disclaimer on the wiki home. */
.wiki-warning {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 65%;
  border: 1px solid #8e2f6b;
  background: #f7e9f2;
  color: #5c1f45;
  padding: 6px 9px;
  margin: 0 auto 12px;
  font-size: 0.95em;
  line-height: 1.4;
}
.wiki-warning-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  width: 32px;
  justify-content: center;
  color: #8e2f6b;
  padding-right: 9px;
  border-right: 1px solid #c79ab5;
}
.wiki-warning-icon svg { width: 10px; height: 10px; }
.wiki-warning-text { flex: 1 1 0; min-width: 0; align-self: center; }

/* Normal, smoothly-scaled images (no pixelation) and normal cursors */
.wiki-page img { image-rendering: auto; }
.wiki-page a:focus-visible { outline: 1px solid var(--w-link); outline-offset: 1px; }

/* Re-enable real bold/italic that the global reset strips site-wide */
.wiki-page strong, .wiki-page b { font-weight: 700; }
.wiki-page em, .wiki-page i { font-style: italic; }

.wiki-page .loading-text,
.wiki-page .not-found-text { color: var(--w-muted); }

/* "Article not found" recovery links. */
.not-found-links {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wiki-nf-link {
  align-self: flex-start;
  color: var(--w-link);
  cursor: pointer;
}
.wiki-nf-link:hover { text-decoration: underline; }

/* ----- Landing header ----- */
.wiki-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--w-border);
}

.wiki-title {
  font-family: var(--w-serif);
  font-size: 17px;
  font-weight: normal;
  line-height: 1.2;
  color: var(--w-text);
  border-bottom: none;
  margin: 0;
  padding: 0;
}

.wiki-counter {
  font-family: var(--w-sans);
  font-size: 7px;
  color: var(--w-faint);
  flex-shrink: 0;
}

/* ----- Logo ----- */
.wiki-logo {
  text-align: center;
  margin: 0 0 4px;
}

.wiki-logo img {
  max-height: 128px;
  width: auto;
  display: inline-block;
}

.wiki-logo--missing { display: none; }

/* ----- Search (compact, centered) ----- */
.wiki-search-bar {
  position: relative;
  max-width: 320px;
  margin: 0 auto 15px;
}

.wiki-search-input {
  width: 100%;
  font-family: var(--w-sans);
  font-size: 9px;
  background: var(--w-bg);
  border: 1px solid var(--w-border);
  border-radius: 2px;
  padding: 3px 5px;
  color: var(--w-text);
  outline: none;
}
.wiki-search-input::placeholder { color: var(--w-faint); }
.wiki-search-input:focus { border-color: var(--w-link); box-shadow: 0 0 0 1px var(--w-link); }

.wiki-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: -1px;
  background: var(--w-bg);
  border: 1px solid var(--w-border);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.wiki-search-results.active { display: block; }

.wiki-search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border-bottom: 1px solid var(--w-border-soft);
}
.wiki-search-result:last-child { border-bottom: none; }
.wiki-search-result:hover { background: var(--w-bg-soft); }

.wiki-result-title { color: var(--w-link); font-size: 9px; }
.wiki-search-result:hover .wiki-result-title { text-decoration: underline; }
.wiki-result-cat { color: var(--w-faint); font-size: 7px; flex-shrink: 0; }
.wiki-search-empty { padding: 4px 5px; color: var(--w-muted); font-size: 8px; }

/* ----- Subject tiles ----- */
.wiki-tiles {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 15px;
}

.wiki-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 64px;
  text-align: center;
}

.wiki-tile-img {
  width: 64px;
  height: 96px; /* 2:3 portrait */
  display: block;
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  overflow: hidden;
}

.wiki-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Plain placeholder when a tile graphic isn't present yet */
.wiki-tile-img--missing { background: var(--w-bg-soft); }
.wiki-tile-img--missing img { display: none; }

.wiki-tile:hover .wiki-tile-img,
.wiki-tile:focus-visible .wiki-tile-img { border-color: var(--w-link); }

.wiki-tile-badge {
  max-width: 56px;
  font-family: var(--w-sans);
  font-size: 8px;
  line-height: 1.2;
  color: var(--w-link);
}

.wiki-tile:hover .wiki-tile-badge,
.wiki-tile:focus-visible .wiki-tile-badge { text-decoration: underline; }

/* ----- Recently Edited / Newly Added ----- */
.wiki-recent-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

.wiki-recent-col {
  flex: 1;
  min-width: 0;
}

.wiki-section-label {
  font-family: var(--w-serif);
  font-size: 12px;
  font-weight: normal;
  color: var(--w-text);
  margin-bottom: 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--w-border);
}

.wiki-recent-list { padding: 0; }

.wiki-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  padding: 0 0 1px;
}

.wiki-recent-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wiki-recent-crumb { color: var(--w-faint); }   /* grey "Category ›" root, not a link */
.wiki-recent-title { color: var(--w-link); }
.wiki-recent-title:hover { text-decoration: underline; }
.wiki-recent-date {
  color: var(--w-faint);
  font-size: 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ----- Subject page (per-category listing) ----- */
.wiki-subject-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--w-border);
}

.wiki-subject-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  overflow: hidden;
}
.wiki-subject-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wiki-subject-icon--missing { display: none; }

.wiki-subject-title {
  font-family: var(--w-serif);
  font-size: 15px;
  font-weight: normal;
  color: var(--w-text);
}
.wiki-subject-count { font-size: 7px; color: var(--w-faint); margin-left: auto; }

.wiki-subject-list { padding: 0; }

.wiki-article-link {
  display: block;
  padding: 3px 0;
  border-bottom: 1px solid var(--w-border-soft);
}

.wiki-article-link:last-child { border-bottom: none; }

.wiki-link-title {
  display: block;
  color: var(--w-link);
  font-size: 9px;
  width: fit-content;
}
.wiki-article-link:hover .wiki-link-title { text-decoration: underline; }

.wiki-link-summary {
  display: block;
  color: var(--w-muted);
  font-size: 8px;
  margin-top: 1px;
}

.wiki-empty {
  padding: 3px 0;
  color: var(--w-muted);
  font-size: 8px;
}

/* ----- Article page ----- */
/* Breadcrumbs: a history Back link on its own line, with a filesystem-style
   structural path below it. Present on every wiki page except the landing. */
.wiki-crumbs {
  margin-bottom: 6px;
}
.wiki-back {
  display: block;
  margin-bottom: 2px;
  color: var(--w-link);
  font-size: 8px;
  border-bottom: none;
}
.wiki-back:hover { text-decoration: underline; }
.wiki-crumb-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  font-size: 8px;
}
.wiki-crumb-link {
  color: var(--w-link);
  border-bottom: none;
}
.wiki-crumb-link:hover { text-decoration: underline; }
.wiki-crumb-sep {
  color: var(--w-muted);
  opacity: 0.6;
}
.wiki-crumb-current {
  color: var(--w-muted);
}

.wiki-article-title {
  font-family: var(--w-serif);
  font-size: 15px;
  font-weight: normal;
  line-height: 1.2;
  color: var(--w-text);
  margin-bottom: 3px;
  border-bottom: 1px solid var(--w-border);
  padding-bottom: 3px;
}

/* On tabbed pages the rule beneath the title block is supplied by the tab
   strip's top border, so the title drops its own underline. */
.wiki-article-title.has-page-tabs {
  border-bottom: none;
  padding-bottom: 0;
}

.wiki-article-meta {
  display: flex;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 7px;
}
.wiki-meta-cat { color: var(--w-link); }
.wiki-meta-date { color: var(--w-faint); }

.wiki-summary {
  font-size: 9px;
  line-height: 1.35;
  margin-bottom: 7px;
}

.wiki-body {
  font-size: 9px;
  line-height: 1.35;
  color: var(--w-text);
}

.wiki-body p { margin-bottom: 6px; }

.wiki-body sup, .wiki-body sub,
.wiki-summary sup, .wiki-summary sub,
.wiki-infobox sup, .wiki-infobox sub {
  font-size: 7px;
}

.wiki-h2 {
  font-family: var(--w-serif);
  font-size: 13px;
  font-weight: normal;
  color: var(--w-text);
  margin: 11px 0 4px;
  border-bottom: 1px solid var(--w-border);
  padding-bottom: 2px;
}

.wiki-h3 {
  font-family: var(--w-sans);
  font-size: 10px;
  font-weight: 700;
  color: #54595d;
  margin: 9px 0 3px;
}

.wiki-h4 {
  font-family: var(--w-sans);
  font-size: 9px;
  font-weight: 700;
  color: #888d92;
  margin: 7px 0 3px;
}

.wiki-h4-section {
  padding-left: 12px;
}

.wiki-h5 {
  font-family: var(--w-sans);
  font-size: 9px;
  font-weight: 700;
  color: #888d92;
  margin: 6px 0 3px;
}

.wiki-h5-section {
  padding-left: 24px;
}

.wiki-hr {
  border: none;
  height: 1px;
  background: var(--w-border-soft);
  margin: 8px 0;
}

.wiki-list {
  margin: 0 0 6px 11px;
  font-size: 9px;
  line-height: 1.35;
  color: var(--w-text);
}

.wiki-list li { margin-bottom: 2px; }

.wiki-internal-link,
.wiki-external-link {
  color: var(--w-link);
}
.wiki-internal-link:hover,
.wiki-external-link:hover { text-decoration: underline; }
.wiki-external-link::after { content: " \2197"; font-size: 7px; }

/* Inline images */
.wiki-img {
  border: 1px solid var(--w-border);
  background: var(--w-bg);
  padding: 2px;
  margin-bottom: 4px;
  max-width: 200px;
}
.wiki-img img { width: 100%; display: block; }
.wiki-img-caption {
  font-size: 7px;
  color: var(--w-muted);
  padding: 2px 1px 1px;
  line-height: 1.3;
}
.wiki-img-left { float: left; margin-right: 6px; }
.wiki-img-right { float: right; margin-left: 6px; }
.wiki-img-center { margin-left: auto; margin-right: auto; }

/* Gallery */
.wiki-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 6px;
  clear: both;
}
.wiki-gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--w-border);
  cursor: pointer;
}
.wiki-gallery-item:hover { border-color: var(--w-link); }
.wiki-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Infobox */
.wiki-infobox {
  float: right;
  width: 168px;
  margin: 0 0 6px 7px;
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  font-size: 8px;
  color: var(--w-text);
}

.wiki-infobox-title {
  background: #c8ccd1;
  border-bottom: 1px solid var(--w-border);
  color: var(--w-text);
  font-family: var(--w-sans);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 3px;
}

/* Image gallery tabs */
.wiki-infobox-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--w-border);
  border-bottom: 1px solid var(--w-border);
}

.wiki-infobox-tab {
  flex: 1;
  min-width: 0;
  background: #e4e6e9;
  border: none;
  font-family: var(--w-sans);
  font-size: 7px;
  padding: 2px 3px;
  cursor: pointer;
  color: var(--w-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-infobox-tab.active {
  background: var(--w-bg-soft);
  color: var(--w-text);
  font-weight: 700;
}

.wiki-infobox-image-panel { display: none; }
.wiki-infobox-image-panel.active { display: block; }

.wiki-infobox-image {
  padding: 8px;
  cursor: pointer;
}
.wiki-infobox-image img {
  width: 100%;
  max-height: 196px;
  object-fit: contain;
  display: block;
}

.wiki-infobox-caption {
  font-size: 7px;
  color: var(--w-muted);
  text-align: center;
  padding: 0 3px 3px;
  line-height: 1.3;
}

.wiki-infobox-table {
  width: 100%;
  border-collapse: collapse;
}

.wiki-infobox-table th,
.wiki-infobox-table td {
  text-align: left;
  vertical-align: top;
  padding: 2px 3px;
  font-size: 8px;
  border-top: 1px solid var(--w-border-soft);
}

.wiki-infobox-table th {
  color: var(--w-text);
  font-weight: 700;
  width: 38%;
  background: #dfe2e6;
  border-right: 1px solid var(--w-border);
}

.wiki-infobox-section td {
  background: #c8ccd1;
  text-align: center;
  font-weight: 700;
  color: var(--w-text);
}

/* ----- Stat wheel (JoJo-style radar) ----- */
.wiki-stat-section {
  border-top: 1px solid var(--w-border-soft);
  background: var(--w-bg);
}

.wiki-stat-header {
  display: block;
  background: #c8ccd1;
  border-bottom: 1px solid var(--w-border-soft);
  text-align: center;
  font-weight: 700;
  font-size: 9px;
  color: var(--w-text);
  text-decoration: none;
  padding: 2px;
  cursor: pointer;
}
.wiki-stat-header:hover { text-decoration: underline; }

.wiki-stat-wheel {
  padding: 8px 2px 4px;
}

.wiki-stat-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Rotation is animated in JS (requestAnimationFrame) for cross-browser
   consistency — a CSS transition on the SVG transform attribute is unreliable
   (Firefox/Safari don't animate it) and would also fight the JS animation. */

.wiki-stat-ring {
  fill: none;
  stroke: var(--w-border-soft);
  stroke-width: 0.5;
}

.wiki-stat-spoke {
  stroke: var(--w-border-soft);
  stroke-width: 0.5;
}

/* Invisible wide hit area over each spoke */
.wiki-stat-hit {
  stroke: transparent;
  stroke-width: 15;
  stroke-linecap: round;
}

.wiki-stat-fill {
  fill: rgba(0, 80, 160, 0.28);
  stroke: #0050a0;
  stroke-width: 1;
  stroke-linejoin: round;
}

.wiki-stat-fill-line {
  stroke: #0050a0;
  stroke-width: 1;
}

.wiki-stat-dot {
  fill: #0050a0;
}

.wiki-stat-label {
  font-family: var(--w-sans);
  font-size: 5.5px;
  font-weight: 700;
  fill: var(--w-muted);
}

.wiki-stat-grade {
  font-family: var(--w-sans);
  font-size: 8px;
  font-weight: 700;
  fill: var(--w-text);
}

.wiki-stat-labelg.selected .wiki-stat-label { fill: #0050a0; }
.wiki-stat-labelg.selected .wiki-stat-grade { fill: #0050a0; }

.wiki-stat-label,
.wiki-stat-grade {
  -webkit-user-select: none;
  user-select: none;
}

.wiki-see-also {
  clear: both;
  margin-top: 8px;
}

/* Contents box (auto-generated table of contents) */
.wiki-toc {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 6px;
  padding: 3px 5px 4px;
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  line-height: 1.3;
}
.wiki-toc-head {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}
.wiki-toc-title { font-weight: 700; }
.wiki-toc-toggle {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--w-link);
  cursor: pointer;
}
.wiki-toc-toggle:hover { text-decoration: underline; }
.wiki-toc-list { list-style: none; margin: 0; padding: 0; }
.wiki-toc--collapsed .wiki-toc-list { display: none; }
.wiki-toc-item { margin: 1px 0; }
.wiki-toc-l3 { margin-left: 7px; }
.wiki-toc-l4 { margin-left: 14px; }
.wiki-toc-l5 { margin-left: 21px; }
.wiki-toc-link { color: var(--w-link); }
.wiki-toc-link:hover { text-decoration: underline; }
.wiki-toc-num { color: var(--w-muted); margin-right: 3px; }
/* ===== WIKI SUBJECT PAGES (characters / concepts / story arcs) ===== */
.wiki-subject-body { margin-top: 4px; }

/* Character & concept tiles */
.wiki-char-tiles,
.wiki-concept-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: 8px;
  margin-bottom: 10px;
}

.wiki-char-tile,
.wiki-concept-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  width: 72px;
}

.wiki-char-tile-img,
.wiki-concept-tile-img {
  width: 72px;
  height: 72px;
  display: block;
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  overflow: hidden;
}

.wiki-char-tile-img img,
.wiki-concept-tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wiki-char-tile-img--missing,
.wiki-concept-tile-img--missing { background: var(--w-bg-soft); }

.wiki-char-tile:hover .wiki-char-tile-img,
.wiki-concept-tile:hover .wiki-concept-tile-img { border-color: var(--w-link); }

.wiki-char-tile-name,
.wiki-concept-tile-name {
  font-family: var(--w-sans);
  font-size: 8px;
  line-height: 1.2;
  color: var(--w-link);
}

.wiki-char-tile:hover .wiki-char-tile-name,
.wiki-concept-tile:hover .wiki-concept-tile-name { text-decoration: underline; }

/* Concept bulleted list */
.wiki-concept-list { margin-top: 4px; }
.wiki-concept-summary { color: var(--w-muted); }

/* ===== Category / timeline embeds ({{category:...}}, {{timeline}}) ===== */
.wiki-cat-embed { margin: 6px 0 10px; }
.wiki-cat-list { margin-top: 4px; }
.wiki-cat-summary { color: var(--w-muted); }
/* Nested {{category:X|tree}} — indent each child level under its parent. */
.wiki-cat-tree .wiki-cat-tree { margin: 2px 0 2px 16px; }
/* Header planets: only the title is header-sized; the inline summary reads as
   normal body text, and a 50%-width rule replaces H2's full-width underline. */
.wiki-tree-head { border-bottom: none; padding-bottom: 0; }
.wiki-tree-head .wiki-cat-summary { font-weight: normal; font-size: 9px; }
.wiki-tree-hr { border: none; height: 1px; width: 50%; background: var(--w-border); margin: 2px 0 6px; }
/* Planets are list items (dot marker) rather than indented blocks; keep the
   header on the marker's line. */
.wiki-tree-planet > .wiki-h3 { display: inline-block; margin: 0; }

.wiki-cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  gap: 8px;
  margin: 4px 0 10px;
}
.wiki-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  width: 72px;
}
.wiki-cat-card-img {
  width: 72px;
  height: 72px;
  display: block;
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  overflow: hidden;
}
.wiki-cat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.wiki-cat-card-img--missing { background: var(--w-bg-soft); }
.wiki-cat-card:hover .wiki-cat-card-img { border-color: var(--w-link); }
.wiki-cat-card-name {
  font-family: var(--w-sans);
  font-size: 8px;
  line-height: 1.2;
  color: var(--w-link);
}
.wiki-cat-card:hover .wiki-cat-card-name { text-decoration: underline; }

.wiki-cat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 10px;
  font-size: 9px;
}
.wiki-cat-table th,
.wiki-cat-table td {
  border: 1px solid var(--w-border-soft);
  padding: 2px 5px;
  text-align: left;
  vertical-align: top;
}
.wiki-cat-table th {
  background: var(--w-bg-soft);
  font-family: var(--w-sans);
  font-weight: 700;
  color: var(--w-text);
}
.wiki-cat-table td { color: var(--w-muted); }

.wiki-timeline-embed { margin: 6px 0; }

/* Story arcs — collapsible containers */
.wiki-arcs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.wiki-arc {
  border: 1px solid var(--w-border);
  background: var(--w-bg);
}

.wiki-arc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--w-bg-soft);
  cursor: pointer;
  user-select: none;
}

.wiki-arc-header:hover { background: #eef0f2; }

.wiki-arc-toggle { font-size: 7px; color: var(--w-muted); }
.wiki-arc-name { font-family: var(--w-serif); font-size: 12px; flex: 1; color: var(--w-text); }
.wiki-arc-count { font-size: 7px; color: var(--w-faint); }

.wiki-arc-body {
  padding: 5px 8px 7px;
  border-top: 1px solid var(--w-border-soft);
}

.wiki-arc-overview-link {
  display: inline-block;
  font-size: 8px;
  color: var(--w-link);
  margin-bottom: 4px;
  cursor: pointer;
}
.wiki-arc-overview-link:hover { text-decoration: underline; }

.wiki-arc-chapters { margin-top: 2px; margin-bottom: 0; }
/* Page-level article tabs (switch between sub-articles in one JSON).
   Hang downward off the rule beneath the title block: the rule is the tab
   strip's top border (the title's own underline is removed on tabbed pages),
   and the active tab merges upward into the header. */
.wiki-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 6px;
  border-top: 1px solid var(--w-border);
}
.wiki-page-tab {
  background: var(--w-bg-soft);
  border: 1px solid var(--w-border);
  border-top: none;
  margin-top: -1px;
  font-family: var(--w-sans);
  font-size: 10px;
  padding: 3px 9px;
  color: var(--w-link);
  cursor: pointer;
}
.wiki-page-tab:hover { background: #eef0f3; }
.wiki-page-tab.active {
  background: var(--w-bg);
  border-top: 1px solid var(--w-bg);
  color: var(--w-text);
  font-weight: 700;
}
/* ===================== STAR SKIES TIMELINE ===================== */
.wiki-page--timeline {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Year counter, centred above the scrubber viewport */
.wiki-tl-counter {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 3px 0 1px;
  padding: 2px 11px 3px;
  border: 1px solid var(--w-border);
  background: var(--w-bg-soft);
  min-width: 58px;
}
.wiki-tl-counter-label {
  font-family: var(--w-sans);
  font-size: 6px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--w-muted);
}
.wiki-tl-counter-year {
  font-family: var(--w-serif);
  font-size: 14px;
  line-height: 1.05;
  font-weight: 700;
  color: var(--w-text);
}
@keyframes wikiTlYearPop {
  0%   { transform: translateY(-2px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}
.wiki-tl-year-pop { animation: wikiTlYearPop 0.18s ease-out; }

/* The fixed-height stage. The page never grows taller than one screen; the
   inner track is translated instead. */
.wiki-tl-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  overflow: hidden;
}

/* Native scroll container — the browser handles momentum & smoothing; CSS
   scroll-snap gently settles each event's dot onto the centre line. */
.wiki-tl-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2;
  scroll-snap-type: y proximity;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wiki-tl-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* Centre axis line */
.wiki-tl-axis {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -0.5px;
  background: var(--w-border-soft);
  z-index: 1;
}

/* Soft fades at the top & bottom edges so events dissolve as they leave.
   These masks are the ONLY fade — content at the centre always stays crisp,
   so long text blocks never fade while you're reading them. */
.wiki-tl-edge {
  position: absolute;
  left: 0;
  right: 0;
  height: 58px;
  z-index: 4;
  pointer-events: none;
}
.wiki-tl-edge--top {
  top: 0;
  background: linear-gradient(to bottom, var(--w-bg) 12%, rgba(255,255,255,0) 100%);
}
.wiki-tl-edge--bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--w-bg) 12%, rgba(255,255,255,0) 100%);
}

/* The content track — normal flow inside the scroll container. */
.wiki-timeline {
  position: relative;
  z-index: 2;
}

/* Each event spans the full width: info on one side of the axis, thumbnail
   mirrored on the opposite side, with the bullet on the centre line. */
.wiki-tl-event {
  position: relative;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  margin: 14px 0;
  min-height: 96px;   /* spacing so one scroll notch ≈ one event (no skipping) */
  align-items: flex-start;
  scroll-snap-align: start;
}
.wiki-tl-side {
  width: 50%;
  box-sizing: border-box;
}
/* Left-info events: info on the left, thumb on the right. */
.wiki-tl-event--left  .wiki-tl-side--info  { order: 0; padding-right: 13px; text-align: right; }
.wiki-tl-event--left  .wiki-tl-side--thumb { order: 1; padding-left: 13px;  text-align: left;  }
/* Right-info events: info on the right, thumb on the left. */
.wiki-tl-event--right .wiki-tl-side--info  { order: 1; padding-left: 13px;  text-align: left;  }
.wiki-tl-event--right .wiki-tl-side--thumb { order: 0; padding-right: 13px; text-align: right; }

/* Bullet on the axis */
.wiki-tl-node {
  position: absolute;
  top: 3px;
  left: 50%;
  margin-left: -3.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--w-bg);
  border: 1px solid var(--w-border);
  z-index: 3;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.wiki-tl-event.is-active .wiki-tl-node {
  background: var(--w-link);
  border-color: var(--w-link);
  transform: scale(1.4);
  box-shadow: 0 0 0 2px rgba(51,102,204,0.18);
}

/* Card — no box, content only */
.wiki-tl-card {
  display: inline-block;
  max-width: 100%;
  text-align: left;
}
.wiki-tl-event--left .wiki-tl-card { text-align: right; }

/* Thumbnail — sits opposite the info, hugging the centre line, clickable. */
.wiki-tl-thumb {
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--w-border);
  background: var(--w-bg-soft);
  padding: 1px;
  line-height: 0;
  cursor: pointer;
}
.wiki-tl-thumb img {
  display: block;
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
}

.wiki-tl-yeartag {
  font-family: var(--w-serif);
  font-size: 7px;
  font-weight: 700;
  color: var(--w-muted);
  margin-bottom: 1px;
}
.wiki-tl-event.is-active .wiki-tl-yeartag { color: var(--w-link); }

.wiki-tl-title {
  font-family: var(--w-serif);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--w-text);
}
.wiki-tl-subtitle {
  font-family: var(--w-sans);
  font-size: 7px;
  font-style: italic;
  color: var(--w-muted);
  margin-top: 1px;
  margin-bottom: 3px;
}
.wiki-tl-body {
  font-size: 7px;
  line-height: 1.5;
  color: var(--w-text);
  text-align: left;
}
.wiki-tl-event--left .wiki-tl-body { text-align: right; }
.wiki-tl-body p { margin-bottom: 4px; }
.wiki-tl-body p:last-child { margin-bottom: 0; }

/* "scroll" hint, fades out on first interaction */
.wiki-tl-hint {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--w-sans);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--w-muted);
  background: var(--w-bg-soft);
  b