:root {
  color-scheme: light;
  --display-button-text: #fff;
  --display-button-hover-text: #fff;
  --display-focus: #133eaa;
  --display-footer-muted: #d0ddd6;
}
:root[data-display-size="125"] { font-size: calc(var(--display-base-size, 100%) * 1.25); }
:root[data-display-size="150"] { font-size: calc(var(--display-base-size, 100%) * 1.5); }
:root[data-display-size="200"] { font-size: calc(var(--display-base-size, 100%) * 2); }
:root[data-display-theme="contrast"] {
  --paper: #fff;
  --ink: #000;
  --muted: #222;
  --green: #000;
  --line: #333;
  --tint: #f0f0f0;
  --white: #fff;
  --display-footer-muted: #fff;
  --display-selection: #000;
  --display-selection-text: #fff;
}
:root[data-display-theme="dark"] {
  color-scheme: dark;
  --paper: #111;
  --ink: #fff;
  --muted: #ddd;
  --green: #ffed9b;
  --line: #aaa;
  --tint: #252525;
  --white: #191919;
  --display-button-text: #111;
  --display-button-hover-text: #111;
  --display-focus: #ffed9b;
  --display-footer-muted: #222;
  --display-selection: #ffed9b;
  --display-selection-text: #111;
}
:root[data-display-spacing="true"] main :is(p, li, dd, figcaption) {
  line-height: 1.9;
  letter-spacing: 0.04em;
  word-spacing: 0.12em;
}
:root[data-display-spacing="true"] main p { margin-bottom: 1.5em; }
main { overflow-wrap: anywhere; }
:root[data-display-links="true"] a {
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.22em;
}
:root[data-display-motion="true"] *,
:root[data-display-motion="true"] *::before,
:root[data-display-motion="true"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
.reading-tools-wrap {
  height: 0;
  padding: 0;
}
details.reading-tools {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  border: 0;
  padding: 0;
  color: var(--ink, #192c29);
}
.reading-tools :focus-visible {
  outline: 3px solid var(--display-focus, #133eaa);
  outline-offset: 4px;
}
:root[data-display-theme="dark"] :is(.brand, .wordmark, img[src*="accessible-notification"]) {
  background: #fff;
  border-radius: 0.2rem;
}
:root[data-display-theme="dark"] .brand { padding: 0.25rem; }
.reading-tools > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 56px;
  height: 56px;
  padding: 10px;
  list-style: none;
  border: 2px solid var(--green, #245a4a);
  border-radius: 50%;
  background: var(--green, #245a4a);
  color: var(--display-button-text, #fff);
  box-shadow: 0 3px 14px #0004;
}
.reading-tools > summary::-webkit-details-marker { display: none; }
.reading-tools > summary::marker { content: ""; }
.reading-tools > summary svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reading-tools-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.reading-tools > .reading-tools-content {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + 68px);
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100vh - 1rem - 92px);
  max-height: calc(100dvh - 1rem - 92px);
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  scroll-padding-top: 64px;
  padding: 1rem;
  border: 2px solid var(--line, #b8c4bc);
  border-radius: 0.5rem;
  background: var(--white, #fffdf8);
  box-shadow: 0 6px 24px #0004;
}
.reading-tools-top { position: sticky; top: -1rem; display: flex; justify-content: flex-end; padding-bottom: 0.4rem; z-index: 1; background: var(--white, #fffdf8); }
.reading-tools-close { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid currentColor; border-radius: 0.2rem; background: var(--white, #fffdf8); color: var(--ink, #192c29); font-size: 28px; line-height: 1; }
.reading-tools p { max-width: 70ch; }
.reading-tools fieldset {
  min-inline-size: 0;
  margin: 1rem 0 0;
  border: 0;
  padding: 0;
}
.reading-tools legend { font-weight: 700; padding: 0; margin-bottom: 1rem; }
.reading-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem 2rem;
}
.reading-tools-grid > div { min-width: 0; }
.reading-tools-grid label { display: block; font-weight: 700; }
.reading-tools select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  margin-top: 0.4rem;
  padding: 0.55rem 0.6rem;
  font: inherit;
  color: var(--ink, #192c29);
  background: var(--white, #fffdf8);
  border: 2px solid var(--muted, #4c605b);
  border-radius: 0.2rem;
}
.reading-tools-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.5rem 1.5rem;
  margin-top: 1rem;
}
.reading-tools-toggles > label {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0;
  overflow-wrap: anywhere;
}
.reading-tools input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--green, #245a4a);
}
.reading-tools .reading-tools-note { margin-top: 0.6rem; color: var(--muted, #4c605b); font-size: 0.92rem; }
.reading-tools-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
}
.reading-tools-actions button {
  cursor: pointer;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 700;
  color: var(--ink, #192c29);
  background: var(--white, #fffdf8);
  border: 2px solid currentColor;
  border-radius: 0.2rem;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
}
.reading-tools-actions a { display: inline-flex; min-height: 44px; align-items: center; }
.reading-tools .reading-tools-status { margin-top: 0.7rem; font-size: 0.92rem; }
@media (max-width: 700px) {
  .reading-tools-grid, .reading-tools-toggles { grid-template-columns: minmax(0, 1fr); }
}
@media screen {
  html { scroll-padding-bottom: calc(1rem + 68px); }
  body { padding-bottom: calc(1rem + 68px); }
}
@media print {
  .reading-tools-wrap, details.reading-tools { display: none !important; }
  :root {
    font-size: 11pt !important;
    --paper: #fff !important;
    --ink: #000 !important;
    --muted: #222 !important;
    --green: #000 !important;
    --line: #888 !important;
    --tint: #fff !important;
    --white: #fff !important;
  }
}
@media (forced-colors: active) {
  .reading-tools :focus-visible { outline-color: Highlight; }
}
