html { scroll-padding-top: 84px; }
body { position: relative; isolation: isolate; }
.wrap { max-width: 1320px; padding-inline: 40px; }
.paper-warm-light { animation: none; opacity: .5; }
.paper-grain { opacity: .018; }
.top { z-index: 30; background: color-mix(in oklab, var(--color-bg) 94%, transparent); }
.top::before { height: 1px; opacity: .65; }
.manual-header-links { display: flex; align-items: center; gap: var(--space-5); }
.top .back { min-height: 44px; margin: 0; padding: 0; }
.layout { grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); padding-top: var(--space-7); }
main { max-width: 800px; }
.toc { top: 92px; padding-right: var(--space-4); max-height: calc(100dvh - 120px); }
.toc h2 { margin-top: var(--space-5); font-size: var(--text-sm); letter-spacing: 0; }
.toc-search { margin-bottom: var(--space-4); }
.toc-search input { height: 42px; background: #fffdfa; font-size: var(--text-md); }
.toc li a { padding-block: 8px; }
.toc li.sub a { padding-block: 6px; font-size: var(--text-sm); }
.toc li a.is-on { color: var(--color-link); background: linear-gradient(90deg, var(--color-selected), transparent); }
.search-results { max-height: 65vh; gap: var(--space-2); }
.sr-item { padding: 10px; background: #fffdfa; }
.sr-title { font-weight: 500; }
.sr-snip { font-size: var(--text-sm); }
.manual-intro h1 { margin-bottom: var(--space-4); font-size: 40px; font-weight: 600; }
.manual-intro .lead { font-size: var(--text-lg); line-height: 1.7; }
.meta-line { margin-bottom: var(--space-6); font-family: var(--font-editorial); gap: 8px 20px; }
section.ch { margin-top: var(--space-8); padding-top: var(--space-7); scroll-margin-top: 16px; }
section.ch::before { content: none; }
.manual-intro + section.ch { border: 0; padding-top: var(--space-4); margin-top: 0; }
section.ch > h2 { font-weight: 500; margin-bottom: var(--space-5); }
section.ch h3 { margin-top: var(--space-7); margin-bottom: var(--space-4); font-size: var(--text-xl); font-weight: 500; scroll-margin-top: 16px; }
section.ch h4 { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-base); font-weight: 600; scroll-margin-top: 16px; }
section.ch p, section.ch li { line-height: 1.85; }
section.ch ul { padding-left: 1.4em; }
section.ch li { padding-left: 2px; margin-bottom: 8px; }
section.ch li::marker { color: var(--color-link); }
.note { background: color-mix(in oklab, var(--color-selected) 38%, var(--color-bg)); }
.fig { margin: var(--space-5) 0 var(--space-6); }
.fig-frame { padding: 8px; background: #fffdfa; box-shadow: 0 2px 6px #29313d08; transition: border-color 180ms ease; }
.fig-frame:hover { transform: none; box-shadow: 0 2px 6px #29313d08; border-color: var(--color-control); }
.fig figcaption { text-align: left; font-size: var(--text-sm); padding-left: 10px; border-left: 2px solid var(--color-line-strong); }
.fig--tall figcaption, .fig--small figcaption { text-align: center; padding-left: 0; border-left: 0; }
.fig-pair { margin-block: var(--space-5) var(--space-6); }
.btn-shine { min-height: 44px; box-shadow: inset 0 1px 0 #ffffff55; transition: background-color 180ms ease; }
.btn-shine::before, .btn-shine::after { content: none; }
.btn-shine:hover { transform: none; box-shadow: inset 0 1px 0 #ffffff55; }
.dl-cta { margin-top: var(--space-8); padding: var(--space-7) 0 0; border: 0; border-top: 1px solid var(--color-line-strong); border-radius: 0; background: none; text-align: left; scroll-margin-top: 16px; }
.dl-cta::after { content: none; }
.dl-cta h2 { font-weight: 500; }
.dl-cta .dl-sub { margin-bottom: var(--space-5); }
.dl-cta .actions { justify-content: flex-start; }
.dl-cta .manual-bloom { position: absolute; top: 8px; right: 4px; z-index: 0; width: 220px; height: auto; opacity: .34; pointer-events: none; user-select: none; }
.manual-bloom-stem, .manual-bloom-calyx { fill: none; stroke: #7e9078; stroke-width: 1.2; stroke-linecap: round; }
.manual-bloom-petal { opacity: 0; transform-origin: 0 0; transform: rotate(calc(var(--petal-angle) * .035)) scale(calc(var(--petal-size) * .055), calc(var(--petal-size) * .25)); transition: transform 2800ms cubic-bezier(.22, .61, .36, 1) var(--petal-delay), opacity 600ms ease var(--petal-delay); }
.manual-bloom-petal use { fill: url(#manual-petal-wash); stroke: #899caf; stroke-width: .7; stroke-opacity: .4; }
.manual-bloom-petal.is-inner use { fill-opacity: .88; }
.manual-bloom-bud { opacity: 1; transition: opacity 1600ms ease 400ms; }
.manual-bud-petal { fill: #9bacc4; stroke: #7a91ae; stroke-width: .8; }
.manual-bud-shell { fill: #b1bfd3; stroke: #8096b3; stroke-width: .85; }
.manual-bud-fold { fill: none; stroke: #7b8fa8; stroke-width: .65; stroke-linecap: round; }
.manual-bud-calyx { fill: #8ba080; stroke: #708867; stroke-width: .75; }
.manual-bloom-stamens { fill: #bba57e; stroke: #bba57e; stroke-width: 1; opacity: 0; transform-origin: 0 0; transform: scaleY(.5); transition: opacity 1200ms ease 1600ms, transform 1200ms ease 1600ms; }
.manual-bloom.is-bloomed .manual-bloom-petal { opacity: 1; transform: rotate(var(--petal-angle)) scale(var(--petal-size)); }
.manual-bloom.is-bloomed .manual-bloom-bud { opacity: 0; }
.manual-bloom.is-bloomed .manual-bloom-stamens { opacity: .65; transform: scaleY(1); }
@media (max-width: 640px) {
  .dl-cta { padding-bottom: 128px; }
  .dl-cta .manual-bloom { top: auto; bottom: 0; right: 8px; width: 160px; opacity: .3; }
}
.to-top { right: 16px; bottom: 18px; box-shadow: var(--shadow-xs); }
.manual-tools { display: none; }
.manual-nav-dialog { width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 64px); padding: 20px; border: 1px solid var(--color-line-strong); border-radius: 12px; color: var(--color-text); background: var(--color-bg); }
.manual-nav-dialog::backdrop { background: #29313d80; backdrop-filter: blur(3px); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.drawer-head h2 { margin: 0; font-size: var(--text-lg); font-weight: 500; }
.drawer-head button { min-height: 44px; padding: 4px 10px; border: 1px solid var(--color-line-strong); border-radius: 6px; background: transparent; color: var(--color-text); font: inherit; }
.manual-nav-dialog .toc { display: block; position: static; max-height: none; padding: 0; border: 0; overflow: visible; }
.manual-nav-dialog .search-results { max-height: none; }
.lightbox { position: fixed; inset: 0; width: min(1280px, calc(100vw - 48px)); height: fit-content; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid var(--color-line-strong); border-radius: 12px; color: var(--color-text); background: var(--color-bg); overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; align-items: stretch; }
.lightbox::backdrop { background: #222b35b3; backdrop-filter: blur(6px); }
.lightbox-head, .lightbox-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; }
.lightbox-head { border-bottom: 1px solid var(--color-line); }
.lightbox-head h2 { margin: 0; font-size: var(--text-base); font-weight: 500; }
.lightbox-stage { min-height: 0; overflow: auto; display: grid; place-items: center; background: white; }
.lightbox img { display: block; max-width: 100%; max-height: calc(100dvh - 178px); width: auto; height: auto; border-radius: 0; box-shadow: none; object-fit: contain; }
.lightbox-controls { border-top: 1px solid var(--color-line); }
.lightbox-cap { position: static; transform: none; margin: 0; color: var(--color-muted); font-size: var(--text-sm); text-align: left; }
.lightbox-pagination { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.lightbox-count { color: var(--color-muted); font: 12px/1 var(--font-mono); }
.lightbox button { min-height: 40px; padding: 4px 10px; background: transparent; border: 1px solid var(--color-line-strong); border-radius: 6px; color: var(--color-text); font: 13px/1.5 var(--font-editorial); cursor: pointer; }
.lightbox button:disabled { opacity: .35; cursor: default; }
.lightbox button:not(:disabled):hover { background: var(--color-surface-2); }
.lightbox .lightbox-close { position: static; display: block; width: auto; height: auto; flex-shrink: 0; }
body.manual-image-open, body.manual-nav-open { overflow: hidden; }
@media (max-width: 1100px) {
  .wrap { padding-inline: 28px; }
  .layout { gap: 36px; grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 880px) {
  html { scroll-padding-top: 128px; }
  .wrap { padding-inline: 24px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-6); }
  main { max-width: none; }
  .layout > .toc { display: none; }
  .manual-tools { position: sticky; top: 60px; z-index: 25; display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 0 24px; background: var(--color-bg); border-bottom: 1px solid var(--color-line); }
  .manual-tools button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; flex-shrink: 0; border: 0; background: transparent; color: var(--color-link); font: 14px/1.5 var(--font-editorial); }
  .manual-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
  .manual-tools > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-sm); color: var(--color-muted); }
  .manual-nav-dialog .toc ol { display: block; border-left: 1px solid var(--color-line); }
  .manual-nav-dialog .toc li a { padding: 8px 0 8px 16px; border-left: 2px solid transparent !important; }
  .manual-nav-dialog .toc li.sub { display: list-item; }
  .manual-nav-dialog .toc li.sub a { padding-left: 28px; }
  .manual-nav-dialog .toc li a.is-on { border-left-color: var(--color-link) !important; text-decoration: none; }
}
@media (max-width: 560px) {
  .manual-header-links { gap: 16px; }
  .manual-intro h1 { font-size: var(--text-3xl); }
  .manual-intro .lead { font-size: var(--text-base); }
  .fig-frame { padding: 5px; }
  .dl-cta h2 { font-size: var(--text-xl); }
  .dl-cta .actions { flex-direction: row; align-items: center; }
  .dl-cta .btn { width: auto; }
  .lightbox { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); }
  .lightbox-head, .lightbox-controls { padding: 8px; gap: 8px; }
  .lightbox-controls { flex-direction: column; align-items: stretch; }
  .lightbox-pagination { justify-content: center; }
  .lightbox img { max-height: calc(100dvh - 220px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
