.reading-tools svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  aspect-ratio: 1;
  flex: none;
  display: block;
}
.reading-settings > summary {
  border-radius: 50%;
  width: 48px;
  height: 48px;
}
.settings-panel {
  width: 292px;
  max-width: calc(100vw - 32px);
  max-height: calc(100svh - 128px);
  overflow: auto;
  padding: 16px;
  background: #faf7ef;
  color: #20201d;
  bottom: 112px;
  box-sizing: border-box;
  border: 1px solid #ded9ce;
  box-shadow: 0 10px 24px #0003;
  font-family: Barlow, sans-serif;
  font-size: 14px;
  line-height: 1.3;
}
.settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #d4cfc4;
  margin-bottom: 14px;
}
.settings-heading h2 {
  font:
    600 16px/1.3 Barlow,
    sans-serif;
  margin: 0;
  letter-spacing: 0;
}
.settings-panel #settings-close {
  display: grid;
  place-items: center;
  border: 1px solid #b93022;
  border-radius: 5px;
  width: 27px;
  min-height: 27px;
  height: 27px;
  padding: 3px;
  margin: 0;
  background: transparent;
}
.settings-panel #settings-close svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  stroke: #676256;
}
.settings-panel fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}
.settings-panel legend {
  font:
    600 10px/1.3 Barlow,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #69624f;
  padding: 0;
  margin-bottom: 9px;
}
.settings-panel button {
  font-family: Barlow, sans-serif;
  color: #20201d;
  cursor: pointer;
}
.text-size-controls {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 7px;
  align-items: center;
}
.text-size-controls button {
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid #d4cfc4;
  background: transparent;
  font-size: 16px;
}
.text-size-controls output {
  height: 30px;
  display: grid;
  place-items: center;
  background: #efeadf;
  border: 1px solid #d4cfc4;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.settings-panel .setting-row {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d4cfc4;
  font:
    400 14px/1.25 Barlow,
    sans-serif;
  margin: 0 0 7px;
  cursor: pointer;
  box-sizing: border-box;
}
.setting-row input {
  position: absolute !important;
  right: 10px;
  opacity: 0;
  width: 32px !important;
  height: 22px !important;
  margin: 0;
  cursor: pointer;
}
.setting-switch {
  display: block;
  width: 30px;
  height: 17px;
  border: 1px solid #d1cbbd;
  background: #eee9dd;
  border-radius: 12px;
  position: relative;
  flex: none;
  pointer-events: none;
}
.setting-switch:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #69624f;
  transition: transform 0.15s ease;
}
.setting-row input:checked + .setting-switch {
  background: #b93022;
  border-color: #b93022;
}
.setting-row input:checked + .setting-switch:before {
  background: white;
  transform: translateX(13px);
}
.setting-row:has(input:focus-visible) {
  outline: 2px solid #b93022;
  outline-offset: 2px;
}
.theme-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 7px;
}
.theme-controls button {
  min-height: 34px;
  font-size: 13px;
  border: 1px solid #d4cfc4;
  padding: 5px;
  margin: 0;
  background: transparent;
}
.theme-controls button[aria-pressed="true"] {
  background: #272722;
  color: white;
  border-color: #272722;
}
.settings-panel #settings-reset {
  width: 100%;
  padding: 10px 8px;
  min-height: 38px;
  margin: 0;
  border: 1px solid #272722;
  font-size: 12px;
  background: transparent;
}
.settings-panel button:hover:not(:disabled) {
  background: #e9e3d7;
}
.settings-panel button:disabled {
  opacity: 0.4;
  cursor: default;
}
.wide-spacing main p,
.wide-spacing main li {
  line-height: 1.85 !important;
  letter-spacing: 0.045em !important;
  word-spacing: 0.09em;
}
.underlined-links a {
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
}
.legible-type {
  --body: Arial, sans-serif;
  --display: Arial, sans-serif;
}
.legible-type main {
  font-family: Arial, sans-serif;
}
.grayscale main,
.grayscale .site-nav,
.grayscale .site-footer {
  filter: grayscale(1);
}
.reader-dark {
  --paper: #17191a;
  --white: #222526;
  --ink: #f1eee7;
  --text: #f1eee7;
  --muted: #c8c4bb;
  --line: #666;
  --accent: #ff9b8e;
}
.reader-dark body,
.reader-dark .outdoor-teaser,
.reader-dark .day-chapter {
  background: #17191a;
  color: #f1eee7;
}
.reader-dark .time-machine-year,
.reader-dark .horizon-number {
  color: #f1eee7;
}
.reader-dark .time-machine-year .travel-year-ending,
.reader-dark .horizon-number span {
  color: #ff9b8e;
}
.reader-dark .source-link {
  color: #ff9b8e;
}
.reader-dark .day-evidence .source-link,
.reader-dark .day-result > .note {
  color: #e0dacf;
}
.reader-light {
  --paper: #fff;
  --white: #fff;
  --ink: #17191a;
  --text: #17191a;
  --muted: #484848;
  --line: #bbb;
}
.reader-light body {
  background: white;
  color: #17191a;
}
.reader-light main .dark {
  background: #f0ede7;
  color: #17191a;
  --accent: #a32619;
  --light-accent: #a32619;
  --muted: #484848;
  --line: #aaa;
}
.reader-light main .dark .note {
  color: #484848;
}
.reader-light .quiz-chapter {
  --highlight: #a32619;
}
.reader-light .quiz-play #quiz-answers button {
  color: #17191a;
}
.reader-light .quiz-play #quiz-answers button:hover:not(:disabled) {
  color: var(--highlight);
}
.reader-light .quiz-play #quiz-answers button[data-result="correct"] {
  color: #ffffff;
}
.reader-light .quiz-play #quiz-answers button[data-result="incorrect"] {
  border-color: #17191a;
}
.reader-light .quiz-play #quiz-answers button[data-result="idle"] {
  color: #484848;
}
.high-contrast .source-link {
  color: #8e2116;
}
.reader-dark.high-contrast .source-link {
  color: #ffc4bc;
}
.reportage-glasses-layer {
  clip-path: circle(0 at var(--lens-x, 50%) var(--lens-y, 25%));
  transition: clip-path 0.12s ease;
}
.reportage-stage.lens-visible .reportage-glasses-layer {
  clip-path: circle(180px at var(--lens-x, 50%) var(--lens-y, 25%));
}
.reportage-glasses {
  pointer-events: none;
  filter: contrast(0.93) saturate(1.03) url(#portrait-color-balance);
  transform: scale(calc(1 + var(--progress) * 0.075))
    var(--portrait-registration, matrix(1, 0, 0, 1, 0, 0));
}
.reduce-motion .reportage-glasses-layer {
  display: block;
  transition: none;
}
@media (max-width: 700px) {
  .reportage-stage.lens-visible .reportage-glasses-layer {
    clip-path: circle(120px at var(--lens-x, 50%) var(--lens-y, 25%));
  }
}
@media (prefers-reduced-motion: reduce) {
  .setting-switch:before,
  .reportage-glasses-layer {
    transition: none;
  }
}
.nav-open .scene-timeline {
  visibility: hidden;
}
@media (max-width: 700px) {
  .site-nav .nav-inner {
    padding-inline: 12px;
    gap: 8px;
  }
  .site-nav .brand {
    gap: 6px;
    max-width: calc(100% - 174px);
  }
  .site-nav .brand-mark {
    width: 24px;
    height: 28px;
    flex: none;
  }
  .site-nav .brand-type,
  .site-nav .brand-type b {
    font-size: 16px;
    line-height: 1.05;
  }
  .site-nav .menu-toggle {
    width: 64px;
    min-width: 64px;
    padding-inline: 0;
  }
  .reading-tools {
    top: 18px;
    right: 84px;
    bottom: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  .reading-settings {
    position: static;
  }
  .reading-settings > summary,
  .reading-tools .to-top {
    width: 44px;
    height: 44px;
  }
  .reading-settings .settings-panel {
    position: fixed;
    top: 76px;
    right: 12px;
    bottom: auto;
    max-height: calc(100svh - 92px);
  }
  .nav-open .reading-tools {
    visibility: hidden;
  }
}
@media (max-width: 700px) {
  .reading-tools.form-in-view .to-top {
    visibility: hidden;
  }
}
