/* =====================================================================
   The Book of Trades (js/discovery/discovery-book.js)
   A field book from Lamplight Crossing: an oxblood board with brass
   corners, paper pages with a spine shadow, brass thumb tabs for the
   parts, cloth tabs for a chapter's sections. Stencil for titles (the
   Crossing's lettering), Alegreya for reading, Plex Mono for addresses.
   Numbered steps and marginal notes are rust, the book's only red.
   ===================================================================== */
.bk {
    --board: #2b1d14; --board-hi: #3b281b; --board-lo: #1a110b;
    --paper: #ebe3cf; --paper-lo: #ddd2b8; --paper-edge: #cfc2a3;
    --ink: #231a13; --ink-2: #4f4132; --ink-3: #75634f;
    --rubric: #9c3b22; --brass: #d9a441; --brass-lo: #9d7328; --brass-ink: #3a2a10;
    --rule: rgba(35, 26, 19, .16); --mark: rgba(217, 164, 65, .32);
    --pad-x: 44px; --pad-y: 30px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: 100%; height: 100%;
    padding: 12px 10px 10px 14px;
    background:
        radial-gradient(120% 90% at 30% 20%, rgba(255, 220, 170, .06), transparent 60%),
        repeating-linear-gradient(115deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 5px),
        var(--board);
    border-radius: 7px 12px 12px 7px;
    box-shadow: inset 0 0 0 1px rgba(255, 220, 170, .08), inset 0 0 40px rgba(0, 0, 0, .5), 0 22px 60px rgba(8, 5, 3, .7);
    color: var(--ink);
    font-family: 'Alegreya', Georgia, 'Times New Roman', serif;
    font-size: calc(16.5px * var(--dq-text, 1));
    line-height: 1.58;
    text-align: left;
}
/* Brass corner caps on the board. */
.bk::before, .bk::after {
    content: ''; position: absolute; width: 26px; height: 26px; pointer-events: none;
    background: linear-gradient(135deg, #f0cf83, var(--brass) 45%, var(--brass-lo));
    box-shadow: inset 0 0 0 1px rgba(58, 42, 16, .5);
}
.bk::before { top: 0; right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); border-top-right-radius: 12px; }
.bk::after { bottom: 0; right: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-right-radius: 12px; }
.bk.is-single { border-radius: 4px; padding: 8px 8px 8px 10px; }
.bk.is-single::before, .bk.is-single::after { width: 18px; height: 18px; }
.bk * { box-sizing: border-box; }
.bk :where(button, input, a) { font: inherit; color: inherit; }
.bk :focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.bk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bk-ico { width: 18px; height: 18px; flex: none; }

/* â”€â”€ Head band: stamped title, search, Speak, Close â”€â”€ */
.bk-head { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 12px; padding: 2px 16px 10px 6px; min-height: 46px; }
.bk .bk-title {
    flex: none; background: none; border: 0; padding: 4px 2px; cursor: pointer; color: var(--brass);
    font-family: 'Big Shoulders Stencil Display', 'Sora', sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .03em; line-height: 1;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 -1px 0 rgba(255, 230, 170, .12);
}
.bk .bk-title:hover { color: #f0cf83; }
.bk-search { position: relative; flex: 1 1 auto; max-width: 420px; margin-left: auto; display: flex; align-items: center; }
.bk-search-ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--brass-lo); pointer-events: none; }
.bk .bk-search-input {
    width: 100%; min-height: 36px; padding: 6px 12px 6px 34px; border-radius: 3px;
    border: 1px solid rgba(217, 164, 65, .35); background: rgba(10, 6, 3, .45); color: #efe6d2 !important;
    font-family: 'Sora', system-ui, sans-serif !important; font-size: 14px !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
}
.bk .bk-search-input::placeholder { color: rgba(239, 230, 210, .5); }
.bk .bk-search-input:focus { outline: none; border-color: var(--brass); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), 0 0 0 3px rgba(217, 164, 65, .22); }
.bk-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 6; max-height: min(420px, 60vh); overflow: auto;
    background: var(--paper); border: 1px solid var(--paper-edge); border-radius: 3px; box-shadow: 0 16px 40px rgba(8, 5, 3, .6); padding: 6px;
}
.bk .bk-result-item { display: grid; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-radius: 2px; padding: 8px 10px; cursor: pointer; }
.bk .bk-result-item:hover, .bk .bk-result-item.is-active { background: var(--mark); }
.bk-ri-title { font-weight: 700; color: var(--ink); }
.bk-ri-where { font-family: 'Sora', sans-serif; font-size: 12px; color: var(--ink-3); }
.bk-ri-snip { font-size: 14px; color: var(--ink-2); font-style: italic; }
.bk-noresult { margin: 8px 10px; color: var(--ink-2); }
.bk .bk-speak, .bk .bk-close {
    flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 13px; cursor: pointer;
    border-radius: 3px; font-family: 'Sora', system-ui, sans-serif; font-size: 13.5px; font-weight: 600;
}
.bk .bk-speak { background: linear-gradient(#e7bf66, var(--brass) 55%, #b98a33); border: 1px solid var(--brass-lo); color: var(--brass-ink); box-shadow: 0 1px 0 rgba(255, 240, 200, .35) inset, 0 2px 6px rgba(0, 0, 0, .4); }
.bk .bk-speak:hover { filter: brightness(1.06); }
.bk .bk-speak.is-on { background: #efe6d2; border-color: var(--paper-edge); color: var(--rubric); }
.bk .bk-speak .bk-ico { width: 17px; height: 17px; }
.bk .bk-close { background: rgba(10, 6, 3, .35); border: 1px solid rgba(239, 230, 210, .18); color: #d3c8b1; }
.bk .bk-close:hover { background: rgba(10, 6, 3, .6); color: #efe6d2; }
.bk .bk-close .bk-ico { width: 15px; height: 15px; }

/* â”€â”€ Section tabs: cloth tabs on the pages' top edge â”€â”€ */
.bk-tabs { grid-column: 1; grid-row: 2; display: flex; gap: 3px; padding: 0 22px; overflow-x: auto; scrollbar-width: none; min-height: 0; }
.bk-tabs::-webkit-scrollbar { display: none; }
.bk-tabs[hidden] { display: none; }
.bk .bk-tab {
    flex: none; position: relative; top: 1px; padding: 6px 13px 5px; cursor: pointer; white-space: nowrap;
    background: #cfc2a3; border: 1px solid rgba(35, 26, 19, .25); border-bottom: 0; border-radius: 4px 4px 0 0;
    font-family: 'Sora', system-ui, sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.bk .bk-tab:hover { background: #ddd2b8; color: var(--ink); }
.bk .bk-tab.is-active { background: var(--paper); color: var(--rubric); z-index: 1; }

/* â”€â”€ Thumb index on the fore-edge â”€â”€ */
.bk-thumbs { grid-column: 2; grid-row: 3; display: flex; flex-direction: column; gap: 3px; padding: 14px 0 14px 0; width: 42px; margin-left: -2px; overflow-y: auto; scrollbar-width: none; }
.bk-thumbs::-webkit-scrollbar { display: none; }
.bk .bk-thumb {
    flex: 1 0 auto; min-height: 30px; padding: 9px 0; cursor: pointer; border: 0;
    background: linear-gradient(90deg, #b98a33, var(--brass) 40%, #e7bf66);
    border-radius: 0 5px 5px 0; box-shadow: inset 1px 0 0 rgba(58, 42, 16, .35), 2px 1px 3px rgba(0, 0, 0, .45);
    color: var(--brass-ink); font-family: 'Big Shoulders Stencil Display', 'Sora', sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
    writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
}
.bk .bk-thumb:hover { filter: brightness(1.08); }
.bk .bk-thumb.is-active { background: var(--paper); color: var(--rubric); box-shadow: inset -1px 0 0 var(--paper-edge), 2px 1px 3px rgba(0, 0, 0, .45); }

/* â”€â”€ Pages â”€â”€ */
.bk-body {
    grid-column: 1; grid-row: 3; position: relative; min-height: 0; min-width: 0;
    padding: var(--pad-y) var(--pad-x) 20px;
    background:
        linear-gradient(90deg, rgba(35, 26, 19, 0) calc(50% - 46px), rgba(35, 26, 19, .07) calc(50% - 14px), rgba(35, 26, 19, .22) 50%, rgba(35, 26, 19, .07) calc(50% + 14px), rgba(35, 26, 19, 0) calc(50% + 46px)),
        radial-gradient(140% 100% at 50% 50%, rgba(255, 255, 255, .18), transparent 70%),
        var(--paper);
    border-radius: 3px 5px 5px 3px;
    box-shadow: 0 0 0 1px var(--paper-edge), 2px 0 0 #d8ccb0, 4px 1px 0 #cdbf9f, 6px 2px 0 #c2b390, 0 6px 14px rgba(0, 0, 0, .35);
}
/* Paper fibres: two fine noise layers, drawn once. */
.bk-body::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .5; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .47 0 0 0 0 .36 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bk.is-onepage .bk-body { background: radial-gradient(140% 100% at 50% 50%, rgba(255, 255, 255, .18), transparent 70%), linear-gradient(90deg, rgba(35, 26, 19, .16), rgba(35, 26, 19, 0) 26px), var(--paper); }
.bk.is-single .bk-body { --pad-x: 24px; --pad-y: 20px; }
.bk-view { position: relative; width: 100%; height: 100%; overflow: hidden; }
.bk-flow {
    position: relative; height: 100%; overflow: hidden; column-fill: auto;
    orphans: 3; widows: 3; hyphens: auto; -webkit-hyphens: auto;
}
.bk.is-loading .bk-flow { opacity: 0; }

/* The turning leaf: plain paper that swings round the spine while the spread changes under it. */
.bk-leaf { position: absolute; top: var(--pad-y); bottom: 20px; left: 50%; width: calc(50% - 6px); pointer-events: none; opacity: 0; transform-origin: 0 50%; }
.bk-leaf.is-turning { opacity: 1; animation: bk-turn-next .42s cubic-bezier(.45, .05, .35, 1) forwards; background: linear-gradient(90deg, rgba(35, 26, 19, .18), var(--paper) 18%, var(--paper-lo)); box-shadow: -8px 0 24px rgba(0, 0, 0, .18); }
.bk-leaf.is-turning.to-prev { left: 6px; transform-origin: 100% 50%; animation-name: bk-turn-prev; background: linear-gradient(270deg, rgba(35, 26, 19, .18), var(--paper) 18%, var(--paper-lo)); }
.bk-leaf.is-turning.is-one { left: 6px; width: calc(100% - 12px); }
@keyframes bk-turn-next { 0% { transform: perspective(1800px) rotateY(0); } 100% { transform: perspective(1800px) rotateY(-178deg); opacity: .15; } }
@keyframes bk-turn-prev { 0% { transform: perspective(1800px) rotateY(0); } 100% { transform: perspective(1800px) rotateY(178deg); opacity: .15; } }

/* â”€â”€ Typography on the page â”€â”€ */
.bk-flow > * { margin: 0 0 .75em; }
.bk-opener { break-inside: avoid; margin-bottom: 1.4em; }
.bk-kicker { margin: 0 0 6px; font-family: 'Sora', system-ui, sans-serif; font-size: 12.5px; font-weight: 600; color: var(--rubric); letter-spacing: .01em; }
.bk-chtitle {
    display: flex; align-items: center; gap: 12px; margin: 0 0 10px; color: var(--ink);
    font-family: 'Big Shoulders Stencil Display', 'Sora', sans-serif; font-weight: 700; font-size: clamp(34px, 3.4vw, 46px); line-height: .95; letter-spacing: .01em;
}
.bk-chglyph { width: 34px; height: 34px; flex: none; color: var(--rubric); stroke-width: 1.6; }
.bk-tagline { margin: 0 0 14px; font-size: 1.12em; font-style: italic; color: var(--ink-2); line-height: 1.45; }
.bk-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 14px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: .92em; }
.bk-facts dt { font-family: 'Sora', system-ui, sans-serif; font-size: 12px; font-weight: 600; color: var(--ink-3); padding-top: .2em; }
.bk-facts dd { margin: 0; color: var(--ink); }
.bk-url { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12.5px; color: var(--rubric); text-decoration: none; word-break: break-all; }
.bk-url:hover { text-decoration: underline; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.bk .bk-btn {
    display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 3px; cursor: pointer; text-decoration: none;
    font-family: 'Sora', system-ui, sans-serif; font-size: 13px; font-weight: 600;
    background: transparent; border: 1px solid rgba(35, 26, 19, .35); color: var(--ink);
}
.bk .bk-btn:hover { background: rgba(35, 26, 19, .07); }
.bk .bk-btn.is-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: inset 3px 0 0 var(--rubric); }
.bk .bk-btn.is-primary:hover { background: #3a2b1f; }
.bk-film { margin: 0 0 12px; break-inside: avoid; }
.bk-film video { display: block; width: 100%; max-height: 220px; background: #120d0a; border-radius: 2px; box-shadow: 0 0 0 1px var(--paper-edge); }
.bk-film figcaption { margin-top: 5px; font-size: .86em; font-style: italic; color: var(--ink-3); }

.bk-sec {
    margin: 1.2em 0 .6em; padding-top: .5em; border-top: 2px solid var(--ink); break-after: avoid;
    font-family: 'Big Shoulders Stencil Display', 'Sora', sans-serif; font-weight: 700; font-size: 26px; line-height: 1.05; letter-spacing: .01em; color: var(--ink);
}
.bk-h { margin: 1em 0 .35em; font-size: 1.1em; font-weight: 700; line-height: 1.25; color: var(--ink); break-after: avoid; }
.bk-p { text-wrap: pretty; }
.bk-flow b, .bk-flow strong { font-weight: 700; }
.bk-flow code, .bk-flow kbd { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .82em; padding: 0 .3em; background: rgba(35, 26, 19, .08); border-radius: 2px; }
.bk-flow a:not(.bk-btn):not(.bk-url) { color: var(--rubric); }
.bk-list { padding-left: 1.2em; }
.bk-list > li { margin: 0 0 .3em; }
.bk-list > li::marker { color: var(--rubric); }
.bk-steps { list-style: none; counter-reset: step; padding: 0; }
.bk-steps > li { counter-increment: step; position: relative; padding: 0 0 0 2.1em; margin: 0 0 .55em; break-inside: avoid; }
.bk-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: -.02em; width: 1.5em; text-align: right;
    font-family: 'Big Shoulders Stencil Display', 'Sora', sans-serif; font-weight: 700; font-size: 1.25em; line-height: 1.2; color: var(--rubric);
}
.bk-before { break-inside: avoid; padding: 10px 14px; border: 1px dashed rgba(35, 26, 19, .35); border-radius: 2px; }
.bk-before-title { margin: 0 0 4px; font-family: 'Sora', system-ui, sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.bk-before ul { margin: 0; padding-left: 1.1em; }
.bk-result { break-inside: avoid; padding-left: 12px; border-left: 3px solid #6f8a58; }
.bk-result-mark { font-weight: 700; color: #4d6a3a; }
.bk-note { break-inside: avoid; margin: .2em 0 .85em; padding: 2px 0 2px 12px; border-left: 2px solid var(--brass-lo); font-style: italic; color: var(--ink-2); }
.bk-note-mark { font-style: normal; font-weight: 700; color: var(--ink); margin-right: .15em; }
.bk-note.is-warn { border-left-color: var(--rubric); }
.bk-note.is-warn .bk-note-mark { color: var(--rubric); }
.bk-table-wrap { break-inside: avoid; overflow-x: auto; }
.bk-table { width: 100%; border-collapse: collapse; font-size: .9em; line-height: 1.4; }
.bk-table th { text-align: left; font-family: 'Sora', system-ui, sans-serif; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1.5px solid var(--ink); padding: 4px 8px 4px 0; }
.bk-table td { border-bottom: 1px solid var(--rule); padding: 5px 8px 5px 0; vertical-align: top; }
.bk-terms { margin: 0 0 .9em; }
.bk-terms dt { font-weight: 700; break-after: avoid; }
.bk-terms dd { margin: 0 0 .5em 1em; color: var(--ink-2); }
.bk-terms.is-ui dt { display: inline-block; margin-top: .2em; padding: 0 .45em; font-family: 'Sora', system-ui, sans-serif; font-size: .8em; font-weight: 600; border: 1px solid rgba(35, 26, 19, .35); border-radius: 3px; background: rgba(255, 255, 255, .3); }
.bk-faq details { break-inside: avoid; border-bottom: 1px solid var(--rule); padding: 5px 0; }
.bk-faq summary { cursor: pointer; font-weight: 700; list-style: none; padding-left: 1.1em; position: relative; }
.bk-faq summary::-webkit-details-marker { display: none; }
.bk-faq summary::before { content: '+'; position: absolute; left: 0; color: var(--rubric); font-weight: 700; }
.bk-faq details[open] summary::before { content: '\2212'; }
.bk-faq-a { padding: 4px 0 4px 1.1em; color: var(--ink-2); }
.bk-pre { break-inside: avoid; overflow-x: auto; padding: 10px 12px; background: #231a13; color: #efe6d2; border-radius: 2px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bk-pre code { background: none; padding: 0; font-size: inherit; }

/* Contents */
.bk-part { margin: 1.1em 0 .35em; font-family: 'Sora', system-ui, sans-serif; font-size: 12.5px; font-weight: 600; color: var(--rubric); break-after: avoid; }
.bk-toc { list-style: none; margin: 0 0 .4em; padding: 0; }
.bk .bk-toc-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 4px; background: none; border: 0; border-bottom: 1px dotted rgba(35, 26, 19, .3); cursor: pointer; text-align: left; font-size: 1.02em; }
.bk .bk-toc-item:hover { background: rgba(35, 26, 19, .05); }
.bk-toc-n { width: 1.6em; text-align: right; font-family: 'Big Shoulders Stencil Display', 'Sora', sans-serif; font-weight: 700; color: var(--ink-3); }
.bk .bk-toc-item .bk-ico { color: var(--rubric); width: 17px; height: 17px; }
.bk-toc-name { flex: 1; }
.bk-toc-done { display: inline-flex; color: #4d6a3a; }
.bk-toc-done .bk-ico { color: #4d6a3a; }
.bk-howto { margin-top: 1em; font-style: italic; color: var(--ink-2); }

/* Reading aloud and arriving from search */
.bk-flow .is-reading { background: var(--mark); box-shadow: 0 0 0 3px var(--mark); border-radius: 1px; }
.bk-flash { animation: bk-flash 1.6s ease-out; }
@keyframes bk-flash { 0%, 30% { background: var(--mark); box-shadow: 0 0 0 4px var(--mark); } 100% { background: transparent; box-shadow: 0 0 0 4px transparent; } }

/* â”€â”€ Folio and turning â”€â”€ */
.bk-foot { grid-column: 1; grid-row: 4; display: flex; align-items: center; gap: 10px; padding: 8px 4px 0; }
.bk-folio { flex: 1; margin: 0; text-align: center; font-family: 'Sora', system-ui, sans-serif; font-size: 12.5px; color: #b3a58a; }
.bk .bk-turn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; cursor: pointer;
    background: rgba(10, 6, 3, .35); border: 1px solid rgba(239, 230, 210, .16); border-radius: 3px; color: #d3c8b1;
    font-family: 'Sora', system-ui, sans-serif; font-size: 13px; font-weight: 600;
}
.bk .bk-turn:hover:not(:disabled) { background: rgba(10, 6, 3, .6); color: #efe6d2; }
.bk .bk-turn:disabled { opacity: .35; cursor: default; }
.bk .bk-turn .bk-ico { width: 15px; height: 15px; }

/* â”€â”€ Narrow frames: one page, compact head â”€â”€ */
.bk.is-single .bk-head { flex-wrap: wrap; gap: 8px; padding: 0 6px 8px 2px; min-height: 0; }
.bk.is-single .bk-title { font-size: 17px; }
.bk.is-single .bk-search { order: 5; flex-basis: 100%; max-width: none; }
.bk.is-single .bk-speak { margin-left: auto; }
.bk.is-single .bk-tabs { padding: 0 8px; }
.bk.is-single .bk-chtitle { font-size: 32px; }
.bk.is-single .bk-turn span { display: none; }
.bk.is-single .bk-folio { font-size: 12px; }
@container stage (max-width: 700px) {
    .bk { padding: 8px 6px 8px 8px; }
    .bk-head { flex-wrap: wrap; gap: 8px; padding: 0 4px 8px 2px; }
    .bk-search { order: 5; flex-basis: 100%; max-width: none; }
    .bk .bk-speak { margin-left: auto; }
    .bk-speak-label, .bk-close-label { display: none; }
    .bk-thumbs { width: 32px; }
    .bk .bk-thumb { font-size: 11px; }
    .bk-body { --pad-x: 20px; --pad-y: 18px; }
    .bk .bk-turn span { display: none; }
}
@media (pointer: coarse) {
    .bk .bk-turn, .bk .bk-speak, .bk .bk-close, .bk .bk-btn, .bk .bk-search-input { min-height: 44px; }
    .bk .bk-tab { padding: 10px 14px 9px; }
    .bk .bk-toc-item { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .bk-leaf.is-turning { animation: none; opacity: 0; }
    .bk-flash { animation: none; }
}

/* The book over the game: a panel sheet with no chrome of its own. */
.dq-panel.dq-book-sheet {
    position: absolute; inset: 14px; z-index: 2; width: auto; max-width: none; max-height: none; margin: 0 auto;
    padding: 0; background: none; border: 0; box-shadow: none; display: flex; justify-content: center; pointer-events: auto;
}
.dq-panel.dq-book-sheet > .dq-panel-body { width: min(1240px, 100%); height: 100%; max-height: none; padding: 0; overflow: visible; }
@container stage (max-width: 700px) { .dq-panel.dq-book-sheet { inset: 6px; } }

/* While the book is open over the game, the game's own chrome steps back (it would peek out around the board). */
.dq:has(> .dq-book-sheet) > :is(.dq-hud, .dq-bar, .dq-mini, .dq-prompt, .dq-pad) { visibility: hidden; }
/* Narrow frames: the bar's Book button makes room for the others (the page header has its own Book button). */
@container stage (max-width: 639px) { .dq-bar .dq-btn[aria-keyshortcuts="B"] { display: none; } }
/* Settings > Motion > Reduce motion in the game (discovery-app.js sets html.dq-still) */
html.dq-still .bk-leaf.is-turning { animation: none; opacity: 0; }
html.dq-still .bk-flash { animation: none; }
