/* Running, from the half to the full. Palette from a race morning:
   bib white paper, asphalt charcoal for structure, a light asphalt tint behind diagrams with white lane lines,
   and tartan track red as the one accent. Reflective safety yellow appears only where something lights up:
   the night toggle, your own marker in a diagram, and highlights. */
:root {
  --paper: #F5F6F7;
  --ink: #15181C;
  --ink-soft: #4A515A;
  --rule: #DADDE2;
  --tint: #E6E8EC;
  --tint-2: #D3D8DF;
  --deep: #23303D;
  --accent: #C23B22;
  --bad: #B42318;
  --good: #1E7A46;
  --hi: #D9EC00;
  --white: #FFFFFF;
  --tartan: #CF5F45;
  --lane: #FFFFFF;
  --grass: #A9C99A;
  --water: #A3C8DD;
  --road: #C9CED6;
  --body: "Barlow", system-ui, sans-serif;
  --head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --measure: 66ch;
  --r-lg: 18px;
  --r-sm: 10px;
}
html[data-size="1"] { font-size: 112.5%; }
html[data-size="2"] { font-size: 125%; }
body.legible { --body: "Atkinson Hyperlegible", system-ui, sans-serif; --head: "Atkinson Hyperlegible", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.125rem/1.6 var(--body); }
img, svg { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: .5rem; z-index: 50; background: var(--white); padding: .5rem 1rem; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 60px; padding: 0 clamp(1rem, 3vw, 2rem); background: rgba(245,246,247,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font: 700 1.3rem/1 var(--head); }
.bar-nav { display: flex; align-items: center; gap: .25rem; }
.bar-link { background: none; border: 0; padding: .45rem .75rem; border-radius: 999px; color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--body); }
.bar-link:hover, .bar-link[aria-current="page"] { background: var(--tint); color: var(--ink); }
.bar-aa { font-family: var(--head); font-size: 1.1rem; }
.brand { white-space: nowrap; }
@media (max-width: 430px) { .brand-rest { display: none; } .bar-link { padding: .45rem .6rem; } }
@media (max-width: 400px) { .brand-word { display: none; } .topbar { gap: .5rem; } .bar-link { padding: .45rem .5rem; } }

/* ---------- sheets (chapters, options) ---------- */
.sheet { border: 0; padding: 1.25rem 1.25rem 1.5rem; width: min(560px, 100%); max-height: 86vh; border-radius: var(--r-lg);
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(21,24,28,.28); }
.sheet::backdrop { background: rgba(21,24,28,.42); }
@media (max-width: 640px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.sheet-head h2 { margin: 0; font: 700 1.6rem/1.1 var(--head); }
.sheet-close { background: var(--tint); border: 0; border-radius: 999px; padding: .4rem .9rem; font-weight: 600; }
.opt { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; }
.opt > span { font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--tint); border-radius: 999px; width: fit-content; }
.seg button { border: 0; background: transparent; padding: .4rem .9rem; border-radius: 999px; font-size: .95rem; }
.seg button[aria-pressed="true"] { background: var(--white); box-shadow: 0 1px 3px rgba(21,24,28,.18); font-weight: 600; }

/* ---------- table of contents ---------- */
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: grid; grid-template-columns: 2rem 1fr auto; align-items: baseline; gap: .25rem; padding: .55rem .5rem; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; line-height: 1.3; }
.toc a:hover { background: var(--tint); }
.toc a[aria-current="page"] { background: var(--white); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.toc-n { font: 700 1rem/1 var(--head); color: var(--accent); }
.done .toc-done::after, .done .cl-done::after { content: "Read"; font-size: .78rem; font-weight: 600; color: var(--good); }
.offline-status { font-size: .9rem; color: var(--ink-soft); margin: 1rem 0 0; padding-left: .75rem; border-left: 3px solid var(--good); }
.offline-status.is-offline { border-left-color: var(--hi); }

/* ---------- page shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.side { display: none; }
@media (min-width: 1080px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); gap: 3.5rem; }
  .shell-wide { grid-template-columns: 1fr; }
  .side { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; padding: 1.5rem 0; }
}
main { min-width: 0; padding-bottom: 3rem; }

/* ---------- type ---------- */
h1 { font: 700 clamp(2.6rem, 8vw, 4rem)/1 var(--head); letter-spacing: -.01em; margin: 0 0 .9rem; }
h2 { font: 700 1.85rem/1.1 var(--head); margin: 2.6rem 0 .8rem; }
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); max-width: 44ch; margin: 0; }
p, li { max-width: var(--measure); }
.ch-head { padding: 2.2rem 0 1.5rem; }
.ch-num { margin: 0 0 .6rem; font: 600 1rem/1 var(--head); color: var(--accent); letter-spacing: .02em; }
.ch-meta { margin: .9rem 0 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.3rem; border-radius: 999px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; font: 600 1.05rem/1.2 var(--body); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--deep); border-color: var(--deep); color: var(--white); }

/* ---------- stage: where every animation lives ---------- */
.stage { position: relative; border-radius: var(--r-lg); padding: clamp(.75rem, 2.5vw, 1.5rem); margin: 0 0 2rem;
  background-color: var(--tint);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 62px, rgba(255,255,255,.55) 62px 64px); }
.stage-title { margin: 0 0 .5rem; font: 700 1.15rem/1 var(--head); color: var(--deep); }
.stage-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 .75rem; background: rgba(255,255,255,.55); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.stage-tabs button { border: 0; background: transparent; padding: .45rem 1rem; border-radius: 999px; font-weight: 600; white-space: nowrap; color: var(--deep); }
.stage-tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(21,24,28,.18); }
.diagram { margin: 0; }
.diagram svg { width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.diagram figcaption { text-align: center; font-size: .92rem; color: var(--ink-soft); margin: .6rem auto 0; max-width: 56ch; }
.readout { text-align: center; margin: .7rem auto 0; min-height: 3.2em; max-width: 52ch; font-size: 1.02rem; }

/* ---------- in short ---------- */
.in-short { background: var(--white); border-radius: var(--r-lg); padding: 1.25rem 1.5rem; margin: 0 0 1rem; box-shadow: inset 0 0 0 1px var(--rule); }
.in-short h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.in-short ul { margin: 0; padding-left: 1.2rem; }
.in-short li { margin: .3rem 0; }
.in-short li::marker { color: var(--accent); }

/* ---------- prose and accordions ---------- */
.prose > h2 { scroll-margin-top: 80px; }
.prose details { border-top: 1px solid var(--rule); }
.prose details:last-of-type { border-bottom: 1px solid var(--rule); }
.prose summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem .25rem; font: 600 1.12rem/1.35 var(--body); }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2.5px solid var(--deep); border-bottom: 2.5px solid var(--deep);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.prose details[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.prose details > :not(summary) { margin-left: .25rem; margin-right: .25rem; }
.prose details > :last-child { margin-bottom: 1.25rem; }
.prose ol, .prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose summary label { cursor: pointer; display: flex; align-items: center; gap: .6rem; }
.prose input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--good); }
.checks { list-style: none; padding-left: 0 !important; }
.checks label { display: flex; gap: .6rem; align-items: flex-start; }
.checks input { margin-top: .3rem; flex: none; }
.callout { background: var(--white); border-radius: var(--r-sm); padding: .9rem 1.1rem; box-shadow: inset 0 0 0 1px var(--rule); }
.note { color: var(--ink-soft); font-size: 1rem; background: rgba(230,232,236,.8); padding: .75rem 1rem; border-radius: var(--r-sm); }
.note.warn { background: #FBEAE6; color: var(--ink); }
.ten { padding-left: 1.4rem; }
.ten li { margin-bottom: 1rem; }
.ten li::marker { font: 700 1.1rem var(--head); color: var(--accent); }
.print-row { margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: .5rem 0 1rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 600 1rem var(--head); color: var(--ink-soft); }

/* ---------- flashcards ---------- */
.flash { background: var(--white); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: inset 0 0 0 1px var(--rule); }
.flash-count { color: var(--ink-soft); font-size: .92rem; margin: 0 0 .4rem; }
.flash-q { font: 700 1.6rem/1.2 var(--head); margin: 0 0 1rem; }
.flash-a { background: var(--tint); padding: .9rem 1.1rem; border-radius: var(--r-sm); }
.flash-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.flash-btns button { border: 2px solid var(--ink); background: transparent; border-radius: 999px; padding: .5rem 1.1rem; font-weight: 600; }
.flash-btns button:hover { background: var(--ink); color: var(--paper); }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--ink); font: 700 1.35rem/1.15 var(--head); padding: .75rem 0; }
.pager a span { font: 500 .9rem var(--body); color: var(--ink-soft); }
.pager a:hover { color: var(--accent); }
.pager-next { text-align: right; align-items: flex-end; }

/* ---------- home ---------- */
.hero { display: grid; gap: 1.5rem; padding: 2.2rem 0 1rem; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3rem; padding-top: 3.5rem; } }
.hero h1 { font-size: clamp(3.2rem, 11vw, 6rem); line-height: .92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-stage { margin: 0; }
.resume { margin-top: 1.25rem; font-size: 1rem; }
.home-chapters h2 { font-size: 2.2rem; }
.chapter-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.chapter-list a { display: grid; grid-template-columns: 96px 2.2rem minmax(0, 1fr) auto; gap: .9rem; align-items: center;
  padding: .9rem .25rem; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.chapter-list a:hover { background: var(--white); }
.thumb { width: 96px; height: 66px; object-fit: contain; border-radius: var(--r-sm); background: var(--tint); }
.thumb.icon { padding: 6px 14px; }
.cl-n { font: 700 1.6rem/1 var(--head); color: var(--accent); text-align: right; }
.cl-text { display: flex; flex-direction: column; gap: .15rem; }
.cl-t { font: 700 1.35rem/1.1 var(--head); }
.cl-s { font-size: .98rem; color: var(--ink-soft); line-height: 1.35; }
.cl-a { font-size: .85rem; font-weight: 600; color: var(--deep); }
@media (max-width: 560px) {
  .chapter-list a { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .thumb { width: 72px; height: 54px; }
  .cl-n { display: none; }
}

/* ---------- gallery ---------- */
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem 1.25rem; }
.gallery a { display: flex; flex-direction: column; gap: .3rem; color: var(--ink); text-decoration: none; }
.gallery img, .gal-blank { width: 100%; height: auto; aspect-ratio: 16 / 11; object-fit: contain; border-radius: var(--r-lg); background: var(--tint); margin-bottom: .4rem; }
.gal-t { font: 700 1.4rem/1.1 var(--head); }
.gal-d { font-size: 1rem; color: var(--ink-soft); line-height: 1.4; }
.gal-c { font-size: .88rem; font-weight: 600; color: var(--accent); }
.gallery a:hover .gal-t { color: var(--accent); }

/* ---------- footer ---------- */
.foot { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .92rem; }
.signout button { border: 1px solid var(--rule); background: var(--white); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; color: var(--ink-soft); }
/* ---------- shared diagram pieces ---------- */
.svg-label { fill: var(--ink); font: 600 14px var(--body); }
.svg-small { fill: var(--ink-soft); font: 12px var(--body); }
.svg-red { fill: var(--bad); }
.svg-green { fill: var(--good); }
.svg-num-light { fill: #fff; font: 700 20px var(--head); }

/* ---------- diagram controls on the stage ---------- */
.anim-ctrl { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: .8rem 0 0; }
.anim-ctrl button { border: 0; background: rgba(255,255,255,.72); color: var(--deep); border-radius: 999px; padding: .5rem 1rem; font-weight: 600; font-size: .92rem; }
.anim-ctrl button:hover { background: var(--white); }
.anim-ctrl button[aria-pressed="true"] { background: var(--deep); color: var(--white); }
.stage .anim svg { max-width: 540px; }

/* ---------- hero without an animation ---------- */
@media (min-width: 900px) { .hero.hero-solo { grid-template-columns: minmax(0, 1fr); } }

/* ---------- running diagrams: track lanes, park, bars, runners ---------- */
.r-bg { fill: var(--white); }
.r-tartan { fill: var(--tartan); }
.r-laneline { stroke: var(--lane); stroke-width: 1.6; opacity: .9; }
.r-finish { stroke: var(--lane); stroke-width: 4; stroke-dasharray: 4 4; }
.r-tick { stroke: var(--ink); stroke-width: 1; opacity: .45; }
.r-bar { fill: var(--tint); stroke: var(--rule); }
.r-bar-fill { fill: var(--deep); }
.r-runner { fill: var(--accent); stroke: var(--white); stroke-width: 2; }
.r-runner.alt { fill: var(--deep); }
.r-runner.track { fill: var(--hi); stroke: #15181C; stroke-width: 1.5; }
.r-you { fill: var(--hi); stroke: var(--ink); stroke-width: 2; }
.r-lab { fill: var(--ink); font: 600 14.5px var(--body); }
.r-small { fill: var(--ink-soft); font: 500 13.5px var(--body); }
.r-on-track { fill: #fff; font: 600 14px var(--body); }
.r-on-track-t { fill: #fff; font: 700 15px var(--head); }
.r-halo { paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.r-time { fill: var(--ink); font: 700 16px var(--head); }
.r-clock { fill: var(--ink); font: 700 24px var(--head); }
.r-grass { fill: var(--grass); }
.r-water { fill: var(--water); }
.r-road { fill: none; stroke: var(--road); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.r-loop { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 5; opacity: .35; }
.r-loop.on { stroke: var(--accent); stroke-width: 5; stroke-dasharray: none; opacity: 1; }
.r-dot { fill: var(--tint-2); }
.r-dot.lit { fill: var(--deep); }
.r-dot.in { fill: var(--accent); }
.r-bib { fill: var(--white); stroke: var(--ink); stroke-width: 1.4; }
.r-bib.done { fill: var(--deep); }
.r-bib.vol { stroke-dasharray: 3 3; }
.r-bibnum { fill: var(--ink); font: 700 15px var(--head); }
.r-bibnum.done { fill: var(--paper); }
.r-easy { fill: var(--deep); }
.r-hard { fill: var(--accent); }
.r-limit { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.r-share-ok { fill: var(--good); }
.r-share-warn { fill: var(--bad); }
.r-tank { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.r-fuel { fill: var(--good); }
.r-fuel.low { fill: var(--bad); }
.r-wall { fill: var(--bad); opacity: .16; }
.r-std { stroke: var(--deep); stroke-width: 3; }
.r-cut { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 4; }
.r-zone-in { fill: var(--good); opacity: .22; }
.r-zone-draw { fill: var(--hi); opacity: .5; }
.r-zone-out { fill: var(--bad); opacity: .14; }
.r-corral { fill: var(--tint); stroke: var(--rule); }
.r-mat { fill: var(--deep); }
.r-wave1 { fill: var(--deep); }
.r-wave2 { fill: #5E7387; }
.r-wave3 { fill: #93A3B3; }
.r-ctl { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; justify-content: center; margin-top: .7rem; }
.r-ctl label { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .3rem .5rem; font-size: .95rem; color: var(--ink); max-width: 100%; }
@media (max-width: 560px) { .r-ctl label { width: 100%; } }
.r-ctl input[type="range"] { width: 170px; max-width: 100%; flex: 0 1 150px; min-width: 0; accent-color: var(--accent); }
.r-ctl select { font: inherit; font-size: .95rem; padding: .35rem .5rem; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--white); color: var(--ink); }
.r-ctl output { font-weight: 700; min-width: 4.2em; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: .7rem auto 0; max-width: 540px; }
.week-days button { border: 0; border-radius: var(--r-sm); padding: .45rem .1rem .55rem; background: rgba(255,255,255,.72); color: var(--ink); font-size: .78rem; line-height: 1.2; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.week-days button b { font: 700 .95rem var(--head); }
.week-days button[data-kind="easy"], .week-days button[data-kind="long"] { box-shadow: inset 0 -4px 0 var(--deep); }
.week-days button[data-kind="tempo"], .week-days button[data-kind="intervals"] { box-shadow: inset 0 -4px 0 var(--accent); }

/* ---------- brand mark (a race bib) and the night toggle (a headlamp switches on) ---------- */
.bi-bib { fill: var(--white); stroke: var(--ink); stroke-width: 1.6; }
.bi-pin { fill: var(--ink); }
.bi-num { fill: var(--accent); }
.bar-theme { display: inline-flex; align-items: center; padding: .3rem .55rem; }
.bar-theme svg { width: 24px; height: 24px; }
.hl-head { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.hl-band { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.hl-lamp { fill: var(--ink); }
.hl-beam { fill: var(--hi); opacity: 0; transform-origin: 14px 9px; transform: scaleX(.3); }
html[data-theme="night"] .hl-lamp { fill: var(--hi); }
html[data-theme="night"] .hl-beam { opacity: .95; transform: none; }
@media (prefers-reduced-motion: no-preference) { .hl-beam { transition: opacity .3s, transform .35s; } }

/* ---------- night mode: a run after dark. Asphalt at night, dimmed lane lines, and the reflective yellow still lights up. ---------- */
html[data-theme="night"] {
  color-scheme: dark;
  --paper: #111418;
  --ink: #E4E7EB;
  --ink-soft: #A3ABB5;
  --rule: #29303A;
  --tint: #1A1F26;
  --tint-2: #2A323D;
  --deep: #9FB3C8;
  --accent: #FF7559;
  --bad: #FF6B5B;
  --good: #5BD08A;
  --hi: #E6FF3D;
  --white: #1C2128;
  --tartan: #8E3A2B;
  --lane: #D9DDE2;
  --grass: #2F4A2C;
  --water: #284A5E;
  --road: #46505C;
}
html[data-theme="night"] .topbar { background: rgba(17,20,24,.94); }
html[data-theme="night"] .sheet { box-shadow: 0 20px 60px rgba(0,0,0,.6); }
html[data-theme="night"] .sheet::backdrop { background: rgba(0,0,0,.6); }
html[data-theme="night"] .stage { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 62px, rgba(255,255,255,.05) 62px 64px); }
html[data-theme="night"] .stage-tabs { background: rgba(0,0,0,.25); }
html[data-theme="night"] .anim-ctrl button { background: rgba(255,255,255,.08); }
html[data-theme="night"] .anim-ctrl button:hover { background: rgba(255,255,255,.16); }
html[data-theme="night"] .anim-ctrl button[aria-pressed="true"] { background: var(--deep); color: var(--paper); }
html[data-theme="night"] .note { background: rgba(159,179,200,.1); }
html[data-theme="night"] .note.warn { background: rgba(255,117,89,.14); }
html[data-theme="night"] .thumb, html[data-theme="night"] .gallery img { filter: brightness(.82); }
html[data-theme="night"] .week-days button { background: rgba(255,255,255,.08); }
html[data-theme="night"] .r-wave2 { fill: #6F849A; }
html[data-theme="night"] .r-wave3 { fill: #4A5A6B; }


@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .22s ease-out; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
  .flash-q.pop, .flash-a:not([hidden]) { animation: pop .3s ease-out both; }
  @keyframes pop { from { opacity: 0; transform: translateY(6px); } }
  :root { interpolate-size: allow-keywords; }
  .prose details::details-content { transition: height .28s ease, content-visibility .28s allow-discrete; height: 0; overflow: clip; }
  .prose details[open]::details-content { height: auto; }
}

@media print {
  .topbar, .side, .foot, .pager, .anim-ctrl, .stage-tabs, .skip, .print-row, .watch, .flash { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  .shell { display: block; padding: 0; }
  .stage { background: none; padding: 0; }
  .prose details { break-inside: avoid; }
  .prose summary::after { display: none; }
}

