/* Roll first; compact references; native, keyboard-friendly section folds. */
.recovered-sheet .game-reference{margin-bottom:18px}
.recovered-sheet .reference-stack{grid-template-columns:1fr;grid-template-rows:auto;gap:10px}
.recovered-sheet .reference-stack>.card{display:block;min-height:0;padding:12px 16px}
.recovered-sheet .reference-stack .card-title{margin:0;font-size:13px}
.panel-fold>summary,.sheet-group>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:10px;min-height:44px}
.panel-fold>summary::-webkit-details-marker,.sheet-group>summary::-webkit-details-marker{display:none}
.panel-fold>summary:after,.sheet-group>summary:after{content:'+';margin-left:auto;font:24px/1 Georgia,serif;color:#5a644f;flex-shrink:0}
.panel-fold[open]>summary:after,.sheet-group[open]>summary:after{content:'−'}
.panel-fold>summary:focus-visible,.sheet-group>summary:focus-visible{outline:3px solid #448f83;outline-offset:3px}
.fold-content{padding-top:10px}
.recovered-sheet .roll-stage{display:grid;grid-template-columns:200px minmax(0,1fr);gap:20px;align-items:center}
.recovered-sheet .fate-die{min-height:0!important;height:190px!important;margin:0;perspective:600px}
.recovered-sheet .fate-die:before,.recovered-sheet .fate-die:after{display:none}
.recovered-sheet .fate-die .prism-d20{height:185px!important;width:185px!important;max-height:none;animation:none!important;filter:none}
.recovered-sheet .fate-die .d20-number{font-size:64px;fill:var(--result-color,#fff);stroke:#f6ebd0;stroke-width:1px;filter:none}
.fate-die[data-outcome=catastrophe]{--result-color:#700919}
.fate-die[data-outcome=failure]{--result-color:#ea8175}
.fate-die[data-outcome=haggle]{--result-color:#efbb51}
.fate-die[data-outcome=success]{--result-color:#72d3b5}
.recovered-sheet .fate-die[data-outcome=triumph] .d20-number{fill:url(#d20Prism);stroke:#fff7ce;filter:url(#numberGlow)}
.recovered-sheet .roll.cat{background:#700919;color:#fff}
.recovered-sheet .reference-stack .distance-grid,.recovered-sheet .reference-stack .conflict{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.recovered-sheet .reference-stack .distance,.recovered-sheet .reference-stack .conflict>div{min-height:48px;padding:6px 3px}
.recovered-sheet .reference-stack .conflict b{font-size:12px}.recovered-sheet .reference-stack .conflict small{font-size:10px}
.recovered-sheet .reference-stack .distance b{font-size:12px}
.recovered-sheet .reference-stack .distance-watermark{width:36px;height:36px}
.recovered-sheet .combat-dashboard{align-items:start}
.recovered-sheet .combat-dashboard>.card{height:auto}
.recovered-sheet .table-dashboard{display:block;margin:0}
.recovered-sheet .table-tools{grid-template-columns:repeat(2,minmax(0,1fr))}
.recovered-sheet .table-tools .pack-card{grid-column:1/-1}
@media(max-width:760px){
 .recovered-sheet .roll-stage{grid-template-columns:1fr;gap:6px}
 .recovered-sheet .fate-die{height:145px!important}.recovered-sheet .fate-die .prism-d20{height:140px!important;width:140px!important}
 .recovered-sheet .reference-stack>.card{padding:10px}
 .recovered-sheet .reference-stack .conflict small{font-size:9px}
 .recovered-sheet .reference-stack .conflict b,.recovered-sheet .reference-stack .distance b{font-size:11px}
 .sheet-group{padding:8px}.recovered-sheet .table-tools{grid-template-columns:1fr}
 .recovered-sheet .roll-controls .sheet-actions{display:grid;grid-template-columns:minmax(0,1fr) auto}
 .recovered-sheet .reference-stack #rollMode{width:100%;font-size:13px}
}
@media print{.sheet-group{border:0;padding:0}.panel-fold>summary:after,.sheet-group>summary:after{display:none}.recovered-sheet .fate-die{display:none!important}.recovered-sheet .roll-stage{display:block}}

/* Actual panels fold at their own titles. No nested group cards. */
.recovered-sheet details.panel-fold{display:block!important;min-height:0!important;height:auto!important;padding:8px 10px!important;align-self:start}
.recovered-sheet details.panel-fold:not([open])>:not(summary),.recovered-sheet #learningBook:not([open])>:not(summary){display:none!important}
.recovered-sheet .panel-fold>summary{min-height:36px;margin:0;padding:0;gap:8px}
.recovered-sheet .panel-fold>summary .card-title{margin:0!important;min-height:36px;font-size:13px;line-height:1.3;flex:1}
.recovered-sheet .panel-fold>summary .aether-seal{width:28px;height:32px;flex-basis:28px;margin-right:0;border-radius:8px 3px}
.recovered-sheet .panel-fold>summary .aether-seal svg{width:21px;height:24px}
.recovered-sheet .panel-fold>summary:after{font-size:20px;line-height:1;margin-left:8px}
.recovered-sheet .panel-fold .fold-content{padding-top:8px}
.recovered-sheet .combat-dashboard,.recovered-sheet .growth-grid{align-items:start}
.known-fold-title{display:flex;align-items:center;flex-wrap:wrap;gap:8px;flex:1}
.known-fold-title h2{font:700 16px/1.3 Georgia,serif;margin:0}
.known-fold-title .ability-count{font-size:11px;margin-left:auto}
.recovered-sheet .learning-book>summary{padding:8px 10px;min-height:36px;gap:8px;flex-wrap:wrap}
.recovered-sheet .learning-book>summary>span:first-child{font-size:15px}
.recovered-sheet .learning-book>summary .aether-seal{display:none}
.recovered-sheet #learningCredits{font-size:11px}

.recovered-sheet .roll-card:has(.is-rolling) #rollResult{visibility:hidden}
@media(max-width:760px){
 .recovered-sheet .roll-stage{grid-template-columns:90px minmax(0,1fr);gap:8px}
 .recovered-sheet .roll-controls{display:contents}
 .recovered-sheet .roll-stage .roll-table{grid-column:1/-1;grid-row:1}
 .recovered-sheet .roll-stage .roll-note{grid-column:1/-1;grid-row:2}
 .recovered-sheet .roll-stage .fate-die{grid-column:1;grid-row:3;height:100px!important}
 .recovered-sheet .fate-die .prism-d20{height:96px!important;width:96px!important}
 .recovered-sheet .roll-stage .sheet-actions{grid-column:2;grid-row:3;display:grid;grid-template-columns:1fr;margin:0;gap:5px}
 .recovered-sheet .roll-stage #rollResult{grid-column:1/-1;grid-row:4;margin:0}
}

/* Identity first; compact awards; a single exit from Hearth choices. */
.recovered-sheet .front-page .hero-head{margin:0 0 14px;grid-template-columns:minmax(0,2fr) minmax(180px,1fr);gap:16px}
.recovered-sheet .front-page .hero-name-wrap{min-width:0}
.recovered-sheet .front-page .play-name{display:block;margin:8px 0}
.recovered-sheet .front-page .identity-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.recovered-sheet .front-page .identity-grid>.fieldbox{grid-area:auto}
.recovered-sheet .front-page .identity-grid .identity-species{grid-column:span 2}
.recovered-sheet .front-page .identity-grid .identity-from{grid-column:1/-1}
.recovered-sheet .session-card .mark-awards{margin:10px 0 0;padding:0;border:0;background:none}
.recovered-sheet .session-card #classAllowance{display:inline-block;font-size:11px;margin:8px 10px 8px 0}
.recovered-sheet .session-card .quiet-undo{min-height:36px;padding:5px 9px;font-size:11px;background:transparent;border:1px solid var(--line);border-radius:6px;color:var(--ink)}
.recovered-sheet #advancementReady[hidden],.hearth-choices[hidden]{display:none!important}
.hearth-choices{margin:14px 0;padding:12px;border:1px solid #a88d57;border-radius:8px;background:#fff7df;display:flex;align-items:center;gap:12px;justify-content:space-between}
.hearth-choices p{font-size:13px;margin:0;line-height:1.5}.hearth-choices button{min-height:44px;border:1px solid #365b4d;border-radius:7px;background:#244e44;color:#fff;padding:10px 14px;font-weight:bold;cursor:pointer}
@media(max-width:760px){.recovered-sheet .front-page .hero-head{grid-template-columns:1fr;gap:10px}.recovered-sheet .front-page .identity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hearth-choices{flex-direction:column;align-items:stretch}}
@media print{.hearth-choices{display:none!important}}

/* Give the settled value its own clear face instead of crossing the facet lines. */
.die-result-plate{fill:#111b27;stroke:#f5e6c0;stroke-width:3;opacity:0}
.fate-die[data-outcome]:not([data-outcome=""]) .die-result-plate{opacity:1}
.fate-die[data-outcome=catastrophe] .die-result-plate{fill:#fff2db}
.recovered-sheet .fate-die .d20-number{font-family:Arial,sans-serif;font-size:92px;font-weight:900;stroke:none;filter:none;letter-spacing:-3px}
.recovered-sheet .fate-die[data-outcome=triumph] .d20-number{stroke:none;filter:drop-shadow(0 0 2px #b7edff)}
.fate-die[data-outcome=triumph] .die-result-plate{stroke:url(#d20Prism);filter:drop-shadow(0 0 4px #aee9ff)}
@media(max-width:760px){.recovered-sheet .roll-stage{grid-template-columns:114px minmax(0,1fr)}.recovered-sheet .roll-stage .fate-die{height:120px!important}.recovered-sheet .fate-die .prism-d20{height:116px!important;width:116px!important}}
/* The third creation step stays short, editable, and separate from class selection. */
.creation-footer:has(#creationNext:not([hidden])){display:flex}
#creationNext{margin-left:auto;background:#244e44;color:#fff}
.kit-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}
#creationKit label{display:block;font-weight:bold;font-size:14px}
#creationKit textarea,#creationKit select{box-sizing:border-box;display:block;width:100%;margin:7px 0 12px;padding:10px;border:1px solid #a39070;border-radius:6px;background:#fffdf7;color:#302b25;font:15px/1.5 Georgia,serif;min-height:44px}
#creationKit textarea{resize:vertical}
.kit-note{font:12px/1.5 system-ui;color:#635746;margin:4px 0 16px}
.kit-keepsakes{border:0;padding:0;margin:20px 0 12px;min-width:0}
.kit-keepsakes legend{font:700 20px Georgia,serif;margin-bottom:12px}
#creationKeepsakes{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#creationKit .kit-choice{display:flex;gap:10px;padding:14px;border:1px solid #b8a780;border-radius:8px;background:#fffcf5;cursor:pointer}
.kit-choice input{flex:0 0 20px;width:20px;height:20px;margin:3px 0 0;accent-color:#285b4b}
.kit-choice strong{display:block;font:700 20px/1.2 Georgia,serif;margin-bottom:8px}
.kit-choice span span{display:block;font:14px/1.5 Georgia,serif;font-weight:400}
.kit-choice:has(input:checked){outline:2px solid #38715b;background:#edf6ed}
.kit-choice:focus-within{outline:3px solid #17847e}
@media(max-width:540px){.kit-fields,#creationKeepsakes{grid-template-columns:1fr}}

.weapon-mode{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 12px;align-items:center;margin:12px 0 16px}.weapon-mode label{font-weight:bold}.weapon-mode select{width:100%;min-width:0;min-height:44px;padding:8px;background:#fffdf5;border:1px solid #a39070;border-radius:6px;color:#302b25;font:14px system-ui}.weapon-mode p{grid-column:1/-1;margin:0;font:13px/1.5 system-ui}.scene-reset{padding:8px 12px;min-height:44px;background:#f4f1e7;border:1px solid #a39070;border-radius:6px;color:#354635;cursor:pointer}.scene-help{font-size:12px!important}.scene-reset[hidden],.scene-help[hidden]{display:none!important}

#regroupPace{display:block;width:100%;min-height:44px;margin:8px 0;padding:8px;border:1px solid #a39070;border-radius:6px;background:#fffdf5;color:#302b25;font:14px system-ui}.flourish-note{padding:12px;border:1px solid #b4b894;border-radius:7px;background:#f5f6e9;font:14px/1.5 Georgia,serif}.roll-reward-note{font:12px/1.5 system-ui;margin:8px 0;color:#554b3b}

.weapon-ammo-label{display:block;margin:8px 0;font:700 11px/1.4 system-ui;text-transform:uppercase;letter-spacing:.04em}.weapon-ammo{display:block;width:100%;min-height:44px;margin-top:4px;border:1px solid #a39070;border-radius:6px;background:#fffdf5;color:#302b25;padding:8px;font:15px system-ui}.weapon-attack:disabled{cursor:not-allowed;opacity:.6}

.item-chips{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.item-chip{display:flex;align-items:center;gap:8px;max-width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #b3a078;border-radius:8px;background:#fffaf0}.item-text{min-width:0;overflow-wrap:anywhere;white-space:pre-wrap;user-select:all;font:14px/1.5 Georgia,serif}.item-buttons{display:flex;flex-shrink:0;gap:4px}.item-buttons button,.list-actions button{min-height:44px;min-width:44px;padding:6px 9px;border:1px solid #b3a078;border-radius:6px;background:#f1f4e9;color:#294c3a;font:700 12px system-ui;cursor:pointer}.list-actions{margin:5px 0}.list-edit summary{cursor:pointer;padding:8px 0;font:700 13px system-ui}.list-edit p{font:12px/1.5 system-ui;color:#655746}.list-edit textarea{width:100%;box-sizing:border-box;min-height:70px}.copy-fallback{width:100%;min-height:70px}.list-editor{min-width:0}@media(max-width:540px){.item-chip{width:100%;justify-content:space-between}.item-buttons{align-self:flex-start}}@media print{.list-edit{display:none!important}.item-chip{break-inside:avoid;background:none}.item-chips{gap:4px}.item-text{font-size:10pt}}

.equipped-tag{display:block;color:#386451;font:700 10px/1.5 system-ui;letter-spacing:.07em;text-transform:uppercase;margin-bottom:3px}

/* Class discovery stays in the selected card; a second activation continues. */
#creationDialog .creation-classes{align-items:start}
#creationDialog .creation-classes button[aria-expanded="true"]{background:#f4ecd7;border:2px solid var(--accentDark,#526f58);gap:12px}
#creationDialog .class-preview-copy{font:400 16px/1.45 system-ui,sans-serif;color:#302c24}
#creationDialog .class-preview-continue{font:700 15px/1.3 system-ui,sans-serif;color:var(--accentDark,#355341)}
#creationDialog .creation-classes button:focus-visible{outline:3px solid #3c9185;outline-offset:3px}

/* Launch finishing touches: keep explanations readable on phones. */
@media(max-width:760px){
 .recovered-sheet .roll-stage .roll-reward-note{grid-column:1/-1;grid-row:5;margin:4px 0 0}
 #creationClasses [data-create-class][aria-expanded="true"]{grid-column:1/-1}
}
.save-cluster{display:inline-flex;flex-direction:column;align-items:flex-start;gap:3px;flex-shrink:0}
#cloudSaveState{font:600 12px/1.4 system-ui,sans-serif;color:#5d4933}
#cloudSaveState[data-state="saved"]{color:#235640}
#cloudSaveState[data-state="pending"],#cloudSaveState[data-state="unsaved"]{color:#784714}
.creation-checklist{margin:12px 0;padding:14px 18px;border:1px solid #ac956c;border-radius:8px;background:#fff8e8;color:#283e35;font:16px/1.5 system-ui,sans-serif}
.creation-checklist ol{margin:8px 0 0;padding-left:22px}.creation-checklist li{margin:7px 0}
.creation-checklist a{color:#245440;text-decoration:underline}.creation-checklist button{font:inherit;font-weight:700;min-height:44px;padding:7px 12px}

.essential-choice{width:100%;box-sizing:border-box;padding:14px;border:1px solid #a8ac91;border-radius:8px;background:#f1eedc;color:#263e35;line-height:1.5}.essential-choice strong{display:block;margin-bottom:6px}
/* One compact crafting action, with comfortable touch targets. */
.prepared-card #craftRecipe,.prepared-card #craftReagent{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:9px 11px;border:1px solid #92a8a0;border-radius:7px;background:#fffdf6;color:#203d37;font:16px/1.4 system-ui,sans-serif}
.prepared-card #craftMake{min-height:46px;padding:11px 16px;border:1px solid #285d54;border-radius:7px;background:#24564e;color:#fffdf6;font:700 16px/1.4 system-ui,sans-serif}
.prepared-card #craftMake:disabled{opacity:.55;cursor:not-allowed}.prepared-card #reagentReference{padding-left:20px}.prepared-card #reagentReference li{margin:10px 0;line-height:1.5}

/* Keep distance illustrations beside their labels, with separate layout space. */
.recovered-sheet .reference-stack .distance{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:64px;padding:8px}
.recovered-sheet .reference-stack .distance .distance-watermark{position:static;inset:auto;transform:none;width:48px;height:48px;flex:0 0 48px;opacity:1;filter:none;z-index:auto}
.recovered-sheet .reference-stack .distance b{background:none;padding:0;z-index:auto;font-size:14px;text-shadow:none;line-height:1.2}
@media(max-width:760px){
 .recovered-sheet .reference-stack .distance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .recovered-sheet .reference-stack .distance{gap:6px}
 .recovered-sheet .reference-stack .distance .distance-watermark{width:44px;height:44px;flex-basis:44px}
 .recovered-sheet .reference-stack .distance b{font-size:12px}
}

/* Keep the whole panel paint identical while crossing open cards.
   Native details must not clip descendants against a rounded hover border. */
.recovered-sheet .card,
.recovered-sheet .card:hover,
.recovered-sheet .card:focus-within{
 contain:none!important;overflow:visible!important;
 background:#fffdf7!important;background-image:none!important;
 border:1px solid #a48c68!important;
 box-shadow:none!important;filter:none!important;backdrop-filter:none!important;
 transform:none!important;transition:none!important;z-index:auto!important;
}
.hero-calling{display:block;margin:4px 0;font:900 24px/1.3 Georgia,serif;color:var(--accentDark)}

.recovered-sheet .page{transition:none!important}

/* A single item/quantity ledger. Phones scroll the ledger; desktop and print grow. */
.inventory-grid-editor{min-width:0}
.inventory-scroll{border:1px solid #a48c68;border-radius:8px;overflow:visible;background:#fffdf7}
.inventory-scroll:focus-visible{outline:3px solid #448f83;outline-offset:3px}
.inventory-table{width:100%;table-layout:fixed;border-collapse:collapse;font:15px/1.45 system-ui,sans-serif}
.inventory-table th{padding:12px;text-align:left;background:#eee8d9;color:#354635;font-size:12px;text-transform:uppercase;letter-spacing:.06em}
.inventory-table th:last-child{width:112px;text-align:center}
.inventory-table td{padding:8px;border-top:1px solid #cbbca4;vertical-align:top}
.inventory-table td+td{border-left:1px solid #cbbca4}
.inventory-item-cell{display:flex;gap:6px;align-items:start}
.inventory-item-name{flex:1;min-width:0}
.inventory-table textarea{display:block;width:100%;box-sizing:border-box;min-height:44px;resize:vertical;field-sizing:content;overflow-wrap:anywhere;background:transparent;border:1px solid transparent;border-radius:4px;padding:10px 6px;font:inherit;color:#302b25}
.inventory-table input{box-sizing:border-box;width:100%;min-height:44px;padding:8px 4px;text-align:center;border:1px solid #b3a078;border-radius:5px;background:#fffdf7;color:#302b25;font:inherit}
.inventory-table textarea:focus-visible,.inventory-table input:focus-visible{outline:2px solid #448f83;outline-offset:1px}
.inventory-table textarea[readonly]{cursor:default}
.inventory-table .inventory-remove{flex:0 0 36px;min-width:36px;min-height:44px;padding:4px;border:1px solid #b3a078;border-radius:5px;background:#f5eee1;color:#654635;font:22px/1 system-ui}
.inventory-empty{padding:20px!important;color:#655746}
.inventory-add{display:grid;grid-template-columns:minmax(0,1fr) 112px auto;gap:10px;align-items:end;margin-top:14px}
.inventory-add label{min-width:0;font:700 12px/1.5 system-ui;color:#354635}
.inventory-add input{display:block;box-sizing:border-box;width:100%;min-height:44px;margin-top:4px;padding:10px 8px;border:1px solid #a48c68;border-radius:5px;background:#fffdf7;font:16px/1.3 system-ui;color:#302b25}
.inventory-add button,.inventory-actions button{min-height:44px;padding:9px 14px;border:1px solid #596b4c;border-radius:6px;background:#e9edde;color:#354635;font:700 14px/1.3 system-ui;cursor:pointer}
.inventory-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:12px 0}
.inventory-actions #inventoryCounter{font:13px/1.4 system-ui;color:#655746}
@media(max-width:760px){
 .inventory-scroll{max-height:420px;max-height:min(60dvh,420px);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 .inventory-table th{position:sticky;top:0;z-index:1}
 .inventory-table th:last-child{width:80px}
 .inventory-table th,.inventory-table td{padding:6px}
 .inventory-add{grid-template-columns:minmax(0,1fr) 80px;gap:8px}
 .inventory-add button{grid-column:1/-1}
}
@media print{
 .inventory-scroll{max-height:none!important;overflow:visible!important;border-radius:0}
 .inventory-table{font-size:10pt}.inventory-table th{position:static}
 .inventory-table tr{break-inside:avoid}.inventory-table thead{display:table-header-group}
 .inventory-table input{border:0;background:none}
}

/* Frequently used abilities, weapons and inventory share the main play folio. */
.recovered-sheet .combat-dashboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.recovered-sheet #hero-folio>.known-fold,.recovered-sheet #hero-folio>.weapons-card,.recovered-sheet #hero-folio>.pack-card{margin-top:16px;width:auto}
.rest-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}
.rest-buttons button{display:flex;flex-direction:column;align-items:center;gap:6px;min-height:76px;padding:12px 8px;border:1px solid #8b7955;border-radius:8px;background:#f2ecd9;color:#283f36;cursor:pointer;font:16px/1.3 Georgia,serif}
.rest-buttons #rest{background:#294d42;color:#fff6df;border-color:#294d42}
.rest-buttons button span{font:13px/1.3 system-ui,sans-serif}
.rest-buttons button:focus-visible{outline:3px solid #b38532;outline-offset:3px}
.rest-help,#restStatus{font:14px/1.5 system-ui,sans-serif}
#restChoices{display:inline-block;min-height:32px;font-weight:bold;color:#294d42}
#restChoices[hidden]{display:none}
@media(max-width:700px){.recovered-sheet .combat-dashboard{grid-template-columns:1fr}.rest-buttons button{min-height:80px}}
@media print{.rest-buttons,#restChoices{display:none!important}}
