/* The keeper's field journal as a 3D book (journal-book.mjs): the dialog pinned onto the open pages.
   The book itself draws the paper; the dialog keeps its layout, loses its painted spread, and is
   placed by a perspective transform. */
.modal.frame.in-book{position:fixed!important;left:0!important;top:0!important;margin:0!important;transform-origin:0 0!important;
 background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;max-height:none!important;max-width:none!important;aspect-ratio:auto!important;
 overflow:visible;transition:opacity .22s ease;backface-visibility:hidden}
.modal.frame.in-book.book-hidden,.modal.frame.book-pending{opacity:0;pointer-events:none}
.modal.frame.book-pending{background-image:none}   /* (the flat journal's painted spread is only for a dialog the book will not take: not fetched while the book loads) */
.modal-backdrop:has(.in-book){background:radial-gradient(ellipse 60% 55% at 50% 48%,rgba(12,9,6,.28),rgba(8,6,4,.62))}

/* the ribbons: section tabs at their tails, below the book */
.journal-ribbon{position:fixed;z-index:2;transform:translate(-50%,-30%);width:clamp(30px,2.2vw,72px);height:clamp(48px,4.4vh,120px);padding:0;
 background:transparent;border:0;cursor:pointer}
.journal-ribbon span{position:absolute;left:50%;top:100%;transform:translate(-50%,6px);white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .2s,transform .2s;
 padding:.25em .65em .3em;font:italic clamp(12px,.78vw,30px)/1 Georgia,serif;color:#f4ead2;background:rgba(18,14,10,.86);border:1px solid rgba(232,193,122,.45);border-radius:2px}
.journal-ribbon:hover span,.journal-ribbon:focus-visible span{opacity:1;transform:translate(-50%,10px)}
.journal-ribbon.current span{color:#e8c17a}
.journal-ribbon:focus-visible{outline:2px solid #ffe0a0;outline-offset:2px;border-radius:2px}
.journal-ribbon:disabled{cursor:default}
@media (prefers-reduced-motion:reduce){.modal.frame.in-book{transition:none}}

/* ---- the spread: every record lays out on its two pages (left page, the fold, right page). The book sets
   --book-w / --book-h (the spread's CSS size); margins keep clear of the fold, the painted corners and the clasp.
   The left page carries what a record is (title, portrait, contents); the right page its particulars. ---- */
body .modal.frame.in-book[data-document]{
 --bw:var(--book-w,1188px);--bh:var(--book-h,792px);
 --outer:calc(var(--bw)*.068);--fold:calc(var(--bw)*.034);--g:calc(var(--bw)*.014);
 --ink:#3a3123;--ink-strong:#2b2315;--ink-soft:#6d5e41;--rule:rgba(70,56,34,.26);--wash:rgba(120,96,60,.1);--oxblood:#5e382c;
 box-sizing:border-box!important;padding:calc(var(--bh)*.088) var(--outer) calc(var(--bh)*.085)!important;
 display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;column-gap:calc(var(--fold)*2)!important;row-gap:calc(var(--bh)*.022)!important;
 grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"title side" "body body" "foot foot";
 align-items:start;overflow:hidden!important;color:var(--ink);text-align:left;
 background:none!important;background-image:none!important;
}
body .modal.frame.in-book[data-document]::before,body .modal.frame.in-book[data-document]::after{display:none!important}
body .modal.frame.in-book[data-document]>.keeper-document-label{display:none!important}
body .modal.frame.in-book[data-document]>h2{grid-area:title;align-self:end;justify-self:stretch;width:auto!important;max-width:none!important;margin:0!important;padding:0 0 .28em!important;border:0!important;border-bottom:1px solid var(--rule)!important;
 font:italic 400 clamp(20px,calc(var(--bw)*.025),54px)/1.15 Georgia,"Palatino Linotype",serif!important;letter-spacing:0!important;color:var(--ink-strong)!important;-webkit-text-fill-color:currentColor!important;background:none!important;text-shadow:none!important}
body .modal.frame.in-book[data-document]>.modal-close{position:absolute!important;top:calc(var(--bh)*.024)!important;right:calc(var(--bw)*.024)!important;left:auto!important;width:calc(var(--bw)*.03)!important;height:calc(var(--bw)*.03)!important;min-width:26px;min-height:26px;padding:0!important;display:grid!important;place-items:center;
 background:#392e20!important;color:#eedcba!important;border:0!important;border-radius:50%!important;box-shadow:0 2px 4px rgba(40,26,10,.35)!important;z-index:2}
body .modal.frame.in-book[data-document]>.modal-close svg{width:46%;height:46%}
/* the footer: back on the left page, onward on the right */
body .modal.frame.in-book[data-document]>.modal-footer{grid-area:foot;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:calc(var(--fold)*2);align-items:center;margin:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
body .modal.frame.in-book[data-document]>.modal-footer>*{grid-column:2;grid-row:1;justify-self:start;margin:0!important;transform:none!important}
body .modal.frame.in-book[data-document]>.modal-footer>:first-child{grid-column:1;justify-self:start}
body .modal.frame.in-book[data-document]>.modal-footer>:last-child:not(:first-child){grid-column:2;justify-self:end}
/* a record without a plan of its own flows down the left page and on to the right */
body .modal.frame.in-book[data-document]>.company-record-body{grid-area:body;align-self:stretch;min-height:0;height:100%;overflow:hidden!important;display:block!important;
 columns:2;column-gap:calc(var(--fold)*2);column-fill:auto;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document]>.company-record-body>*{break-inside:avoid}
body .modal.frame.in-book[data-document]>.company-record-body>:first-child{margin-top:0}
body .modal.frame.in-book[data-document]>.company-record-body :is(h3,h4){break-after:avoid}
body .modal.frame.in-book[data-document] :is(.company-record-body,.card-list,.growth-record-organs,.settings-page,.review-page){scrollbar-width:thin;scrollbar-color:rgba(70,56,34,.4) transparent}

/* ---- ink: everything on the paper is written in ink, whatever palette its dark panel used ---- */
body .modal.frame.in-book[data-document] *{text-shadow:none!important}
body .modal.frame.in-book[data-document] :is(h3,h4,h5,dt,th,legend,strong,b):not(button[aria-pressed="true"] *,button.primary *){color:var(--ink-strong)!important;-webkit-text-fill-color:currentColor}
body .modal.frame.in-book[data-document] :is(p,li,dd,td,span,label,em,i,figcaption,summary,div,time,output,blockquote):not(button,button *,.modal-close *){color:var(--ink)!important;-webkit-text-fill-color:currentColor}
body .modal.frame.in-book[data-document] :is(small,.muted,.tiny,.help-chapter,.eyebrow,.standings-page-count,.deck-page-count,.review-page-count):not(button *){color:var(--ink-soft)!important}
body .modal.frame.in-book[data-document] :is(h3,h4){font-family:Georgia,"Palatino Linotype",serif!important;font-weight:400!important;font-style:italic}
body .modal.frame.in-book[data-document] a{color:var(--oxblood)!important}
/* pressed paper controls */
body .modal.frame.in-book[data-document] button:not(.modal-close,.unlock-pack,.anatomy-region,.anatomy-label,.card-row){background:var(--wash)!important;color:var(--ink-strong)!important;border:1px solid rgba(70,56,34,.34)!important;border-radius:2px!important;box-shadow:none!important;
 font-family:Georgia,"Palatino Linotype",serif!important;font-style:italic;font-variant:normal!important;letter-spacing:.01em!important;text-transform:none!important}
body .modal.frame.in-book[data-document] button:not(.modal-close,.unlock-pack,.anatomy-region,.anatomy-label,.card-row):hover:not(:disabled){background:rgba(120,96,60,.2)!important;border-color:rgba(70,56,34,.55)!important}
body .modal.frame.in-book[data-document] button:disabled{opacity:.42;cursor:default}
body .modal.frame.in-book[data-document] button.primary{background:var(--oxblood)!important;color:#f7e7c5!important;border-color:#3a2018!important;font-style:normal}
body .modal.frame.in-book[data-document] button.primary:hover:not(:disabled){background:#70432f!important}
body .modal.frame.in-book[data-document] :is(select,input[type="text"],input[type="number"],input:not([type])){background:rgba(255,250,236,.55)!important;color:var(--ink)!important;border:1px solid rgba(70,56,34,.4)!important;border-radius:2px!important;box-shadow:none!important;font-family:Georgia,serif}
body .modal.frame.in-book[data-document] option{color:#2b2315;background:#f4ead2}
body .modal.frame.in-book[data-document] input[type="checkbox"]{appearance:auto!important;-webkit-appearance:checkbox!important;width:1.15em;height:1.15em;background:none!important;border:0!important;box-shadow:none!important;accent-color:var(--oxblood)}
body .modal.frame.in-book[data-document] input[type="range"]{accent-color:var(--oxblood);background:none!important;border:0!important;box-shadow:none!important}

/* ---- the contents: section tabs read as a list down the left page ---- */
body .modal.frame.in-book[data-document] :is(.settings-pages,.collection-tabs,.pet-inspector-tabs){display:flex!important;flex-direction:column;align-items:stretch;gap:0;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document] :is(.settings-pages,.collection-tabs,.pet-inspector-tabs)>button{flex:none!important;display:flex!important;align-items:baseline;gap:.6em;justify-content:flex-start;text-align:left;width:100%;min-height:0!important;
 padding:.42em .15em!important;background:none!important;border:0!important;border-bottom:1px solid var(--rule)!important;border-radius:0!important;color:var(--ink)!important;font-size:clamp(13px,calc(var(--bw)*.0135),28px)!important;font-style:italic;font-weight:400!important}
body .modal.frame.in-book[data-document] :is(.settings-pages,.collection-tabs,.pet-inspector-tabs)>button::before{content:"";flex:none;width:.42em;height:.42em;transform:rotate(45deg) translateY(-.1em);border:1px solid currentColor;opacity:.45}
body .modal.frame.in-book[data-document] :is(.settings-pages,.collection-tabs,.pet-inspector-tabs)>button:hover:not(:disabled){background:var(--wash)!important}
body .modal.frame.in-book[data-document] :is(.settings-pages,.collection-tabs,.pet-inspector-tabs)>button[aria-pressed="true"]{background:none!important;color:var(--oxblood)!important;border-bottom:1px solid var(--oxblood)!important;font-style:normal;font-weight:600!important}
body .modal.frame.in-book[data-document] :is(.settings-pages,.collection-tabs,.pet-inspector-tabs)>button[aria-pressed="true"]::before{background:currentColor;opacity:1}

/* ---- the field guide: the plate on the left page, the note on the right ---- */
body .modal.frame.in-book[data-document="help"]{grid-template-areas:"title note" "plate note" "foot foot"}
body .modal.frame.in-book[data-document="help"] :is(.company-record-body,.help-journal-spread){display:contents!important}
body .modal.frame.in-book[data-document="help"] .help-journal-spread>figure{grid-area:plate;align-self:center;margin:0!important;text-align:center}
body .modal.frame.in-book[data-document="help"] .help-journal-spread>section{grid-area:note;align-self:center;padding:0 .2em}
body .modal.frame.in-book[data-document="help"] .help-journal-spread .help-journal-art{height:calc(var(--bh)*.36)!important}
body .modal.frame.in-book[data-document="help"] .help-journal-spread p{font-size:clamp(14px,calc(var(--bw)*.0138),30px);line-height:1.62}
body .modal.frame.in-book[data-document="help"] .help-journal-spread h3{font-size:clamp(20px,calc(var(--bw)*.022),46px)}

/* ---- the duel record: the turns as a running head; each page of the record keeps to its own leaf ---- */
body .modal.frame.in-book[data-document="duel-review"]{grid-template-areas:"title turns" "page page" "foot foot"}
body .modal.frame.in-book[data-document="duel-review"]>.company-record-body{display:contents!important}
body .modal.frame.in-book[data-document="duel-review"] .review-turns{grid-area:turns;align-self:end;display:flex!important;justify-content:space-between;align-items:center;gap:.8em;margin:0!important;padding:0 0 .28em!important;border:0!important;border-bottom:1px solid var(--rule)!important;background:none!important}
body .modal.frame.in-book[data-document="duel-review"] .review-turns strong{font:italic 400 1.15em Georgia,serif}
body .modal.frame.in-book[data-document="duel-review"] .review-turns>*{transform:none!important;margin:0!important}
body .modal.frame.in-book[data-document="duel-review"] .review-page{grid-area:page;min-height:0;height:100%;overflow:hidden;display:block!important}
body .modal.frame.in-book[data-document="duel-review"] .review-page>:is(.review-summary,.review-action-page){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:0 calc(var(--fold)*2)!important;height:100%;align-items:center;margin:0!important;padding:0!important}
body .modal.frame.in-book[data-document="duel-review"] .review-page>.review-action-page>.history-beat{align-self:start;min-width:0}
body .modal.frame.in-book[data-document="duel-review"] .journal-move-art{height:calc(var(--bh)*.22)!important}
body .modal.frame.in-book[data-document="duel-review"] .company-record-body>.empty-state{grid-column:1;grid-row:2;width:auto!important;margin:0!important;align-self:start}

/* ---- the standings: the round and its notes on the left page, the table on the right ---- */
body .modal.frame.in-book[data-document="standings"]{grid-template-rows:auto auto auto minmax(0,1fr) auto;grid-template-areas:"title table" "round table" "note table" ". table" "foot foot"}
body .modal.frame.in-book[data-document="standings"]>.company-record-body{display:contents!important}
body .modal.frame.in-book[data-document="standings"] .standings-round{grid-area:round;margin:0!important;font:italic 400 clamp(15px,calc(var(--bw)*.0155),34px)/1.4 Georgia,serif}
body .modal.frame.in-book[data-document="standings"] .company-record-body>p.tiny{grid-area:note;margin:0!important;font-style:italic;line-height:1.5}
body .modal.frame.in-book[data-document="standings"] .standings-table{grid-area:table;width:100%!important;align-self:start;margin:0!important;border-collapse:collapse}
body .modal.frame.in-book[data-document="standings"] .standings-table :is(th,td){padding:.55em .4em!important;border:0!important;border-bottom:1px solid var(--rule)!important;background:none!important}
body .modal.frame.in-book[data-document="standings"] .standings-table th{font:600 .72em/1.2 Georgia,serif!important;letter-spacing:.14em;text-transform:uppercase}
body .modal.frame.in-book[data-document="standings"] .standings-table tr.you td{background:rgba(120,96,60,.12)!important}
body .modal.frame.in-book[data-document="standings"] .standings-table tr.you td:first-child{box-shadow:inset 2px 0 0 var(--oxblood)}

/* ---- notes that run on: the organs and experiments flow from the left page to the right ---- */
body .modal.frame.in-book[data-document="engine-notes"] section{margin:0 0 1em}
body .modal.frame.in-book[data-document="engine-notes"] .engine-challenges{display:grid!important;grid-template-columns:1fr!important;gap:.6em!important}
body .modal.frame.in-book[data-document="engine-notes"] .engine-challenges article{background:none!important;border:0!important;border-left:2px solid var(--rule)!important;border-radius:0!important;padding:.1em 0 .1em .8em!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="engine-notes"] .engine-challenges .catalyst-earned{display:block;margin-top:.35em;font-style:italic;font-size:.85em;opacity:.75}   /* (Catalyst earned this fight, on the cards that earn it) */
body .modal.frame.in-book[data-document="engine-notes"] p{line-height:1.5}
body .modal.frame.in-book[data-document="engine-notes"]{grid-template-areas:"title record" "now record" "foot foot"}
body .modal.frame.in-book[data-document="engine-notes"]>.company-record-body{display:contents!important}
body .modal.frame.in-book[data-document="engine-notes"] :is(.engine-now,.engine-record){min-height:0;max-height:100%;overflow:hidden auto;align-self:start}
body .modal.frame.in-book[data-document="engine-notes"] .engine-now{grid-area:now}
body .modal.frame.in-book[data-document="engine-notes"] .engine-record{grid-area:record}
body .modal.frame.in-book[data-document="engine-notes"] :is(.engine-now,.engine-record)>:first-child{margin-top:0}

/* ---- the builds: the creature on the left page, its organs on the right ---- */
body .modal.frame.in-book[data-document="growth-notes"]{grid-template-areas:"title organs" "creature organs" "foot foot"}
body .modal.frame.in-book[data-document="growth-notes"] :is(.company-record-body,.growth-record){display:contents!important}
body .modal.frame.in-book[data-document="growth-notes"] .growth-record-creature{grid-area:creature;align-self:center;justify-self:center;text-align:center;margin:0!important;background:none!important;border:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="growth-notes"] .growth-record-organs{grid-area:organs;align-self:start;margin:0!important;max-height:100%;overflow:hidden auto;width:100%!important;border:0!important;padding:0!important;background:none!important}
body .modal.frame.in-book[data-document="growth-notes"] .growth-record-organs>div{padding:.6em 0!important;border:0!important;border-bottom:1px solid var(--rule)!important;background:none!important}
body .modal.frame.in-book[data-document="growth-notes"] .growth-record-organs dt{font:italic 400 1.1em Georgia,serif!important;text-transform:capitalize;display:flex;justify-content:space-between;align-items:center}
body .modal.frame.in-book[data-document="growth-notes"] .growth-record-organs dt i{border-color:var(--ink-soft)!important}
body .modal.frame.in-book[data-document="growth-notes"] .growth-record-organs dt i.filled{background:var(--oxblood)!important;border-color:var(--oxblood)!important}

/* ---- the trainer deck: two cards to a page ---- */
body .modal.frame.in-book[data-document="deck"]{grid-template-areas:"title note" "cards cards" "foot foot"}
body .modal.frame.in-book[data-document="deck"] .trainer-deck-ledger{display:contents!important}
body .modal.frame.in-book[data-document="deck"] .deck-ledger-note{grid-area:note;align-self:end;display:flex!important;justify-content:space-between;align-items:baseline;gap:1em;margin:0!important;padding:0 0 .35em!important;border-bottom:1px solid var(--rule)}
body .modal.frame.in-book[data-document="deck"] .pet-deck-grid{grid-area:cards;display:grid!important;grid-template-columns:1fr 1fr calc(var(--fold)*2 - var(--g)*2) 1fr 1fr!important;column-gap:var(--g)!important;row-gap:var(--g)!important;align-content:start;margin:0!important;min-height:0}
body .modal.frame.in-book[data-document="deck"] .pet-deck-card:nth-child(4n+1){grid-column:1}
body .modal.frame.in-book[data-document="deck"] .pet-deck-card:nth-child(4n+2){grid-column:2}
body .modal.frame.in-book[data-document="deck"] .pet-deck-card:nth-child(4n+3){grid-column:4}
body .modal.frame.in-book[data-document="deck"] .pet-deck-card:nth-child(4n+4){grid-column:5}

/* ---- settings: the sections as a contents list, the chosen page on the right ---- */
body .modal.frame.in-book[data-document="settings"]{grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"title page" "index page" ". page"}
body .modal.frame.in-book[data-document="settings"] .settings-pages{grid-area:index}
body .modal.frame.in-book[data-document="settings"] .settings-page{grid-area:page;align-self:start;min-height:0;max-height:100%;overflow:auto;margin:0!important;padding:0!important}
body .modal.frame.in-book[data-document="settings"] .settings-page[hidden]{display:none!important}
body .modal.frame.in-book[data-document="settings"] .settings-row{display:flex!important;align-items:center;justify-content:space-between;gap:1em;padding:.8em 0!important;background:none!important;border:0!important;border-bottom:1px solid var(--rule)!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="settings"] .settings-row :is(label,strong){font-style:italic}
body .modal.frame.in-book[data-document="settings"] .settings-row input[type="range"]{width:42%;flex:none}

/* ---- the collection: contents and progress on the left page; the pack, or the catalog's plates, beside ---- */
body .modal.frame.in-book[data-document="unlocks"]{grid-template-rows:auto auto auto auto minmax(0,1fr) auto;grid-template-areas:none}
body .modal.frame.in-book[data-document="unlocks"]>h2{grid-area:auto;grid-column:1;grid-row:1}
body .modal.frame.in-book[data-document="unlocks"] :is(.profile-collection,.collection-catalog){display:contents!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-tabs{grid-column:1;grid-row:2}
body .modal.frame.in-book[data-document="unlocks"] .collection-progress{grid-column:1;grid-row:3;margin:0!important;padding:.6em 0!important;background:none!important;border:0!important;border-bottom:1px solid var(--rule)!important;border-radius:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-progress>div{display:flex;justify-content:space-between;gap:1em;margin-bottom:.5em}
body .modal.frame.in-book[data-document="unlocks"] .collection-progress progress{width:100%;appearance:none;height:.4rem;border:1px solid rgba(70,56,34,.45);background:rgba(120,96,60,.15);border-radius:0}
body .modal.frame.in-book[data-document="unlocks"] .collection-progress progress::-webkit-progress-bar{background:rgba(120,96,60,.15)}
body .modal.frame.in-book[data-document="unlocks"] .collection-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#8a6a2e,#c9a35a)}
body .modal.frame.in-book[data-document="unlocks"] .collection-guest{grid-column:1;grid-row:4;display:flex!important;align-items:center;justify-content:space-between;gap:1em;margin:0!important;padding:0!important;background:none!important;border:0!important;font-style:italic}
body .modal.frame.in-book[data-document="unlocks"] :is(.standard-booster-stage,.collection-complete){grid-column:2;grid-row:1/6;align-self:center;justify-self:center;margin:0!important;background:none!important;border:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="unlocks"] .standard-booster-stage{display:flex!important;flex-direction:column;align-items:center;gap:1.2em}
body .modal.frame.in-book[data-document="unlocks"] .booster-promise{text-align:center;background:none!important;border:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-ready{color:#6a4a1e!important}
body .modal.frame.in-book[data-document="unlocks"] .unlock-pack .pack-name{color:var(--ink-strong)!important}
body .modal.frame.in-book[data-document="unlocks"] .unlock-pack .pack-action{color:var(--ink-soft)!important;font-style:italic}
body .modal.frame.in-book[data-document="unlocks"] .unlock-pack.standard-booster{width:auto!important;flex:none!important;background:none!important;border:0!important;box-shadow:none!important;display:flex!important;flex-direction:column;align-items:center;gap:.35em;cursor:pointer}
body .modal.frame.in-book[data-document="unlocks"] .standard-booster .booster-wrapper{width:calc(var(--bh)*.2)!important;height:calc(var(--bh)*.34)!important;filter:drop-shadow(0 6px 10px rgba(40,26,10,.35))}
body .modal.frame.in-book[data-document="unlocks"] .standard-booster.ready:hover .booster-wrapper{transform:translateY(-3px) rotate(-1.5deg);transition:transform .25s}
body .modal.frame.in-book[data-document="unlocks"] .standard-booster .pack-name{font:italic 400 1.25em Georgia,serif!important}
body .modal.frame.in-book[data-document="unlocks"] .standard-booster.ready .pack-action{color:var(--oxblood)!important;font-style:normal;letter-spacing:.18em;text-transform:uppercase;font-size:.78em}
body .modal.frame.in-book[data-document="unlocks"] .collection-catalog-heading{grid-column:2;grid-row:1/3;align-self:end;margin:0!important;padding:0 0 .35em!important;border-bottom:1px solid var(--rule)}
body .modal.frame.in-book[data-document="unlocks"] .collection-catalog-heading{display:block!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-catalog-heading :is(h3,p){margin:0 0 .25em!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-catalog-heading h3 span{margin-left:.5em;font-style:normal;font-size:.75em;color:var(--ink-soft)!important}
body .modal.frame.in-book[data-document="unlocks"] .unlock-catalog-grid{grid-column:1/-1;grid-row:3/6;align-self:stretch;min-height:0;display:grid!important;grid-template-columns:1fr 1fr calc(var(--fold)*2 - var(--g)*2) 1fr 1fr!important;grid-template-rows:minmax(0,1fr) minmax(0,1fr)!important;gap:var(--g)!important;margin:0!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-item{min-height:0;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:.25em;padding:.3em!important;background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;text-align:center}
body .modal.frame.in-book[data-document="unlocks"] .collection-item .collection-portrait{flex:none;width:calc(var(--bh)*.16)!important;height:calc(var(--bh)*.16)!important;max-width:100%!important;object-fit:contain;background-size:contain;background-position:center;background-repeat:no-repeat}
body .modal.frame.in-book[data-document="unlocks"] .collection-item.locked .collection-portrait{filter:grayscale(1) sepia(.4) brightness(.55) contrast(.9);opacity:.6}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+1){grid-column:1;grid-row:1}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+2){grid-column:2;grid-row:1}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+3){grid-column:1;grid-row:2}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+4){grid-column:2;grid-row:2}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+5){grid-column:4;grid-row:1}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+6){grid-column:5;grid-row:1}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+7){grid-column:4;grid-row:2}
body .modal.frame.in-book[data-document="unlocks"] .collection-item:nth-child(8n+8){grid-column:5;grid-row:2}
body .modal.frame.in-book[data-document="unlocks"] .collection-pagination{grid-column:1/-1;grid-row:6;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:calc(var(--fold)*2);align-items:center;margin:0!important;padding:0!important;background:none!important;border:0!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-pagination>*{grid-row:1;margin:0!important}
body .modal.frame.in-book[data-document="unlocks"] .collection-pagination>:first-child{grid-column:1;justify-self:start}
body .modal.frame.in-book[data-document="unlocks"] .collection-pagination>span{grid-column:2;justify-self:start}
body .modal.frame.in-book[data-document="unlocks"] .collection-pagination>:last-child{grid-column:2;justify-self:end}

/* ---- the other duels: a note on the left page, the duels listed on the right ---- */
body .modal.frame.in-book[data-document="watch-duels"]{grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"title list" "intro list" ". list"}
body .modal.frame.in-book[data-document="watch-duels"]>p{grid-area:intro;margin:0!important;font-style:italic;line-height:1.5}
body .modal.frame.in-book[data-document="watch-duels"]>.card-list{grid-area:list;align-self:start;max-height:100%;overflow:auto;display:flex!important;flex-direction:column;gap:0!important;margin:0!important}
body .modal.frame.in-book[data-document="watch-duels"] .card-row{width:100%;display:flex!important;align-items:center;gap:.8em;padding:.7em .2em!important;background:none!important;border:0!important;border-bottom:1px solid var(--rule)!important;border-radius:0!important;box-shadow:none!important;color:var(--ink)!important;text-align:left;cursor:pointer}
body .modal.frame.in-book[data-document="watch-duels"] .card-row:hover{background:var(--wash)!important}
body .modal.frame.in-book[data-document="watch-duels"] .card-row :is(strong,small){display:block}
body .modal.frame.in-book[data-document="watch-duels"] .card-row strong{color:var(--ink-strong)!important}
body .modal.frame.in-book[data-document="watch-duels"] .card-row small{color:var(--ink-soft)!important}
body .modal.frame.in-book[data-document="watch-duels"] .card-row svg{flex:none;color:var(--ink-soft)}

/* ---- a creature: its portrait and the contents of its record on the left page, the chosen study on the right ---- */
body .modal.frame.in-book[data-document="pet"]{grid-template-rows:auto auto auto minmax(0,1fr);grid-template-areas:"title view" "head view" "tabs view" ". view"}
body .modal.frame.in-book[data-document="pet"] :is(#pet-inspector,.pet-record-pages){display:contents!important}
body .modal.frame.in-book[data-document="pet"] .pet-detail-head{grid-area:head;margin:0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
body .modal.frame.in-book[data-document="pet"] .pet-inspector-tabs{grid-area:tabs}
body .modal.frame.in-book[data-document="pet"] .pet-record-pages>:is(.lineage-preview,.monster-anatomy,.pet-deck-grid){grid-area:view;align-self:center;margin:0!important;max-height:100%;min-height:0}
body .modal.frame.in-book[data-document="pet"] .pet-record-pages>.pet-deck-grid{align-self:start;grid-template-columns:1fr!important;overflow:auto}
body .modal.frame.in-book[data-document="pet"] .monster-anatomy{width:100%!important}
body .modal.frame.in-book[data-document="pet"] .lineage-preview{background:none!important;border:0!important;box-shadow:none!important;padding:0!important}
body .modal.frame.in-book[data-document="pet"] .lineage-stages{gap:var(--g)!important;align-items:end}
body .modal.frame.in-book[data-document="pet"] .lineage-stage{background:none!important;border:0!important;border-bottom:1px solid var(--rule)!important;border-radius:0!important;box-shadow:none!important;padding:.4em .2em .6em!important;min-height:0!important;font-style:normal}
body .modal.frame.in-book[data-document="pet"] .lineage-stage.current{border-bottom:2px solid var(--oxblood)!important}
body .modal.frame.in-book[data-document="pet"] .lineage-silhouette{height:calc(var(--bh)*.26)!important}
body .modal.frame.in-book[data-document="pet"] .lineage-silhouette .art-img{width:min(100%,calc(var(--form-height)*2.6))!important;height:calc(var(--form-height)*2.6)!important;max-height:100%}
body .modal.frame.in-book[data-document="pet"] .lineage-stage strong{color:var(--ink-strong)!important;font:italic 400 1.05em Georgia,serif}
body .modal.frame.in-book[data-document="pet"] .lineage-stage small{color:var(--ink-soft)!important}
body .modal.frame.in-book[data-document="pet"] .lineage-preview>p{display:block!important;margin:1em 0 0!important;font-style:italic;line-height:1.5}
/* move and trainer cards: pressed paper plates, wherever they appear in the book */
body .modal.frame.in-book[data-document] .pet-deck-card{background:linear-gradient(150deg,#fff7e6b8,#e8d8b670)!important;border:1px solid #92775570!important;border-radius:3px!important;box-shadow:0 1px 3px rgba(40,26,10,.12)!important;display:flex!important;flex-direction:column;padding:.65rem!important;min-height:0!important}
body .modal.frame.in-book[data-document] .pet-deck-card .gold{color:#75492b!important}
body .modal.frame.in-book[data-document] .pet-deck-card.part-dimmed{opacity:.45}

/* ---- the round's outcome and the camp's summary: the verdict on the left, the particulars on the right ---- */
body .modal.frame.in-book[data-document="round-outcome"]{grid-template-rows:auto auto auto minmax(0,1fr) auto;grid-template-areas:"title facts" "summary facts" "tiles facts" "tail facts" "foot foot"}
body .modal.frame.in-book[data-document="round-outcome"]>.company-record-body{display:contents!important}
body .modal.frame.in-book[data-document="round-outcome"] .company-record-body>p:first-child{grid-area:summary;margin:0!important;line-height:1.5}
body .modal.frame.in-book[data-document="round-outcome"] .result-facts{grid-area:tiles;display:flex!important;gap:1.4em;margin:0!important;padding:.4em 0!important;background:none!important;border:0!important}
body .modal.frame.in-book[data-document="round-outcome"] .result-fact{display:grid;gap:.15em;background:none!important;border:0!important;box-shadow:none!important;padding:0!important}
body .modal.frame.in-book[data-document="round-outcome"] .result-fact strong{font:400 2em/1 Georgia,serif}
body .modal.frame.in-book[data-document="round-outcome"] .company-record-body>:is(.causal-facts,.card-list){grid-area:facts;align-self:start;margin:0!important}
body .modal.frame.in-book[data-document="round-outcome"] .company-record-body>p.tiny{grid-area:tail;margin:0!important;font-style:italic}
body .modal.frame.in-book[data-document="camp-review"]{grid-template-areas:"title ." "summary summary" "foot foot"}
body .modal.frame.in-book[data-document="camp-review"] .camp-summary{grid-area:summary;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:0 calc(var(--fold)*2)!important;margin:0!important}
body .modal.frame.in-book[data-document="camp-review"] .camp-summary>div{background:none!important;border:0!important;box-shadow:none!important;padding:0!important}
body .modal.frame.in-book .causal-facts li{border-bottom:1px solid var(--rule);padding:.45em 0;list-style:none}
