:root{color-scheme:dark;font:400 16px/1.5 Arial,sans-serif;color:#eef0f5;background:#0b0c10}*{box-sizing:border-box}body{margin:0}.reader{min-height:100dvh;display:flex;flex-direction:column;background:#0b0c10}.reader-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 24px;min-height:64px}.reader-header h1{font-size:16px;font-weight:400;margin:0;letter-spacing:-.3px}.quiet-button{font:inherit;font-size:14px;color:#c7ccd6;text-decoration:none;background:#171a21;border:1px solid #2e333e;border-radius:4px;min-height:44px;padding:9px 14px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.reader-stage{height:calc(100dvh - 164px);min-height:180px;display:flex;align-items:center;justify-content:center;padding:0 24px;position:relative;touch-action:pan-y pinch-zoom}.reader-stage img{max-width:100%;width:100%;height:100%;object-fit:contain;display:block;user-select:none;-webkit-user-drag:none}.reader-stage[aria-busy=true] img{opacity:.65}.reader-controls{display:flex;justify-content:center;align-items:center;gap:22px;padding:14px 20px 0;flex-wrap:wrap}.page-button{font:inherit;font-size:15px;background:#202530;border:1px solid #343b48;color:#eef1f7;border-radius:4px;min-width:100px;min-height:44px;padding:10px 16px;cursor:pointer}.page-button:disabled{opacity:.3;cursor:default}.page-picker{font-size:14px;color:#b6bece;display:flex;align-items:center;gap:9px}.page-picker select{font:inherit;font-size:16px;background:#181d27;border:1px solid #343b48;color:#eef1f7;padding:8px;min-height:44px;border-radius:4px}.reader-hint{font-size:13px;color:#929dae;margin:8px 20px 12px;text-align:center}.page-error{position:absolute;background:#151922;border:1px solid #343b48;padding:20px;text-align:center;border-radius:5px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}button:focus-visible,a:focus-visible,select:focus-visible{outline:2px solid #b9c7e9;outline-offset:4px}[hidden]{display:none!important}.reader:fullscreen{height:100dvh}.reader:fullscreen .reader-stage{flex:1;height:auto}@media(max-width:550px){.reader-header{padding:10px 12px;gap:8px;flex-wrap:wrap}.reader-header h1{font-size:15px}.quiet-button{font-size:13px;padding:8px 10px;min-height:44px}.reader-stage{padding:0 6px;height:calc(100dvh - 176px)}.reader-controls{padding:12px 10px 0;gap:12px}.page-button{min-width:86px;font-size:14px;padding:9px 12px}.page-picker{gap:6px}.reader-hint{font-size:12px}}@media(max-width:360px){.reader-controls{gap:8px}.page-button{min-width:73px;padding:8px}.reader-header h1{order:3;width:100%;text-align:center}.reader-stage{height:calc(100dvh - 201px)}}
.spread-hint{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);z-index:4;max-width:calc(100% - 24px);margin:0;padding:8px 12px;border-radius:99px;background:rgba(20,17,15,.9);color:#f3ede4;font:600 13px/1.35 Arial,sans-serif;text-align:center;pointer-events:none}
.reader.leaf-mode .reader-stage{width:min(100% - 12px,calc((100dvh - 150px) * var(--leaf-ratio,.62)));aspect-ratio:var(--leaf-ratio,.62);height:auto;flex:0 0 auto;margin:8px auto;padding:0}
.reader.leaf-mode .reader-stage img{width:100%;height:100%;max-width:none;object-fit:cover;object-position:left center}
.reader.leaf-mode .reader-stage[data-leaf="right"] img{object-position:right center}
@media(max-width:500px) and (orientation:portrait){
  #reader[data-spread="full"]{height:auto;min-height:100dvh}
  #reader[data-spread="full"] .reader-stage{height:auto;flex:0 0 auto;min-height:0;width:auto;aspect-ratio:auto;margin:0;padding:0 6px}
  #reader[data-spread="full"] .reader-stage img{width:100%;height:auto;max-width:100%;object-fit:contain;object-position:center center}
  #reader[data-spread="full"] #page-text{position:static;width:auto;height:auto;max-width:100%;margin:4px 16px 32px;overflow:visible;clip:auto;white-space:pre-wrap;font:400 16px/1.5 Arial,sans-serif;color:#eef0f5}
}
.reader.chrome-off .reader-header,.reader.chrome-off .reader-controls,.reader.chrome-off .reader-progress{visibility:hidden}
.reader{background:#14110f;color:#f3ede4;font-family:"DM Sans",Arial,sans-serif}
.reader-header{display:flex;align-items:center;gap:12px;min-height:56px;height:auto;padding:8px 16px;position:sticky;top:0;z-index:5;background:rgba(20,17,15,.92);backdrop-filter:blur(8px);border-bottom:1px solid #2a2420;flex-wrap:nowrap}
.reader-id{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}
.reader-back{min-width:44px;min-height:44px;padding:0 12px}
.reader-header h1,.fred-reader .reader-header h1,.cave-reader .reader-header h1,.ancient-technology-reader .reader-header h1{order:0;width:auto;flex:1 1 auto;flex-basis:auto;min-width:0;margin:0;text-align:left;text-wrap:balance;overflow-wrap:normal;word-break:normal;font-family:Fraunces,Georgia,serif;font-weight:600;font-size:clamp(16px,2vw,22px);line-height:1.15;color:#f3ede4}
.page-label{font:500 14px/1 "DM Sans",Arial,sans-serif;color:#a99d8f;background:transparent;border:0;min-height:44px;padding:8px 10px;white-space:nowrap}
.reader-tools{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.reader-controls{gap:16px;padding:10px 16px 14px}
.page-button{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:99px;border:1px solid #4a4038;background:transparent;color:#f3ede4;font-size:22px}
.page-button:hover{border-color:#a99d8f}
.page-button:active{background:#211b17}
.page-button:disabled{opacity:.4}
.reader-progress{flex:1;height:2px;background:#2a2420;border-radius:99px;overflow:hidden}
.reader-progress span{display:block;height:100%;width:0;background:#ffcf4a}
.page-sheet{position:fixed;inset:0;z-index:40;background:rgba(20,17,15,.72);display:flex;align-items:flex-end;justify-content:center}
.page-sheet-grid{width:min(520px,100%);max-height:70dvh;overflow:auto;background:#211b17;border-radius:18px 18px 0 0;padding:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:8px}
.page-sheet-grid button{min-width:44px;min-height:44px;border-radius:10px;border:1px solid #4a4038;background:transparent;color:#f3ede4}
.page-sheet-grid button[aria-current="true"]{border-color:#ffcf4a;color:#ffcf4a}
.page-select-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
@media(max-width:500px){
  .reader-header{flex-wrap:wrap;padding:8px 14px}
  .reader-id{flex:1 1 100%}
  .reader-header h1{font-size:18px}
  .reader-tools{margin-left:auto}
}
@media(max-width:360px){
  .reader-header h1{order:0;width:auto;text-align:left}
  .page-button{min-width:44px;width:44px;padding:0}
}
button:focus-visible,a:focus-visible,select:focus-visible{outline:2px solid #ffcf4a;outline-offset:3px}
.site-nav{display:flex;flex-wrap:wrap;gap:16px;align-items:center;padding:0 12px;background:#14110f}
.site-nav a{color:#f3ede4;text-decoration:none;font-size:15px;min-height:44px;display:inline-flex;align-items:center}
.site-nav a[aria-current="page"]{color:#ffcf4a}
