/* Final card layer: explicit surfaces only; reading containers remain unframed. */
html body :is(dialog#modal,.palace-sheet)[open] :is(.policy-option,.policy-current,.crew-slot,.crew-candidate,.court-person-button,.personnel-review-role,.trait-card,.birth-option,.talent-badge,.trait-study-progress,.trait-rare-progress,.command-authority-catalog article,.scouting-receipt,.dossier-skill,.mobilization-ledger,.recruitment-summary,.frontier-odds>div){
 --window-card-art:url('assets/ui-management-card-civil-1115.webp');
 border:3px solid transparent!important;border-image:var(--window-card-art) 18% fill / 17px / 0 stretch!important;
 background:none!important;box-shadow:none!important;border-radius:0!important;padding:18px!important;box-sizing:border-box;min-width:0;max-width:100%;height:auto!important;
}
html body :is(dialog#modal,.palace-sheet)[open] :is(.crew-slot,.crew-candidate,.command-authority-catalog article,.frontier-odds>div){--window-card-art:url('assets/ui-management-card-martial-1115.webp')}
html body :is(dialog#modal,.palace-sheet)[open] :is(.birth-option,.trait-card){--window-card-art:url('assets/ui-management-card-family-1115.webp')}
html body :is(dialog#modal,.palace-sheet)[open] :is(.policy-option,.crew-slot,.crew-candidate,.court-person-button,.personnel-review-role,.trait-card,.birth-option,.command-authority-catalog article,.scouting-receipt,.dossier-skill)::before,
html body :is(dialog#modal,.palace-sheet)[open] :is(.policy-option,.crew-slot,.crew-candidate,.court-person-button,.personnel-review-role,.trait-card,.birth-option,.command-authority-catalog article,.scouting-receipt,.dossier-skill)::after{display:none!important}
html body :is(dialog#modal,.palace-sheet)[open] .dossier-stats>div{background:none!important;border:2px solid transparent!important;border-image:url('assets/ui-management-card-civil-1115.webp') 18% fill / 9px / 0 stretch!important;padding:10px!important;min-width:0;box-sizing:border-box}
html body :is(dialog#modal,.palace-sheet)[open] :is(.policy-option,.crew-candidate,.personnel-review-role,.command-authority-catalog article,.dossier-skill) :is(p,h3,h4,small,dt,dd){max-width:100%;min-width:0;overflow-wrap:anywhere;word-break:keep-all}
html body :is(dialog#modal,.palace-sheet)[open] .command-authority-catalog dl>div{flex-wrap:wrap}
html body :is(dialog#modal,.palace-sheet)[open] .command-authority-catalog dd{margin-left:auto}
html body dialog#modal .affairs-tab-seal{margin-right:5px!important}
@media(max-width:420px){html body :is(dialog#modal,.palace-sheet)[open] .dossier-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}html body :is(dialog#modal,.palace-sheet)[open] .policy-option-heading>strong{font-size:20px!important}}

/* Quiet lacquer backing preserves the city's numerical table. */
html body .city-sheet-main{background:#151817 url('assets/ui-window-lacquer-1029.webp') center/cover!important}
html body dialog.hall-gallery-sheet[open]{zoom:1!important}

html body dialog.hall-gallery-sheet .hall-card{background:none!important;border:3px solid transparent!important;border-image:url('assets/ui-management-card-civil-1115.webp') 18% fill / 18px / 0 stretch!important;padding:20px!important;overflow:visible!important}
