/* Reader shell: three documents, independent places, compact persistent controls. */
@media screen {
:root{--paper:#faf7f0;--ink:#203b55;--line:#cdd2cd;background:#e9ebe8}
.reader-header{display:block;padding:0 24px;background:var(--paper);border-bottom:1px solid var(--line)}
.reader-topline{max-width:1080px;margin:auto;display:flex;align-items:center;gap:22px;min-height:52px}
.reader-identity{display:flex;align-items:baseline;gap:18px;min-width:0}
.book-title{font:italic 25px/1.2 'JITA Serif',Georgia,serif;color:var(--ink);text-decoration:none;white-space:nowrap}
#document-title{font:400 17px/1.2 'JITA Serif',Georgia,serif;margin:0;min-width:0}
#document-title-link{color:var(--ink);text-decoration:underline;text-decoration-color:#aab3ba;text-decoration-thickness:1px;text-underline-offset:3px}
.book-title:hover,.kit-home:hover,#document-title-link:hover{text-decoration:underline;text-underline-offset:4px;text-decoration-color:currentColor}
.kit-home{font-size:13px;color:var(--ink);text-decoration:none;min-height:44px;display:flex;align-items:center;margin-left:auto;white-space:nowrap}
.kit-name-short,.kit-name-tiny{display:none}
.reader-tools{display:flex;align-items:center;gap:7px}
.reader-options{z-index:5}
.reader-options summary,#download-document{min-height:36px;border:1px solid #bfc9cc;border-radius:4px;background:#fffdf8;padding:7px 11px;font-size:13px;font-weight:500;box-shadow:0 1px 1px #203b5507}
.reader-options summary{gap:6px}
.reader-options[open] summary,.reader-options summary:hover,#download-document:hover{background:#e9eee9;border-color:#84959d}
.reader-tools svg,.page-controls svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
#download-document{text-decoration:none;display:flex;align-items:center;gap:6px}
.document-switch{display:flex;max-width:770px;width:100%;margin:auto;gap:4px;align-items:stretch}
.document-switch button{flex:1;min-width:0;width:auto;min-height:40px;line-height:1.2;font-family:'JITA Serif',Georgia,serif;font-size:18px;font-weight:400;padding:7px 12px;border:1px solid transparent!important;border-radius:4px 4px 0 0!important;background:transparent;position:relative;transition:background-color .12s,color .12s}
.document-switch button:hover{background:#edf0eb}
.document-switch button[aria-selected=true]{background:var(--ink);color:var(--paper)}
.document-switch button:focus-visible{outline-offset:-4px;outline-color:#c58b46}
.place-note{display:flex;align-items:center;justify-content:center;gap:5px;font-size:11px;line-height:1.3;color:#5b686c;text-align:center;margin:0;min-height:24px}
#dismiss-place-note{display:inline-flex;align-items:center;justify-content:center;min-height:24px;width:24px;padding:4px;border:0;background:transparent;border-radius:3px;color:#617079}
#dismiss-place-note:hover{background:#e3e8e4;color:var(--ink)}
#dismiss-place-note svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round}
#return-to-discussion{display:flex;align-items:center;justify-content:center;min-height:32px;margin:0 auto 3px;font-size:12px;color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.reader-controls{padding:4px 20px max(4px,env(safe-area-inset-bottom));box-shadow:none;display:flex;flex-direction:row;gap:0}
.page-controls{max-width:none;width:auto;gap:16px}
.page-controls>button{min-height:36px;font-size:13px;font-weight:400;display:flex;align-items:center;gap:7px;border:1px solid #c6cfcc;border-radius:4px;background:#fffdf8;padding:6px 12px}
.page-controls>button:hover:not(:disabled){background:#e9eee9;border-color:#84959d}
.page-jump{font-size:12px;gap:8px}
#page-number{min-height:34px;width:58px;padding:5px 7px;font-size:13px;font-weight:500;background:#fffdf8;border-color:#bfc9cc;border-radius:4px}
#page-total{font-size:12px;min-width:0}
.options-panel{width:300px;padding:18px;gap:8px;background:#fffdf8;top:calc(100% + 5px)}
.options-panel select{margin-bottom:0}
.options-panel .view-help{font-size:13px;line-height:1.45;margin:2px 0 10px;color:#4b5a63}
.reader-checkbox{font-size:13px!important;font-weight:400!important;margin:0}
.options-panel #page-fit-control{display:grid;gap:8px;margin-bottom:6px}
#page-number,.reader-header select{appearance:none;-webkit-appearance:none;padding-right:28px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23203b55' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;background-size:12px 12px}
a:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
html.reader-reflow #reading-area .source-root a{overflow-wrap:anywhere}
html.reader-reflow #reading-area .source-root .kit-home-link a{white-space:normal!important}
html.reader-reflow #reading-area .kit-document{padding:20px 20px 24px}
html.reader-reflow #reading-area .sheet{max-width:800px;box-shadow:0 1px 5px #182a3315}
}
@media screen and (min-width:900px){
html.reader-reflow #reading-area .sheet .source-root .source-body .page{padding-inline:70px!important}
html.reader-reflow #reading-area .sheet .source-root{--reader-page-padding:70px}
}
@media screen and (max-width:850px){
.reader-identity{display:block;padding-block:5px}
#document-title{font-size:14px;line-height:1.2;margin-top:1px}
.reader-topline{gap:14px}
}
@media screen and (max-width:600px){
.reader-header{padding:0 max(10px,env(safe-area-inset-left)) 0 max(10px,env(safe-area-inset-right))}
.kit-name-wide{display:none}.kit-name-short{display:inline}
.reader-topline{min-height:55px;gap:8px;flex-wrap:nowrap}
.reader-topline .book-title{font-size:22px}
#document-title{font-size:12px;max-width:155px}
.kit-home{font-size:11px;margin-left:auto;white-space:normal}
.reader-tools{gap:5px;margin-left:0}
.reader-options summary,#download-document{font-size:12px;min-height:40px;padding-inline:7px}
.document-switch{gap:3px}
.document-switch button{font-size:15px;min-height:44px;padding:6px 5px}
.reader-controls{padding-inline:8px}
.page-controls{width:100%;justify-content:center;gap:14px}
.page-controls .direction-label{display:none}
.page-controls>button{min-width:44px;min-height:40px;justify-content:center;padding-inline:10px}
html.reader-reflow #reading-area .kit-document{padding:10px 8px 14px}
}
@media screen and (max-width:380px){
.reader-topline{gap:6px}
.kit-name-short{display:none}.kit-name-tiny{display:inline}
.reader-topline .book-title{font-size:20px}
#document-title{font-size:11px;max-width:132px}
.reader-tools{gap:4px}
.reader-options summary,#download-document{padding-inline:6px;font-size:12px}
.document-switch button{font-size:14px;padding-inline:4px}
}
/* Native print only: faint block fills, optional with browser Background graphics.
   The existing first-page art policy is retained separately. */
@media print {
  #reading-area :focus {outline:none!important}
  #reading-area .sheet .source-root[data-jita-document],
  #reading-area .sheet .source-root[data-jita-document] *,
  #reading-area .sheet .source-root[data-jita-document] *::before,
  #reading-area .sheet .source-root[data-jita-document] *::after {
    -webkit-print-color-adjust:economy!important;print-color-adjust:economy!important;
  }
  #reading-area .sheet .source-root[data-jita-document] :is(.fg-content-note-card,.fg-spoiler,.phase.reading,.context-box,.open-rings .care-item:last-child,.open-ep .note,.card-page-footer,.route,.invitation,.bdg-opening .decoration[style*="linear-gradient"]) {
    background:#fbfaf7!important;
  }
  #reading-area .sheet .source-root[data-jita-document] :is(.extension,.fg-quiet-note,.fg-closing,.fg-proof--redirects .closing,.route.book) {
    background:#f8fbfc!important;
  }
  #reading-area .sheet .source-root[data-jita-document="k1-fg"] .fg-proof--program .program-option:first-child {
    --program-paper:#fbfaf7;--program-heading-paper:#f8f6f0;
  }
  #reading-area .sheet .source-root[data-jita-document="k1-fg"] .fg-proof--program .program-option:nth-child(2) {
    --program-paper:#f8fbfc;--program-heading-paper:#f4f8fa;
  }
  #reading-area .sheet .source-root[data-jita-document="k1-bdg"] .bdg-opening img.art[aria-hidden="true"],
  #reading-area .sheet .source-root[data-jita-document="k1-fg"] .fg-proof--opening .fg-sidebar,
  #reading-area .sheet .source-root[data-jita-document="k1-ep"] .open-ep img.source-rail[aria-hidden="true"] {
    -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;
  }
}
