/* Shared presentation for the static manuals. No external fonts or services. */
:root {
  color-scheme: light;
  --ink: #24332d;
  --muted: #637269;
  --green: #326c28;
  --line: #dfe7de;
  --soft: #f3f7ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f4f6f2;
  font-size: 16px;
  line-height: 1.75;
}
* { box-sizing: border-box; }
body.manual-page { margin: 0 auto; }
a { color: var(--green); text-underline-offset: 4px; }
a:hover { color: #204b1a; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 3px solid #609c48;
  outline-offset: 4px;
}
h1, h2, h3, h4 { color: #1f3427; line-height: 1.3; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); letter-spacing: -.035em; }
h2 { font-size: 1.45rem; letter-spacing: -.02em; }
h3 { font-size: 1.15rem; }
img { max-width: 100%; height: auto; }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 88px; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 1.1rem; font-weight: 700; text-decoration: none; }
.brand img { width: 34px; height: 34px; flex-shrink: 0; }
.header-link { font-size: .9rem; text-decoration: none; white-space: nowrap; }
.manual-home, .manual-index { width: min(1160px, calc(100% - 64px)); }
.eyebrow { color: var(--green); font-size: .75rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.hero { padding: 68px 0 36px; max-width: 760px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin: 12px 0 20px; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0; }
.editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-bottom: 64px; }
.edition-card { display: flex; flex-direction: column; align-items: flex-start; padding: 32px; background: white; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.edition-card:hover { border-color: #8caf7f; box-shadow: 0 8px 24px #203b1710; }
.edition-card h2 { margin: 18px 0 12px; font-size: 1.8rem; }
.edition-card p { color: var(--muted); margin: 0 0 28px; }
.edition-card .card-action { margin-top: auto; font-weight: 650; color: var(--green); }
.badge { display: inline-block; border: 1px solid #d4e4c8; background: var(--soft); color: var(--green); border-radius: 6px; padding: 2px 9px; font-size: .72rem; font-weight: 700; letter-spacing: .07em; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: .8rem; color: var(--muted); }
.manual-index { width: min(1320px, calc(100% - 48px)); }
.manual-index .site-header { min-height: 72px; padding: 8px 0; }
.manual-index .site-footer { padding: 10px 0; }
.manual-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.manual-heading h1 { margin: 0; font-size: 1.4rem; }
.manual-heading p { color: var(--muted); margin: 2px 0 0; font-size: .8rem; line-height: 1.4; }
.manual-layout { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.4fr); gap: 20px; align-items: start; padding: 12px 0; }
.chapters, .search-panel { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.chapters h2, .search-panel h2 { margin: 0 0 8px; font-size: 1rem; }
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-list li { border-bottom: 1px solid #edf1e9; }
.chapter-list a { display: block; padding: 2px 8px; margin: 0 -8px; font-size: .875rem; line-height: 1.35; text-decoration: none; border-radius: 5px; }
.chapter-list a:hover { background: var(--soft); }
.chapter-list .chapter-label { display: block; padding: 2px 0; font-size: .875rem; line-height: 1.35; color: var(--muted); }
.search-panel { position: sticky; top: 16px; }
.search-panel label { display: block; font-size: .85rem; font-weight: 650; margin-bottom: 8px; }
.search-controls { display: flex; gap: 10px; }
#search { min-width: 0; width: 100%; border: 1px solid #b7c7b3; background: #fff; color: var(--ink); border-radius: 7px; padding: 11px 12px; font: inherit; font-size: .95rem; }
#submit { flex-shrink: 0; border: 1px solid var(--green); background: var(--green); color: white; border-radius: 7px; padding: 11px 18px; font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; }
#submit:hover { background: #24531e; }
.search-hint { color: var(--muted); font-size: .8rem; margin: 8px 0 14px; }
.search-results-label { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: .8rem; font-weight: 650; }
#searchResults { list-style: none; padding: 0 4px; margin: 8px -4px 0; font-size: .875rem; height: clamp(160px, calc(100dvh - 430px), 480px); overflow: hidden; }
#searchResults li { border-bottom: 1px solid #edf1e9; }
#searchResults a { display: block; padding: 8px 0; text-decoration: none; overflow-wrap: anywhere; }
#searchResults:empty::after { content: "Enter a keyword to find a topic in this manual."; display: block; color: var(--muted); font-size: .85rem; padding: 12px 0 20px; }
#page { list-style: none; display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 0; }
#page:empty { margin: 0; }
#page button { min-height: 34px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--green); font: inherit; font-size: .85rem; cursor: pointer; }
#page button:hover:not(:disabled) { background: var(--soft); }
#page button:disabled { color: #7a837c; background: #f6f7f4; cursor: default; }
.pagination-status { display: inline-block; min-width: 52px; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--muted); }
/* Reading pages keep their original content, links, tables and image paths. */
body.manual-article { width: min(1080px, calc(100% - 64px)); padding: 40px 56px 64px; margin: 32px auto; background: white; border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.manual-article p { margin: 1em 0; }
.manual-article li { margin: .35em 0; }
.manual-article > h1 { margin: 36px 0 24px; }
.manual-article > h2 { margin: 40px 0 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.manual-article > h3 { margin: 28px 0 14px; }
.manual-article table { overflow-wrap: break-word; word-break: normal; max-width: 100%; border-collapse: collapse; border-color: var(--line); font-size: .94rem; }
.manual-article td, .manual-article th { padding: 10px 14px; border-color: var(--line); }
.manual-article td p { margin: .5em 0; }
.manual-article th { background: var(--soft); text-align: left; }
.manual-article > table:first-of-type { position: sticky; top: 0; z-index: 10; width: 100%; margin-bottom: 32px; border: 0; border-bottom: 1px solid var(--line); background: white; box-shadow: 0 1px 0 var(--line); }
.manual-article :is(h1, h2, h3, h4, [id], a[name]) { scroll-margin-top: 100px; }
.manual-article > table:first-of-type td { padding: 0 0 20px; border: 0; background: white; text-align: left; }
.manual-article > table:first-of-type td + td { text-align: right; }
.manual-article > table:first-of-type h1 { font-size: 1.05rem; letter-spacing: -.01em; margin: 0; color: var(--green); }
.manual-home-link { text-decoration: none; }
.manual-home-link:hover { text-decoration: underline; }
.manual-article > table:first-of-type h3 { font-size: .9rem; margin: 0; }
.manual-article > table:first-of-type p { font-size: .75rem; color: var(--muted); margin: 0 0 3px; }
.manual-article blockquote { margin: 24px 0; padding: 8px 24px; border-left: 3px solid #92b77a; background: var(--soft); }
.manual-article pre { overflow-x: auto; padding: 16px; background: var(--soft); border-radius: 6px; }
.manual-contents > table:not(:first-of-type) { width: 100%; }
.manual-contents > table:not(:first-of-type) td { width: auto; }
/* Let search results use the actual remaining height, without a fixed cap. */
@media screen and (min-width: 761px) {
  body.manual-index { height: 100dvh; display: flex; flex-direction: column; }
  .manual-index .site-header, .manual-index .site-footer { flex-shrink: 0; }
  .manual-index .site-footer { line-height: 20px; padding: 6px 0; }
  .manual-index > main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .manual-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .chapters { align-self: start; max-height: 100%; display: flex; flex-direction: column; }
  .chapter-list { min-height: 0; overflow-y: auto; padding: 0 8px; margin: 0 -8px; }
  .search-panel { position: static; display: flex; flex-direction: column; min-height: 0; }
  .search-panel > :not(#searchResults), .chapters h2 { flex-shrink: 0; }
  #searchResults { flex: 1; min-height: 0; height: auto; }
}
@media screen and (min-width: 761px) and (max-height: 740px) {
  .chapter-list a, .chapter-list .chapter-label { padding-top: 1px; padding-bottom: 1px; }
}
@media (max-width: 760px) {
  .manual-home, .manual-index { width: calc(100% - 32px); }
  .site-header { min-height: 72px; }
  .hero { padding: 40px 0 28px; }
  .editions, .manual-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .edition-card { padding: 22px; }
  .chapters, .search-panel { padding: 16px; }
  .chapter-list a, .chapter-list .chapter-label { padding-top: 10px; padding-bottom: 10px; }
  .search-panel { position: static; grid-row: 1; }
  body.manual-article { width: 100%; margin: 0; padding: 24px 20px 48px; border: 0; border-radius: 0; }
  .manual-article > table:not(:first-of-type) { display: block; overflow-x: auto; }
  .manual-article td, .manual-article th { padding: 8px; }
  .manual-contents > table:not(:first-of-type) { display: table; }
}
@media print {
  :root { background: white; color: black; font-size: 11pt; }
  body.manual-article { width: 100%; margin: 0; border: 0; padding: 0; }
  .manual-article > table:first-of-type { position: static; box-shadow: none; }
  .manual-article > table:not(:first-of-type) { display: table; }
  .search-panel, .site-footer { display: none; }
  .manual-article > h2 { break-after: avoid; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .manual-index .site-header { flex-wrap: wrap; gap: 8px; }
  .manual-heading h1 { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .edition-card { transition: none; }
}
