/* Isolated chapter-page canvas Cosmos presentation. */
body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas {
  overflow: hidden;
}

:root:not(.no-starfield):not([data-mode="light"]) body.single-fcn_chapter.zy-cohesion-view.zy-starfield-enabled .zy-shell-starfield--canvas {
  display: block;
}

body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 600ms ease;
  pointer-events: none;
}

body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas:not(.is-ready) .zy-shell-starfield__canvas {
  opacity: 0;
}

body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 5, 12, 0.08) 0%, rgba(2, 5, 12, 0.01) 17%, rgba(2, 5, 12, 0.12) 34%, rgba(2, 5, 12, 0.18) 50%, rgba(2, 5, 12, 0.12) 66%, rgba(2, 5, 12, 0.01) 83%, rgba(2, 5, 12, 0.08) 100%),
    radial-gradient(ellipse at center, rgba(11, 14, 20, 0) 0 32%, rgba(11, 14, 20, 0.055) 54%, rgba(11, 14, 20, 0.105) 68%, rgba(11, 14, 20, 0.18) 100%),
    radial-gradient(circle at 50% 46%, rgba(8, 11, 16, 0) 0 32%, rgba(7, 10, 15, 0.075) 54%, rgba(5, 7, 11, 0.19) 78%, rgba(3, 4, 7, 0.36) 100%),
    linear-gradient(180deg, rgba(4, 6, 10, 0.13), rgba(4, 6, 10, 0.035) 14%, rgba(4, 6, 10, 0.035) 86%, rgba(3, 4, 7, 0.19));
  opacity: calc(var(--zy-starfield-opacity) * 0.82);
}

:root[data-mode="light"] body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__canvas {
    transition: none !important;
  }
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle[hidden] {
  display: none !important;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.56rem;
  justify-self: center;
  width: fit-content;
  max-width: min(100%, 28rem);
  min-height: 2.35rem;
  margin: clamp(0.52rem, 1vw, 0.76rem) auto 0;
  padding: 0.38rem 0.55rem 0.38rem 0.46rem;
  overflow: hidden;
  border: 1px solid rgba(255, 218, 145, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 223, 159, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(18, 23, 35, 0.86), rgba(9, 12, 20, 0.90));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.18);
  color: rgba(248, 242, 230, 0.94);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}



body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle:hover,
body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle:focus-visible {
  border-color: rgba(255, 226, 160, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 24px rgba(0, 0, 0, 0.21);
  transform: translateY(-1px);
}



body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle:focus-visible {
  outline: 2px solid rgba(255, 226, 160, 0.42);
  outline-offset: 3px;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle[aria-pressed="false"] {
  opacity: 0.78;
  border-color: rgba(202, 216, 245, 0.16);
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle:disabled {
  cursor: default;
  opacity: 0.62;
  filter: saturate(0.84);
  transform: none;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle__orb {
  position: relative;
  width: 1.18rem;
  height: 1.18rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95) 0 8%, rgba(255, 227, 168, 0.78) 15%, rgba(119, 160, 255, 0.38) 43%, rgba(60, 76, 150, 0.20) 68%, rgba(0, 0, 0, 0) 72%),
    conic-gradient(from 40deg, rgba(126, 166, 255, 0.08), rgba(255, 219, 145, 0.32), rgba(157, 129, 255, 0.18), rgba(126, 166, 255, 0.08));
  box-shadow:
    0 0 10px rgba(141, 178, 255, 0.38),
    0 0 18px rgba(255, 216, 145, 0.15);
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle__copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  text-align: left;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle__label {
  color: rgba(255, 230, 173, 0.95);
  font-family: "Cinzel", var(--ff-heading);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle__note {
  color: rgba(220, 228, 246, 0.68);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle__state {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 1.3rem;
  padding: 0 0.42rem;
  border: 1px solid rgba(255, 226, 160, 0.18);
  border-radius: 999px;
  background: rgba(255, 226, 160, 0.075);
  color: rgba(255, 236, 197, 0.92);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle {
    transition: none !important;
  }
}

body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top .chapter__actions-container {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.5rem;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle.is-inline-actions,
body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle--compact.is-inline-actions {
  justify-self: auto;
  grid-template-columns: auto auto;
  gap: 0.34rem;
  width: auto;
  min-width: 0;
  max-width: max-content;
  min-height: 2.02rem;
  height: 2.02rem;
  margin: 0;
  padding: 0.22rem 0.42rem;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(255, 218, 145, 0.032),
    0 8px 18px rgba(0, 0, 0, 0.18),
    0 0 22px rgba(108, 142, 255, 0.065);
}

body.single-fcn_chapter.zy-cohesion-view :is(.zy-chapter-cosmos-toggle.is-inline-actions, .zy-chapter-cosmos-toggle--compact.is-inline-actions) .zy-chapter-cosmos-toggle__orb {
  display: none;
}

body.single-fcn_chapter.zy-cohesion-view :is(.zy-chapter-cosmos-toggle.is-inline-actions, .zy-chapter-cosmos-toggle--compact.is-inline-actions) .zy-chapter-cosmos-toggle__copy {
  display: inline-flex;
  gap: 0;
  min-width: 0;
}

body.single-fcn_chapter.zy-cohesion-view :is(.zy-chapter-cosmos-toggle.is-inline-actions, .zy-chapter-cosmos-toggle--compact.is-inline-actions) .zy-chapter-cosmos-toggle__label {
  font-size: 0.62rem;
  letter-spacing: 0.11em;
}

body.single-fcn_chapter.zy-cohesion-view :is(.zy-chapter-cosmos-toggle.is-inline-actions, .zy-chapter-cosmos-toggle--compact.is-inline-actions) .zy-chapter-cosmos-toggle__note {
  display: none;
}

body.single-fcn_chapter.zy-cohesion-view :is(.zy-chapter-cosmos-toggle.is-inline-actions, .zy-chapter-cosmos-toggle--compact.is-inline-actions) .zy-chapter-cosmos-toggle__state {
  min-width: 1.74rem;
  min-height: 1.06rem;
  padding-inline: 0.32rem;
  font-size: 0.56rem;
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle.is-inline-actions[aria-pressed="false"] .zy-chapter-cosmos-toggle__state {
  border-color: rgba(190, 208, 242, 0.16);
  background: rgba(190, 208, 242, 0.06);
  color: rgba(221, 229, 244, 0.84);
}

body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle.is-inline-actions:hover,
body.single-fcn_chapter.zy-cohesion-view .zy-chapter-cosmos-toggle.is-inline-actions:focus-visible {
  transform: translateY(-1px);
}

/* The source artwork is portrait (1365 × 2048), so any landscape viewport
 * requires cropping when it is used as a full-bleed cover. Cover preserves the
 * original aspect ratio: it never stretches the image. Centre anchoring keeps
 * the baked reading aperture aligned with Fictioneer's central reading column
 * and distributes unavoidable crop evenly rather than pinning the composition
 * to the top edge. Phones still do not mount or request the artwork. */
body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: #020611;
  background-repeat: no-repeat !important;
  opacity: calc(var(--zy-starfield-opacity) * 0.96);
  filter: saturate(1.05) contrast(1.04) brightness(0.985);
  transform: none !important;
  transform-origin: center;
  animation: none !important;
}

@media (min-width: 768px) {
  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__backdrop {
    background-image: url("../images/chapter-cosmos-base.webp");
  }
}

@media (min-width: 768px) {
  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__backdrop {
    background-size: cover !important;
    background-position: center center !important;
    background-origin: border-box !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__canvas {
    display: none !important;
  }

  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--static .zy-shell-starfield__backdrop {
    opacity: calc(var(--zy-starfield-opacity) * 0.88);
    filter: saturate(1.01) contrast(1.025) brightness(0.93);
  }

  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--static .zy-shell-starfield__vignette {
    opacity: calc(var(--zy-starfield-opacity) * 0.76);
  }
}

@media (max-width: 767px) {
  body.single-fcn_chapter.zy-cohesion-view > #site > .zy-shell-starfield--site-root {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas .zy-shell-starfield__backdrop {
    animation: none !important;
  }
}

/* Retain a dark fallback only when the resolved mode is dark. */
:root[data-mode="dark"] body.single-fcn_chapter.zy-cohesion-view {
  background-color: #020611;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) body.single-fcn_chapter.zy-cohesion-view {
    background-color: #020611;
  }
}
body.single-fcn_chapter.zy-cohesion-view > #site > .zy-shell-starfield--site-root {
  all: initial;
  position: fixed !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  z-index: -1 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  pointer-events: none !important;
  user-select: none !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color-scheme: dark;
  isolation: isolate;
  contain: strict;
}

body.single-fcn_chapter.zy-cohesion-view > #site > .zy-shell-starfield--site-root,
body.single-fcn_chapter.zy-cohesion-view > #site > .zy-shell-starfield--site-root * {
  box-sizing: border-box !important;
}

body.single-fcn_chapter.zy-cohesion-view > #site > .zy-shell-starfield--site-root :is(.zy-shell-starfield__backdrop, .zy-shell-starfield__canvas, .zy-shell-starfield__vignette) {
  position: absolute !important;
  inset: 0 !important;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  transform-origin: center center !important;
}

:root[data-mode="light"] body.single-fcn_chapter.zy-cohesion-view > #site > .zy-shell-starfield--site-root {
  display: none !important;
}

body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas-fallback .zy-shell-starfield__canvas {
  display: none !important;
}

body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top,
body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top .chapter__actions-container {
  min-width: 0;
}

body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top .chapter__actions-container {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.38rem !important;
  max-width: 100%;
  overflow: visible;
}

body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top :is(.button, .popup-menu-toggle, .zy-chapter-cosmos-toggle) {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100%;
}

@media (max-width: 720px) {
  body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top .chapter__actions-container {
    justify-content: flex-start !important;
    gap: 0.34rem !important;
  }

  body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top :is(.button, .popup-menu-toggle) {
    min-height: 2.42rem;
    padding-inline: 0.64rem;
  }
}

@media (max-width: 380px) {
  body.single-fcn_chapter.zy-cohesion-view .chapter__actions--top :is(.button, .popup-menu-toggle) {
    padding-inline: 0.52rem;
    font-size: 0.76rem;
    letter-spacing: 0.035em;
  }
}

@media print {
  body.single-fcn_chapter.zy-cohesion-view .zy-shell-starfield--canvas {
    display: none !important;
  }
}
