.hb-launch{position:sticky;top:8px;z-index:20;display:flex;justify-content:flex-end;margin:0 0 8px;pointer-events:none}.hb-launch button{pointer-events:auto;background:#192a2a;color:#f5ddb0;border:1px solid #c5a56e;box-shadow:0 3px 12px #0007;font-weight:700}#handbook{width:min(900px,calc(100% - 24px));max-width:100%;max-height:min(88dvh,850px);margin:auto;padding:0;border:1px solid #b69966;border-radius:12px;background:#182523;color:#f3e8cc;overflow:hidden;box-shadow:0 12px 80px #000a}#handbook::backdrop{background:#03080ce0}#handbook[open]{display:flex;flex-direction:column}.hb-cover{background:linear-gradient(125deg,#20302e,#111917);border-bottom:1px solid #b69966;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.hb-cover p{margin:0;color:#d6b67e;font-size:.7rem;letter-spacing:.12em}.hb-cover h2{font:700 clamp(1.2rem,3vw,1.8rem) Georgia,serif;margin:2px 0}.hb-controls{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px;background:#24342e}.hb-controls select{min-width:0;flex:1 1 180px;background:#101d1c;color:#f5e9cd;border:1px solid #b69966;padding:9px;border-radius:6px;font:inherit;min-height:44px}.hb-controls button,.hb-cover button{background:#182623;color:#f5e9cd;border-color:#b69966}.hb-paper{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;background:linear-gradient(90deg,#d6c3a0,#f2e7cf 7%,#eee1c6 94%,#c7b28d);padding:clamp(15px,4vw,35px);color:#332e25;color-scheme:light;font-family:Georgia,serif}.hb-paper h2{font-size:clamp(1.5rem,4vw,2.4rem);color:#423522}.hb-paper h3{font-size:1.16rem;margin:19px 0 5px}.hb-paper p{margin-bottom:12px}.hb-lead{font-size:1.15rem;line-height:1.5}.hb-art{display:block;width:100%;max-height:230px;object-fit:cover;border:1px solid #9e8259;border-radius:3px}.hb-diagram{margin:15px 0;padding:8px;border:1px solid #a38b65;background:#efe2c4}.hb-diagram svg{width:100%;max-height:240px;display:block}.hb-diagram figcaption{font-size:.78rem;color:#51483a}.hb-paper input[type=search]{display:block;width:100%;margin:8px 0 15px;padding:10px;font:inherit;border:1px solid #8b7958;background:#fff7e5;color:#332e25}.hb-paper dt{font-weight:bold;margin-top:13px}.hb-paper dd{margin:0 0 10px}.hb-paper fieldset{min-width:0;border:1px solid #a38b65;margin:10px 0 15px;padding:10px}.hb-option{display:flex;align-items:center;gap:8px;min-height:44px}.hb-option input{flex:none;accent-color:#39584b}.hb-paper button{background:#39584b;color:#fff5db;border-color:#39584b}.hb-paper a{color:#365749}.hb-feedback{border-left:3px solid #39584b;padding-left:8px}.hb-page-number{color:#665335;font:700 .75rem system-ui;letter-spacing:.1em}.hb-paper :focus-visible{outline:3px solid #39584b;outline-offset:2px}@media(max-width:480px){.hb-cover{padding:8px 10px}.hb-controls{padding:6px;gap:4px}.hb-controls button{padding:6px 10px}.hb-paper{padding:14px}#handbook{max-height:92dvh;width:calc(100% - 12px)}}@media(max-height:480px){#handbook{max-height:96dvh}.hb-cover p{display:none}.hb-controls{padding:4px 8px}.hb-paper{padding:10px 16px}}
/* A definite viewport-sized dialog prevents intrinsic flex height collapse in iOS WebKit. */
#handbook[open]{position:fixed;inset:0;margin:auto;height:88vh;height:min(88dvh,850px);max-height:calc(100% - 24px);display:grid;grid-template-rows:auto auto minmax(0,1fr);box-sizing:border-box}
.hb-cover,.hb-controls{min-width:0;flex-shrink:0}.hb-paper{height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;box-sizing:border-box}.hb-cover>div{min-width:0}.hb-cover button{flex:none}.hb-paper h2,.hb-paper p,.hb-paper dd{overflow-wrap:anywhere}
@media(max-width:600px){#handbook[open]{width:calc(100% - 12px);height:92vh;height:92dvh;max-height:calc(100% - 12px);grid-template-rows:auto auto minmax(0,1fr)}.hb-controls{display:grid;grid-template-columns:minmax(0,1fr) auto auto}.hb-controls select{width:100%;min-width:0;font-size:16px}.hb-controls #hb-context:not([hidden]){grid-column:1/-1;min-height:44px}.hb-cover h2{font-size:clamp(1.1rem,5vw,1.55rem)}.hb-cover p{font-size:.64rem}.hb-paper{padding-bottom:max(24px,env(safe-area-inset-bottom))}}
@media(max-height:480px){#handbook[open]{height:94vh;height:94dvh;max-height:calc(100% - 8px)}.hb-cover{padding:5px 10px}.hb-cover h2{font-size:1.15rem}.hb-controls{padding:4px 8px}.hb-controls #hb-context:not([hidden]){grid-column:auto}}
