/* Shared layout and organization for both world codices. */
.fenumion-world { --world-map: url('assets/archive/world-map.jpeg'); }
.gedankin-world { --world-map: url('gedankin/assets/gedankin-map.png'); }
.codex-world .sidebar .sidebar-intro { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.codex-world .sidebar-intro > .eyebrow { margin: 0 0 .7rem; font: .65rem/1.4 var(--sans); letter-spacing: .15em; }
.codex-world .sidebar .featured-link { min-height: 78px; gap: .75rem; padding: .85rem; border-radius: 8px; background: linear-gradient(100deg,rgba(14,17,23,.94),rgba(14,17,23,.7)),var(--world-map) center 45% / cover; border-color: rgba(212,180,109,.4); }
.codex-world .sidebar .featured-link .sigil { flex: 0 0 24px; font-size: 1.5rem; }
.codex-world .sidebar .featured-link strong { font: 600 1.05rem/1.3 var(--serif); }
.codex-world .sidebar .featured-link small { margin-top: .25rem; font: 1rem/1.3 var(--text); color: var(--muted); }
.codex-world .sidebar .browse-link { display: block; box-sizing: border-box; width: 100%; margin-top: .5rem; padding: .7rem .85rem; border-radius: 7px; background: rgba(255,255,255,.025); border-color: var(--line-soft); text-decoration: none; }
.codex-world .sidebar .browse-link > span { font: .6rem/1.4 var(--sans); letter-spacing: .1em; color: var(--muted); }
.codex-world .sidebar .browse-link strong { display: flex; align-items: center; justify-content: space-between; margin-top: .25rem; font: 600 1.05rem/1.3 var(--text); color: var(--ink); }
.codex-world .sidebar .browse-link strong span { font: 1rem/1 var(--sans); color: var(--gold); }
.codex-world .sidebar .nav-region { margin: 0 0 .4rem; padding: 0; border: 0; }
.codex-world .sidebar .nav-region-link { min-height: 48px; height: auto; grid-template-columns: 24px minmax(0,1fr) 12px; gap: .75rem; padding: .7rem .8rem; border: 1px solid transparent; border-radius: 7px; background: transparent; box-shadow: none; }
.codex-world .sidebar .nav-region-link strong { font: 600 1.1rem/1.3 var(--text); text-shadow: none; color: var(--ink); }
.codex-world .sidebar .nav-region-glyph { font-size: 1.15rem; text-shadow: none; }
.codex-world .sidebar :is(.browse-link,.featured-link,.nav-region-link):hover,
.codex-world .sidebar .nav-region-link.active { background: rgba(212,180,109,.08); border-color: rgba(212,180,109,.35); }
.codex-world .sidebar :is(.browse-link,.featured-link,.nav-region-link):focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
@media (min-width: 761px) {
  .codex-world.home-view .sidebar .nav-region { margin: 0 0 .55rem; padding: 0 0 .55rem; border-bottom: 1px solid rgba(255,255,255,.06); }
  .codex-world.home-view .sidebar .nav-region-link { width: 58px; height: 58px; grid-template-columns: 1fr; padding: 0; }
}

.codex-world .world-directory-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; }
.codex-world .world-directory-search { display: grid; gap: .4rem; flex: 1; min-width: 160px; }
.codex-world .world-directory input, .codex-world .world-directory select { min-height: 44px; width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: #191c25; color: var(--ink); font: 1rem/1.3 var(--text); }
.codex-world .world-directory-toolbar > label { display: grid; gap: .4rem; }
.codex-world .world-directory .browser-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.codex-world .world-directory .index-card { width: 100%; margin: 0; text-align: left; }
.codex-world.hub-view .article-rail { display: none; }
.codex-world.hub-view .lead-grid { display: block; }
.codex-world.hub-view .infobox { display: none; }
.codex-world.hub-view .hub-switcher { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); position: relative; z-index: 2; }
.codex-world.hub-view .article-header { min-height: 280px; padding: 3.5rem clamp(1rem,4vw,3rem) 4rem; border-radius: 0; }

.codex-world :is(input,select,button,a):focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
@media (min-width: 1101px) { .codex-world.hub-view .app-shell { grid-template-columns: 250px minmax(0,1fr); } }
@media (max-width: 1100px) { .codex-world.hub-view .hub-switcher { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 760px) {
  .codex-world.hub-view .hub-switcher { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .codex-world .world-directory .browser-grid { grid-template-columns: 1fr; }
  .codex-world.hub-view .article-header { min-height: 260px; padding: 2.5rem 1rem 3.5rem; }

  .codex-world.panels-open .topbar { z-index: 80; }
  /* Let the fixed drawer rise above the scrim, outside themed page stacking contexts. */
  body.codex-world.panels-open .app-shell { z-index: auto; }
}

/* Start with the story on narrow screens; supporting facts follow it. */
.codex-world .infobox:has(.fact):before { content: none; }
.codex-world .infobox:not(:has(.fact)) { display: none; }
.codex-world .infobox-title { padding-top: 1rem; }
@media (max-width: 1100px) {
  .codex-world:not(.home-view) .lead-grid > .article-body { grid-row: 1; }
  .codex-world:not(.home-view) .lead-grid > .infobox { grid-row: 2; }
}

/* Short names beneath hero artwork use the Codex's display lettering. */
.codex-world .article-hero figcaption.media-name-caption {
  padding: 1rem 1.2rem 1.1rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,180,109,.12), transparent 75%), #171b20;
  border-top: 1px solid rgba(212,180,109,.32);
  font: 400 clamp(1.4rem, 1.05rem + 1.2vw, 2rem)/1.35 var(--serif);
  letter-spacing: .045em;
  overflow-wrap: anywhere;
}
.codex-world .media-name-caption > span {
  color: #e9cc86;
  text-shadow: 0 1px 1px rgba(0,0,0,.7), 0 0 14px rgba(222,185,101,.28);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .codex-world .media-name-caption > span {
    background: linear-gradient(180deg, #fff4d1 0%, #dec08a 36%, #ab864f 52%, #efd8a0 73%, #c7a768 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 14px rgba(222,185,101,.22);
  }
}
@media (forced-colors: active) {
  .codex-world .media-name-caption > span { background: none; color: CanvasText; text-shadow: none; }
}

/* Connected histories keep the route readable and each contribution distinct. */
.codex-world .history-path, .codex-world .history-link {
  display: flex; flex-direction: column; gap: .65rem;
  padding: 1.25rem; border: 1px solid var(--line);
  border-radius: 12px; background: linear-gradient(135deg, rgba(212,180,109,.07), rgba(10,17,20,.8));
  color: var(--ink); text-decoration: none; min-width: 0;
}
.codex-world .history-path:hover, .codex-world .history-link:hover { border-color: var(--gold); background-color: rgba(212,180,109,.08); }
.codex-world :is(.history-path,.history-link,.history-stages button,.history-next a):focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.codex-world .history-path > strong { font: 400 clamp(1.4rem, 3vw, 2rem)/1.3 var(--serif); color: var(--gold-bright); }
.codex-world .history-path-question { border-top: 1px solid var(--line-soft); padding-top: .75rem; font-style: italic; }
.codex-world .history-link-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin: 1.25rem 0 2rem; }
.codex-world .history-link > strong { font: 400 1.25rem/1.3 var(--serif); color: var(--gold-bright); }
.codex-world .history-link-role { color: var(--muted); font-size: 1rem; }
.codex-world .history-link-arrow { color: var(--gold-bright); font-size: 1rem; margin-top: auto; padding-top: .4rem; }
.codex-world .history-question { border-left: 3px solid var(--gold); background: rgba(212,180,109,.06); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.codex-world .history-question p { margin: 0; }
.codex-world .history-question .eyebrow { margin-bottom: .5rem; }
.codex-world .history-stages { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.25rem 0 2rem; }
.codex-world .history-stages button { flex: 1 1 150px; background: transparent; text-align: left; font-family: var(--text); cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; color: var(--ink); text-decoration: none; }
.codex-world .history-stages button:hover { border-color: var(--gold); }
.codex-world .history-stages span { display: block; font: 400 1.15rem/1.4 var(--serif); color: var(--gold-bright); margin-bottom: .35rem; }
.codex-world .history-perspective { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.codex-world .history-perspective summary { cursor: pointer; color: var(--gold-bright); padding: .25rem 0; }
.codex-world .history-next { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin: 2rem 0; }
@media (max-width: 600px) {
  .codex-world .history-link-grid { grid-template-columns: 1fr; }
  .codex-world .history-stages button { flex-basis: 100%; }
}

/* Give each story and its artwork the whole article column. */
.codex-world:not(.home-view) .lead-grid {
  grid-template-columns: minmax(0,1fr);
  gap: 1.5rem;
}
.codex-world:not(.home-view) .lead-grid > .article-body {
  width: 100%; max-width: none; min-width: 0; grid-row: 1;
}
.codex-world:not(.home-view) .article-header :is(h1,.dek) { max-width: none; }
.codex-world:not(.home-view) .lead-grid > .infobox {
  grid-row: 2; width: 100%; min-width: 0;
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0 1.5rem; margin: 0; padding: 1.25rem;
}
.codex-world:not(.home-view) .infobox:not(:has(.fact)) { display: none; }
.codex-world:not(.home-view) .infobox-title { grid-column: 1 / -1; padding: 0 0 1rem; margin: 0; }
.codex-world:not(.home-view) .infobox .fact { min-width: 0; overflow-wrap: anywhere; }
.codex-world:not(.home-view):not(.record-layout-view) .article-hero:not(.map-hero):not(.medallion-hero) :is(img,video) {
  width: 100%; max-width: 100%; height: auto; max-height: none;
  margin-inline: 0; object-fit: contain;
}
.codex-world:not(.home-view) .article-gallery img { width: 100%; height: auto; max-height: none; object-fit: contain; }
@media (max-width: 600px) {
  .codex-world:not(.home-view) .lead-grid > .infobox { grid-template-columns: minmax(0,1fr); padding: 1rem; }
}
.codex-world.hub-view .lead-grid > .infobox { display: none; }

/* Use the window instead of reserving empty outer columns. */
.codex-world:not(.home-view) .app-shell {
  width: 100%; max-width: none; margin-inline: 0; justify-content: stretch;
}
@media (min-width: 1101px) {
  .codex-world:not(.home-view) .app-shell { grid-template-columns: 232px minmax(0,1fr) 212px; }
  .codex-world.hub-view .app-shell { grid-template-columns: 232px minmax(0,1fr); }
}
.codex-world:not(.home-view):not(.hub-view) .article-wrap {
  max-width: none; padding-inline: clamp(1rem,2.5vw,2.5rem);
}
.codex-world.hub-view :is(.hub-switcher,.atlas-banner,.source-strip,.source-ledger,.subchannels,.lead-grid,.record-context) {
  width: calc(100% - 3rem); max-width: none;
}
.codex-world.hub-view .article-body > p:first-child { max-width: none; }
@media (max-width: 760px) {
  .codex-world.hub-view :is(.hub-switcher,.atlas-banner,.source-strip,.source-ledger,.subchannels,.lead-grid,.record-context) { width: calc(100% - 2rem); }
}
.codex-world .character-art-grid:has(> figure:only-child) { grid-template-columns: minmax(0,1fr); }
.codex-world .character-art-grid:has(> figure:only-child) figure > a { padding: 0; }
.codex-world:not(.record-layout-view) .character-art-grid:has(> figure:only-child) img { width: 100%; height: auto; max-height: none; }

/* Records share a compact overview, visual column and readable chapters. */
.codex-world :is(.death-video-backdrop,.ethos-video-backdrop,.locations-video-backdrop,.factions-video-backdrop,.history-video-backdrop) { z-index: -1; }
.codex-world.record-layout-view .article-header { min-height: 0; padding: 1.3rem 1.5rem; margin-bottom: 1.25rem; }
.codex-world.record-layout-view .article-header h1 { font-size: clamp(2.4rem,4vw,3.6rem); }
.record-overview { display: grid; grid-template-columns: minmax(220px,min(32%,360px)) minmax(0,1fr); gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }
.record-overview:not(:has(> .record-visual-rail)) { grid-template-columns: minmax(0,1fr); }
.codex-world.record-layout-view .record-visual-rail > .article-hero { margin: 0; }
.codex-world.record-layout-view .record-visual-rail > .medallion-hero { padding: 0; }
.codex-world.record-layout-view .record-visual-rail > .medallion-hero figcaption { margin: 0; }
.codex-world.record-layout-view .record-overview figcaption.media-name-caption { padding: .8rem; font-size: 1.5rem; }
.codex-world.record-layout-view .record-overview .article-hero :is(img,video) { width: 100%; height: auto; max-height: 480px; object-fit: contain; }
.record-overview-copy { min-width: 0; }
.record-summary { padding: 1.25rem; margin-bottom: 1.25rem; background: rgba(20,21,27,.94); border: 1px solid var(--line); border-radius: 10px; }
.record-visual-rail { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; min-width: 0; display: grid; gap: 1rem; }
.record-visual-links, .record-rail-art { padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(20,21,27,.95); }
.record-visual-rail h2 { margin: 0 0 .8rem; color: var(--gold-bright); font: 400 1.1rem/1.4 var(--serif); }
.record-visual-links > summary { cursor: pointer; color: var(--gold-bright); font: 400 1.1rem/1.4 var(--serif); min-height: 44px; align-content: center; }
.record-visual-links[open] > summary { margin-bottom: .5rem; }
.record-visual-facts { padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(20,21,27,.95); }
.record-visual-facts > summary { color: var(--gold-bright); cursor: pointer; font: 400 1.1rem/1.4 var(--serif); min-height: 44px; align-content: center; }
.record-visual-links a { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-soft); }
.record-visual-links img { width: 56px; height: 70px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 5px; flex: 0 0 56px; }
.record-visual-links strong { display: block; color: var(--gold-bright); font: 400 1.05rem/1.4 var(--serif); }
.record-visual-links small { display: block; margin-top: .25rem; font: .95rem/1.4 var(--text); color: var(--muted); }
.record-visual-links a:hover strong { color: var(--ink); }
.record-rail-art .character-art-grid { grid-template-columns: minmax(0,1fr); }
.record-rail-art .character-art-grid img { width: 100%; height: auto; max-height: auto; max-height: 780px; object-fit: contain; }
.record-rail-art .collection-credit { font: .95rem/1.5 var(--text); }
.record-introduction { font-family: var(--text); font-size: 1.12rem; line-height: 1.7; }
.record-introduction > :first-child { margin-top: 0; }
.codex-world.record-layout-view .record-overview .infobox { position: static; width: 100%; margin: 1rem 0 0; padding: 1rem 0 0; background: none; border: 0; border-top: 1px solid var(--line); box-shadow: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 1.25rem; }
.record-overview .infobox-title { grid-column: 1 / -1; padding: 0; margin: 0 0 .6rem; }
.record-overview .fact { min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
/* Narrow visual rails need full-width values, independent of the main summary grid. */
.codex-world.record-layout-view .record-visual-rail .record-visual-facts .infobox { grid-template-columns: minmax(0,1fr); gap: 0; margin-top: .35rem; padding-top: 0; border-top: 0; }
.codex-world.record-layout-view .record-visual-rail .record-visual-facts .fact { display: block; border-left: 0; padding: .65rem 0; }
.record-visual-facts .fact dt { margin: 0 0 .25rem; }
.record-visual-facts .fact dd { min-width: 0; margin: 0; }
.codex-world.record-layout-view .article-body { padding: 0; background: none; }
.record-reading-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; font: 1rem/1.4 var(--text); color: var(--muted); }
.record-reading-controls button { color: var(--gold-bright); border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: .6rem .8rem; min-height: 44px; cursor: pointer; font: inherit; }
.record-chapter { margin: .75rem 0; padding: 0 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(20,21,27,.95); }
.record-chapter > summary { cursor: pointer; min-height: 64px; padding: 1rem 0; list-style: none; display: flex; align-items: center; gap: .8rem; }
.record-chapter > summary::-webkit-details-marker { display: none; }
.record-chapter > summary::after { content: '+'; margin-left: auto; flex: 0 0 auto; color: var(--gold-bright); font: 1.5rem/1 var(--text); }
.record-chapter[open] > summary::after { content: '−'; }
.codex-world .record-chapter > summary h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.15rem,1.4vw,1.5rem); line-height: 1.4; }
.record-chapter[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.record-chapter[open] { padding-bottom: 1rem; }
.record-chapter > section { border: 0; margin-top: 0; padding-inline: 0; }
.record-chapter .character-art-grid img { max-height: 420px; width: 100%; object-fit: contain; }
.record-outline button { display: block; width: 100%; min-height: 44px; padding: .65rem 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--gold-bright); cursor: pointer; text-align: left; font: 1rem/1.4 var(--text); }
.codex-world.record-layout-view .record-visual-rail .article-gallery { grid-template-columns: minmax(0,1fr); margin: 0; }
.codex-world.record-layout-view .record-visual-rail .article-gallery img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.record-visual-rail .article-map-cta { position: static; padding: .8rem; display: grid; gap: .35rem; background: var(--panel); }
.record-visual-rail .article-map-cta strong { max-width: none; text-align: left; }
.codex-world.record-layout-view .record-overview :is(.lead-grid,.atlas-banner,.subchannels) { width: 100%; max-width: none; margin-inline: 0; }
.codex-world.hub-view.record-layout-view .article-wrap { padding: 1.65rem clamp(1rem,2.5vw,2.5rem) 6rem; }

.codex-world.hub-view.record-layout-view .record-overview .article-body { padding: 1.25rem; border-radius: 8px; background: rgba(20,21,27,.95); }
.codex-world.hub-view.record-layout-view .record-topic-art img { max-height: 240px; }
.codex-world.hub-view.record-layout-view .record-visual-rail .hub-switcher { grid-template-columns: minmax(0,1fr); width: 100%; margin: 0; }
.codex-world.hub-view.record-layout-view .record-visual-rail .gateway-tile { min-height: 64px; padding: .7rem .85rem; border-radius: 8px; }
@media (max-width: 1200px) {
  .record-overview { grid-template-columns: minmax(0,1fr); }
  .record-visual-rail { position: static; max-height: none; overflow: visible; }
  .codex-world.record-layout-view .record-overview .article-hero :is(img,video) { max-height: 400px; }
  .codex-world.hub-view.record-layout-view .record-topic-art { display: none; }
  .codex-world.hub-view.record-layout-view .record-visual-rail .hub-switcher { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .codex-world.record-layout-view .record-overview .infobox { grid-template-columns: minmax(0,1fr); }
  .record-chapter { padding-inline: .85rem; }
  .codex-world.record-layout-view .article-header { padding: 1rem; }
  .codex-world.hub-view.record-layout-view .record-visual-rail .hub-switcher { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* One persistent compact desktop menu across both connected codices. */
@media (min-width: 761px) {
  body.codex-world .app-shell,
  body.codex-world:not(.home-view) .app-shell {
    width: calc(100% - 78px); margin: 0 0 0 78px; max-width: none;
    grid-template-columns: minmax(0,1fr) 190px; border: 0;
  }
  body.codex-world.home-view .app-shell,
  body.codex-world.hub-view .app-shell,
  body.codex-world.player-perspectives-view .app-shell { grid-template-columns: minmax(0,1fr); }
  body.codex-world .sidebar,
  body.codex-world:not(.home-view) .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 80; width: 78px; height: 100vh;
    max-height: 100vh; overflow: auto; padding: 1.1rem .55rem;
    background: rgba(14,17,23,.98); border-right: 1px solid rgba(212,180,109,.14);
    scrollbar-width: none; transform: none;
  }
  body.codex-world .sidebar::-webkit-scrollbar { display: none; }
  body.codex-world .sidebar::before {
    content: ''; display: block; width: 48px; height: 48px; margin: 0 auto 1.3rem;
    background: #fff url('fenumion-logo.webp') center / 152% no-repeat;
    border: 1px solid var(--gold-bright); border-radius: 50%; box-shadow: 0 0 0 5px rgba(212,180,109,.06);
  }
  body.gedankin-world .sidebar::before { background: transparent url('gedankin/sigil.svg') center / contain no-repeat; }
  body.codex-world .sidebar :is(.sidebar-intro,.nav-region-tree,.archive-note,.archive-links,.nav-only-ethos),
  body.codex-world .sidebar .world-switcher :is(.eyebrow,small) { display: none; }
  body.codex-world .world-switcher { gap: .45rem; margin-bottom: 1rem; padding-bottom: .8rem; }
  body.codex-world .world-switch { display: grid; justify-items: center; gap: .35rem; padding: .5rem .1rem; }
  body.codex-world .world-switch-name { font: .6rem/1.3 var(--sans); }
  body.codex-world .sidebar .nav-region { margin: 0 0 .55rem; padding: 0 0 .55rem; border-bottom: 1px solid rgba(255,255,255,.06); }
  body.codex-world .sidebar :is(.nav-region-link,.starter-nav-link) {
    display: grid; width: 58px; height: 58px; min-height: 58px; grid-template-columns: 1fr;
    place-items: center; gap: 0; padding: 0; margin: 0; position: relative;
    background: transparent; border: 1px solid transparent; border-radius: 5px;
  }
  body.codex-world .sidebar .starter-nav-link { margin-bottom: .55rem; }
  body.codex-world .sidebar :is(.starter-nav-copy,.starter-nav-arrow,.nav-region-link strong,.nav-region-link > span:last-child) { display: none; }
  body.codex-world .sidebar .nav-region-glyph { font-size: 1.15rem; }
  body.codex-world .sidebar .nav-region-glyph svg { width: 23px; height: 23px; display: block; }
  body.codex-world .sidebar :is(.nav-region-link,.starter-nav-link).active,
  body.codex-world .sidebar :is(.nav-region-link,.starter-nav-link):hover { border-color: rgba(212,180,109,.45); background: rgba(212,180,109,.08); }
  body.codex-world .sidebar :is(.nav-region-link,.starter-nav-link)::after { display: none; }
  body.codex-world:not(.home-view) .topbar { margin-left: 78px; width: calc(100% - 78px); display: flex; }
  body.codex-world:not(.home-view) .topbar .brand { flex: 0 1 220px; min-width: 0; }
  body.codex-world:not(.home-view) .topbar .search-shell { flex: 1; min-width: 120px; }
  body.codex-world:not(.home-view) .topbar .topbar-actions { flex: 0 0 auto; }
  body.codex-world .article-rail { top: 72px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  body.codex-world .app-shell, body.codex-world:not(.home-view) .app-shell { grid-template-columns: minmax(0,1fr); }
  body.codex-world .topbar .topbar-actions { display: none; }
}
/* Keep the labeled mobile drawer consistent across home and reading pages. */
@media (max-width: 760px) {
  body.codex-world .sidebar { background: rgba(14,17,23,.98); }
  body.codex-world .sidebar .nav-region-glyph svg { width: 24px; height: 24px; }
}
.fenumion-art-gallery { margin: 1.5rem 0; }
.art-controls { display: flex; flex-wrap: wrap; gap: 1rem; }
.art-controls label { display: grid; gap: .4rem; flex: 1; min-width: 180px; }
.art-controls :is(input,select) { width: 100%; min-height: 44px; padding: .7rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.fenumion-art-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.1rem; }
.fenumion-art-card { margin: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.fenumion-art-card > a { display: grid; place-items: center; padding: 0; background: #080e0d; }
.fenumion-art-card img { display: block; width: 100%; height: auto; max-height: 780px; object-fit: contain; }
.fenumion-art-card figcaption { padding: 1rem; }
.fenumion-art-card h3 { margin: .35rem 0; font-size: 1.3rem; }
.fenumion-art-card p { font-size: .95rem; }
.fenumion-art-card small { color: var(--muted); }
.art-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; }
.art-pagination button { min-height: 44px; padding: .6rem .9rem; color: var(--gold-bright); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.art-pagination button:disabled { opacity: .45; cursor: default; }
@media (max-width: 1100px) { .fenumion-art-card img { max-height: 70vh; } }
@media (max-width: 600px) { .fenumion-art-grid { grid-template-columns: minmax(0,1fr); } }
@media (min-width: 761px) {
  body.codex-world .sidebar .starter-nav-link { border-color: rgba(212,180,109,.45); background: rgba(212,180,109,.04); }
  body.codex-world.art-view .app-shell { grid-template-columns: minmax(0,1fr); }
}
body.codex-world.art-view .article-rail,
body.codex-world.art-view .infobox { display: none; }
body.codex-world.art-view .lead-grid { display: block; }
body.codex-world.art-view .article-body { max-width: none; }

/* Location artwork leads the art collection with a gentle, pausable horizontal tour. */
.art-location-opening { margin: 0 0 1.8rem; min-width: 0; }
.art-location-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.art-location-heading .eyebrow { margin: 0; color: var(--gold); }
.art-location-heading button { min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--gold-bright); font: inherit; cursor: pointer; }
.art-location-viewport { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; border-radius: 9px; }
.art-location-viewport::-webkit-scrollbar { display: none; }
.art-location-track { display: flex; width: max-content; }
.art-location-group { display: flex; gap: 16px; padding-right: 16px; }
.art-location-tile { position: relative; display: block; flex: 0 0 360px; width: 360px; height: 290px; overflow: hidden; border-radius: 8px; background: #0b1215; color: #fff1cf; text-decoration: none; }
.art-location-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art-location-tile span { position: absolute; inset: auto 0 0; padding: 2.4rem 1rem .9rem; background: linear-gradient(transparent,rgba(3,8,12,.9)); font: 600 1.15rem/1.3 var(--text); }
.art-location-tile:focus-visible { outline-offset: -4px; }
@media (max-width: 760px) { .art-location-tile { flex-basis: 270px; width: 270px; height: 225px; } .art-location-heading .eyebrow { font-size: .6rem; } }
