/* Dedicated measured profiles; corner art is never stretched to panel proportions. */
[data-ui-frame]{border:0!important;border-image:none!important;border-radius:0!important;outline:0;box-sizing:border-box;background-color:transparent!important;box-shadow:none!important;}
[data-ui-frame]::before,[data-ui-frame]::after{content:none!important;display:none!important}
[data-ui-frame="control"]{--ui-corner:18px;--ui-edge:4.5px;min-height:32px;padding:10px 18px;color:#e8cf9e}
[data-ui-frame="tab"]{--ui-corner:22px;--ui-edge:5.5px;padding:15px 18px;white-space:nowrap;letter-spacing:1px}
[data-ui-frame="bookmark"]{--ui-corner:32px;--ui-edge:8px}
[data-ui-frame="card"]{--ui-corner:32px;--ui-edge:8px}
[data-ui-frame="tooltip"]{--ui-corner:32px;--ui-edge:8px;padding:20px 22px;box-shadow:0 8px 26px #000b}
[data-ui-frame="dialog"],[data-ui-frame="panel"]{--ui-corner:56px;--ui-edge:14px;padding:28px}
[data-ui-frame="badge"]{--ui-corner:12px;--ui-edge:3px;padding:6px 12px;box-shadow:none}
[data-ui-frame]:focus-visible{outline:1px solid #e5c17a;outline-offset:3px}
button[data-ui-frame]:hover:not(:disabled){filter:brightness(1.18);box-shadow:0 0 8px #b7934a55}
button[data-ui-frame]:disabled{opacity:.5}
.warehouse-tab[aria-pressed=true]{color:#ffe2a8;box-shadow:inset 0 0 18px #ad87352b,0 0 6px #b7934a55}
.battle-controls .seal[data-confirm]{padding:0 6px;min-height:0}
.backstreet-event-dialog .route-event{background:none!important;border:0!important;padding:0!important;min-height:0}
.backstreet-event-dialog .route-event .seal{padding:16px 24px}
[data-ui-frame]::-webkit-scrollbar{width:7px;height:7px}
[data-ui-frame]::-webkit-scrollbar-track{background:#000}
[data-ui-frame]::-webkit-scrollbar-thumb{background:#725b35;border:2px solid #000;border-radius:4px}
.party-picker-head,.bag-overflow-actions{background:#000!important}
/***** Map illustrations retain their own background and only receive an overlay. *****/
.adaptive-frame>*{display:none!important}
.backstreet-map.gilt-panel::before{display:block!important}
@media(max-width:600px){[data-ui-frame="panel"],[data-ui-frame="dialog"]{padding:22px}[data-ui-frame="tab"]{padding:12px 14px;font-size:16px}}
/* Item tiles never inherit generic dialog buttons or legacy ornaments. */
body .item-tile,body .supply-stock-card,body .supply-pack-slot:not(.empty),body .warehouse .stock-item{background:transparent url(items/slot-frame.webp) center/100% 100% no-repeat!important;border:0!important;border-image:none!important;outline:0;transform:none;padding:0;box-shadow:none;position:relative}
body .item-tile::before,body .item-tile::after,body .supply-stock-card::before,body .supply-stock-card::after,body .supply-pack-slot::before,body .supply-pack-slot::after{content:none!important;display:none!important}
body .item-tile:hover,body .item-tile:focus-visible,body .supply-stock-card:hover:not(:disabled),body .supply-pack-slot:hover:not(.empty),body .warehouse .stock-item:hover{background:transparent url(items/slot-frame.webp) center/100% 100% no-repeat!important;transform:none;outline:0;box-shadow:0 0 3px #e3c990,0 0 11px #c7a46580,inset 0 0 5px #e3c99040}
body .item-tile .item-icon,body .supply-stock-card .item-icon,body .supply-pack-slot .item-icon,body .warehouse .stock-item .item-icon{transition:transform .16s ease,filter .16s ease;transform-origin:center;pointer-events:none}
body .item-tile:hover .item-icon,body .item-tile:focus-visible .item-icon,body .supply-stock-card:hover:not(:disabled) .item-icon,body .supply-pack-slot:hover:not(.empty) .item-icon,body .warehouse .stock-item:hover .item-icon{transform:scale(1.12);filter:drop-shadow(0 0 3px #e0bf7380)}
body .item-tile-empty,body .supply-pack-slot.empty{background:transparent url(items/slot-frame.webp) center/100% 100% no-repeat!important;border:0!important;box-shadow:none;opacity:.4}

.seal,.warehouse-tab,.accessory-option,.equipment-slot,.party-choice,.warehouse .detail-badge,.employee-card,.battle-picks label,.battle-test-slot{position:relative}

/* The detail column scrolls without carrying its frame with the content. */
.warehouse .warehouse-detail[data-ui-frame]{overflow:auto}
[data-ui-frame]{scrollbar-color:#725b35 #000;scrollbar-width:thin}

/* Remove the legacy outer rectangle; black is confined to the opening. */
.gilt-panel{border:0!important;outline:0!important;box-shadow:none!important}
.gilt-panel::after{display:none!important}
.gilt-panel:not(.backstreet-map)::before{display:none!important}
[data-ui-frame],[data-ui-frame]:focus-visible,button[data-ui-frame]:hover,[data-ui-frame][aria-pressed=true]{outline:0!important;box-shadow:none!important}

/* Small close controls keep their glyph inside the decorative frame. */
.music-library-close[data-ui-frame]{width:36px;height:36px;min-width:36px;min-height:36px;padding:0!important;display:grid;place-items:center;line-height:1;font-size:22px;flex:0 0 36px;letter-spacing:0}
.music-library-head form{flex:0 0 auto;margin:0;align-self:center}
/* Render the landscape and portrait only within the ornamental opening. */
.employee-art{background-size:0 0!important;background-color:transparent!important;padding:0!important;overflow:hidden;box-shadow:none!important}
.employee-art-viewport{position:absolute;inset:12px;overflow:hidden;background-image:inherit;background-size:cover;background-position:inherit;background-repeat:no-repeat;display:flex;justify-content:center;align-items:flex-end;background-color:#000}
.employee-art[data-employee-id="02"] .employee-art-viewport,.employee-art[data-employee-id="05"] .employee-art-viewport{background-size:auto 150%}
.employee-art .employee-art-viewport #employee-full{height:100%;max-height:100%;object-fit:contain}
.employee-profile-title{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin:0 0 18px}
.employee-profile-title h3{margin:0;font-size:28px;font-weight:400;letter-spacing:3px;color:#ebd3a3}
.employee-profile-job{font-size:15px;color:#b8a78c;letter-spacing:2px}
/* Four distinct portrait paintings sit inside the bookmark frame. */
.employees .employee-page-link[data-ui-frame]{position:relative;clip-path:none;overflow:hidden;padding:12px!important;height:260px;min-height:260px;gap:0;display:block;isolation:isolate}
.bookmark-painting{position:absolute!important;inset:9px 8px 34px;z-index:0!important;display:block;overflow:hidden}
.bookmark-painting img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.employee-page-link .bookmark-label{position:absolute;inset:auto 10px 12px;z-index:2;font-size:17px;letter-spacing:2px;color:#edcf96;text-shadow:0 1px 3px #000}
.employee-page-link:hover .bookmark-painting img{filter:brightness(1.1)}
@media(max-width:1100px){.employees .employee-page-link[data-ui-frame]{height:225px;min-height:225px}.employee-page-link .bookmark-label{font-size:15px;letter-spacing:1px}}
@media(max-width:760px){.employees .employee-page-link[data-ui-frame]{height:180px;min-height:180px}.employee-profile-title h3{font-size:24px}}

.bookmark-painting img{object-fit:contain;background:#000}

/* A fixed ornamental shell surrounds a separately clipped scrolling page. */
.employee-info[data-ui-frame]{overflow:hidden!important;display:flex;flex-direction:column;min-height:0;padding:28px!important}
.employee-info-scroll{flex:1 1 auto;min-height:0;max-height:100%;overflow:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#725b35 #000;padding:4px 3px 10px;box-sizing:border-box}
.employee-page-content,.employee-story{min-width:0;overflow-wrap:anywhere}
.employee-info .employee-action-footer{background:#000;padding-top:12px}
/* Paintings replace the framed bookmark buttons, with a soft irregular brush silhouette. */
.employees .employee-page-link,.employees .employee-page-link[data-ui-frame]{border:0!important;background:none!important;box-shadow:none!important;outline:0;clip-path:none;padding:0!important;overflow:visible;isolation:isolate;height:340px!important;min-height:340px!important;transform:none!important}
.employees .employee-page-link::before,.employees .employee-page-link::after,.employees .employee-page-link[data-ui-frame]::after{content:none!important;display:none!important}
.employee-page-menu{gap:14px;padding:12px 0 18px}
.employee-page-link .bookmark-painting{inset:0 0 35px;z-index:0!important;mask-image:url(ui/paint-stroke-mask.svg);mask-size:100% 100%;mask-repeat:no-repeat}
.employee-page-link .bookmark-painting img{width:100%;height:100%;object-fit:cover;background:transparent}
.employee-page-link .bookmark-label{bottom:4px;font-size:19px;letter-spacing:3px}
.employee-page-link:focus-visible .bookmark-label{text-decoration:underline;text-underline-offset:5px}
/* Party cards share the panel system, with a separately framed faction scene. */
.party-grid{overflow:auto;min-height:0;align-items:stretch}
.party-slot[data-ui-frame]{padding:24px!important;gap:8px;overflow:hidden;min-height:430px}
.party-position{background:transparent!important;border:0!important;padding:2px 0 6px;line-height:1.5;font-size:15px;letter-spacing:1px;white-space:normal;text-align:center}
.party-portrait[data-ui-frame]{--ui-corner:40px;--ui-edge:10px;position:relative;padding:0!important;isolation:isolate;min-height:180px;overflow:hidden;display:block}
.party-portrait-stage{position:absolute;inset:calc(var(--ui-edge,10px) + 1px);display:flex;align-items:flex-end;justify-content:center;overflow:hidden;background-size:cover;background-position:center bottom;background-color:#000}
.party-slot[data-faction="night-kite"] .party-portrait-stage{background-image:url(ui/party-night-kite-carriage-v2.webp)}
.party-slot[data-faction="serinlia"] .party-portrait-stage{background-image:url(ui/party-serinlia.webp)}
.party-portrait .party-battle-mini{position:relative;z-index:1;height:86%!important;width:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 4px 3px #0008)}
.party-screen .party-portrait-stage::before{content:"";position:absolute;z-index:0;pointer-events:none;inset:0;background:radial-gradient(ellipse at 50% 56%,transparent 0%,transparent 32%,#07111e38 57%,#07111e99 80%,#050c17d9 100%)}
.party-screen .party-portrait .party-battle-mini,.party-screen .party-portrait:hover .party-battle-mini{transform:scaleX(-1) scale(1.18);transform-origin:center bottom}
.party-slot .party-job{margin:0 0 5px;font-size:14px}
.party-slot .party-actions{gap:8px}
.party-slot .party-actions .seal{padding:9px 12px;font-size:14px;letter-spacing:1px}

@media(max-width:760px){.employee-info[data-ui-frame]{padding:22px!important}.employees .employee-page-link,.employees .employee-page-link[data-ui-frame]{height:260px!important;min-height:260px!important}.employee-page-menu{grid-template-columns:repeat(2,minmax(0,1fr))}.party-slot[data-ui-frame]{padding:20px!important}}

/* Map artwork lives inside a clipped opening; its ornament stays above it. */
.map-viewport[data-ui-frame="map"],.backstreet-screen .backstreet-map[data-ui-frame="map"]{position:relative;isolation:isolate;padding:20px!important;overflow:hidden;background-color:transparent!important}
.map-viewport[data-ui-frame="map"]{background:none!important}
.backstreet-screen .backstreet-map[data-ui-frame="map"]{background-size:calc(100% - 24px) calc(100% - 24px)!important;background-position:center!important;background-repeat:no-repeat!important}
.map-viewport[data-ui-frame="map"]>.adaptive-frame,.backstreet-map[data-ui-frame="map"]>.adaptive-frame{display:none!important}
.map-viewport .map-opening{position:absolute;inset:12px;overflow:hidden;z-index:0}
.map-viewport .map-tip,.map-viewport .map-tools{z-index:11}
.backstreet-screen .route-details[data-ui-frame]{position:relative;min-height:0;padding:26px!important;overflow:auto}
.backstreet-screen .route-party-bar[data-ui-frame="hud"]{position:relative;padding:16px 20px!important;margin:0 0 12px;flex-shrink:0}
.backstreet-screen .route-formation-toggle{z-index:12}
/* The avatar artwork includes its own frame. */
.protagonist img{display:block;width:90px;height:90px;flex:0 0 90px;object-fit:contain;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important}
.protagonist[data-ui-frame]{padding:20px 28px!important;gap:22px}
/* Ground the shorter portrait at the same bottom edge. */
.employee-art[data-employee-id="04"] .employee-art-viewport #employee-full{height:94%!important;max-height:94%;align-self:flex-end;object-position:center bottom;transform:none}
/* Center the art in the opening, independently of the quantity recess. */
body .supplies-preparation .supply-stock-grid{grid-template-columns:repeat(auto-fit,76px)!important;justify-content:center;align-content:start;gap:12px;padding:4px 0}
body .supplies-preparation .supply-stock-card{width:76px;height:76px;min-height:76px!important;padding:0!important;display:block;box-sizing:border-box;gap:0}
body .supplies-preparation .supply-stock-card>b{position:absolute;inset:13% 12% 19%;height:auto!important;margin:0;display:flex;align-items:center;justify-content:center}
body .supplies-preparation .supply-stock-card .item-icon{width:100%;height:100%;max-width:48px;max-height:48px;object-fit:contain;display:block;margin:auto}
body .supplies-preparation .supply-pack-slot>b{inset:13% 12% 19%;height:auto!important}
@media(max-width:600px){.protagonist img{width:48px;height:48px;flex-basis:48px}.protagonist[data-ui-frame]{padding:10px 18px!important;gap:12px}.backstreet-screen .route-details[data-ui-frame]{padding:20px!important}}
.backstreet-screen .backstreet-map[data-ui-frame="map"]{background-image:linear-gradient(#10182730,#10182730),url(backstreet-map-dusk.webp)!important}
.backstreet-screen .backstreet-map[data-ui-frame="map"][data-route-map="camp"]{background-image:linear-gradient(#10182730,#10182730),url(backstreet-camp-dusk.webp)!important}

/* The profile landing page fits the panel; detail pages retain their own scrolling. */
.employee-info-scroll:has(.employee-page-menu){display:flex;flex-direction:column;overflow:hidden;padding:0;min-height:0}
.employee-info-scroll:has(.employee-page-menu) .employee-profile-title{flex:0 0 auto;margin-bottom:12px}
.employee-info-scroll:has(.employee-page-menu) .employee-page-content{display:flex;flex:1 1 0;min-height:0;padding-top:0}
.employee-info-scroll:has(.employee-page-menu) .employee-page-menu{flex:1;min-height:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr);align-items:stretch;padding:8px 0;gap:clamp(6px,1vw,14px)}
.employees .employee-info-scroll:has(.employee-page-menu) .employee-page-link{height:100%!important;min-height:0!important}
.employee-info-scroll:has(.employee-page-menu) .employee-action-footer{flex:0 0 64px;min-height:0;padding-top:4px;display:flex;justify-content:flex-end;align-items:center}
.employee-info-scroll:has(.employee-page-menu) .employee-action-stamp{position:relative;inset:auto;transform:rotate(-6deg);width:58px;height:58px;font-size:18px;box-sizing:border-box}
.employee-page-link .bookmark-label{font-family:'FangSong','STFangsong','KaiTi','STKaiti',serif;font-size:clamp(17px,1.8vw,26px);font-weight:600;letter-spacing:.2em;line-height:1.35;color:#dcc18c;text-shadow:0 1px 0 #503914,0 2px 5px #000;bottom:3px;white-space:nowrap}
.employee-page-link .bookmark-label::before,.employee-page-link .bookmark-label::after{content:'·';display:inline-block;font-size:.65em;color:#987947;vertical-align:middle;margin:0 .16em}
@media(max-width:760px){.employee-info-scroll:has(.employee-page-menu) .employee-page-menu{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px}.employee-info-scroll:has(.employee-page-menu) .employee-profile-title{margin-bottom:6px;gap:3px}.employee-info-scroll:has(.employee-page-menu) .employee-profile-title h3{font-size:21px}.employee-info-scroll:has(.employee-page-menu) .employee-profile-job{font-size:12px}.employee-info-scroll:has(.employee-page-menu) .employee-action-footer{flex-basis:44px}.employee-info-scroll:has(.employee-page-menu) .employee-action-stamp{width:40px;height:40px;font-size:13px}.employee-page-link .bookmark-label{font-size:16px;letter-spacing:.12em}.employee-page-link .bookmark-painting{bottom:29px}}

/* All ornamental frames use transparent outer margins, without a black mat. */
.party-screen .party-portrait[data-ui-frame]{background-color:transparent!important;box-shadow:none!important}
.party-screen .party-portrait-stage{inset:calc(var(--ui-edge,10px)*.35);box-sizing:border-box}
.party-screen .party-portrait .party-empty{position:absolute;inset:calc(var(--ui-edge,10px)*.35);height:auto;background-color:#000}
.map-viewport .map-opening{inset:calc(var(--ui-edge,12px)*.35)}
.backstreet-screen .backstreet-map[data-ui-frame="map"]{background-size:calc(100% - var(--ui-edge,12px)*.7) calc(100% - var(--ui-edge,12px)*.7)!important}
.employee-art-viewport{inset:4px;background-color:transparent}
.adaptive-frame,.map-frame-overlay{background-color:transparent!important;box-shadow:none!important;outline:0!important}
.protagonist[data-ui-frame]{background-color:transparent!important}
/* Separate decoration from the fill so the asset's dark matte does not obscure the backdrop. */
[data-ui-frame]:not([data-ui-frame="map"]):not([data-ui-frame="art"]){position:relative;background-image:linear-gradient(#000,#000)!important;background-size:calc(100% - var(--ui-edge,12px)*.7) calc(100% - var(--ui-edge,12px)*.7)!important;background-position:center!important;background-repeat:no-repeat!important}
.party-portrait[data-ui-frame]::after{display:none!important;content:none!important}
.party-screen .party-portrait[data-ui-frame]{background-image:none!important}
.employee-art .employee-art-viewport #employee-full{scale:.91;transform-origin:center bottom;translate:0 -1.5%}
.employee-art[data-employee-id="04"] .employee-art-viewport #employee-full{translate:0 .5%}
/* Separate the agent portrait from the dialogue frame. */
.expedition-bottom .protagonist{display:flex;align-items:stretch;width:min(610px,100%);height:100%;padding:0!important;gap:12px;background:none!important;border:0!important;box-shadow:none!important;isolation:auto;min-width:0}
.protagonist::before,.protagonist::after,.protagonist>.adaptive-frame{display:none!important;content:none!important}
.protagonist-portrait{position:relative;flex:0 0 auto;aspect-ratio:1;height:100%;min-height:0;box-sizing:border-box;overflow:hidden;background:#111c2c;padding:8px!important}
.protagonist .protagonist-portrait img{display:block;width:100%;height:100%;max-height:100%;object-fit:cover;object-position:center;flex:none}
.protagonist-dialogue{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;padding:14px 24px!important;background:#000}
.protagonist-dialogue small{font-size:14px;letter-spacing:2px}
.protagonist-dialogue p{font-size:clamp(16px,1.6vw,24px);margin:5px 0 0;line-height:1.35;letter-spacing:2px;overflow-wrap:anywhere}
@media(max-width:600px){.expedition-bottom .protagonist{gap:8px}.protagonist-dialogue{padding:10px 15px!important}.protagonist-dialogue small{font-size:12px}.protagonist-dialogue p{font-size:16px;letter-spacing:1px}.protagonist-portrait{padding:6px!important}}

/* Exploration status floats directly over the map. */
.backstreet-screen .route-party-bar[data-ui-frame="hud"]{background:none!important;border:0!important;box-shadow:none!important}
.backstreet-screen .route-party-bar>.ui-clean-frame{display:none!important}
.backstreet-screen .backstreet-map[data-ui-frame="map"]::before{content:""!important;display:block!important;position:absolute;inset:12px 12px auto!important;height:var(--route-hud-shade-height,100px);z-index:0;pointer-events:none;border:0!important;box-shadow:none!important;background:linear-gradient(to bottom,#000 0%,#000b 35%,#0000 100%)!important}
/* Painted icon assets supply the complete frame and symbol. */
.backstreet-screen .route-formation-toggle,.bag-trash{display:block;box-sizing:border-box;border:0!important;border-radius:0!important;background-color:transparent!important;background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important;box-shadow:none!important;padding:0!important;color:transparent!important;font-size:0!important;isolation:isolate;cursor:pointer}
.backstreet-screen .route-formation-toggle{left:0;top:0;width:58px;height:58px;z-index:14;background-image:url(ui/formation-painted-v1.webp)!important}
.bag-trash{width:46px;height:46px;flex-shrink:0;background-image:url(ui/discard-painted-v1.webp)!important}
.bag-trash svg{display:none}
.route-formation-toggle::before,.route-formation-toggle::after,.bag-trash::before,.bag-trash::after{content:none!important;display:none!important}
.route-formation-toggle:hover,.bag-trash:hover{filter:brightness(1.16)}
.route-formation-toggle:focus-visible,.bag-trash:focus-visible{outline:2px solid #dfc08a;outline-offset:2px}

/* Painted brass health gauges and gaslight stamina, in and out of combat. */
.route-formation-dialog .supplies-head h2::after{margin-top:31px}
.battle-unit-slot>.battle-health,.route-health-frame{position:relative;display:block;box-sizing:border-box;height:26px;padding:5px 18px;border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible}
.route-health-frame{height:22px;padding:4px 16px}
.battle-unit-slot>.battle-health::after,.route-health-frame::after{content:"";position:absolute;inset:0;pointer-events:none;border-style:solid;border-color:transparent;border-width:5px 18px;border-image:url(ui/health-brass-frame.webp) 48 150 48 150 / 5px 18px / 0 stretch;z-index:2}
.route-health-frame::after{border-width:4px 16px;border-image-width:4px 16px}
.battle-unit-slot>.battle-health progress,.backstreet-screen .route-health-frame progress{display:block;appearance:none;-webkit-appearance:none;width:100%;height:100%;margin:0;border:0;border-radius:0;background:#251816;box-shadow:none}
.battle-health progress::-webkit-progress-bar,.backstreet-screen .route-health-frame progress::-webkit-progress-bar{background:#251816}
.battle-health progress::-webkit-progress-value,.backstreet-screen .route-health-frame progress::-webkit-progress-value{background:linear-gradient(#c66a59,#983d37 55%,#692826)}
.battle-health progress::-moz-progress-bar,.backstreet-screen .route-health-frame progress::-moz-progress-bar{background:linear-gradient(#c66a59,#983d37 55%,#692826)}
.battle-health-value{z-index:3}
.battle-screen .tp-pips,.backstreet-screen .route-tp-pips{height:26px;gap:3px;padding:1px 0}
.battle-screen .tp-pips i,.backstreet-screen .route-tp-pips i{width:14px;height:23px;flex:0 0 14px;border:0;border-radius:0;background:transparent url(ui/tp-gas-unlit.webp) center/contain no-repeat;box-shadow:none}
.battle-screen .tp-pips i.filled,.backstreet-screen .route-tp-pips i.filled{background-image:url(ui/tp-gas-lit.webp);filter:drop-shadow(0 0 2px #efb74866)}
@media(max-width:760px){.battle-screen .tp-pips i{width:11px;height:19px;flex-basis:11px}.battle-unit-slot>.battle-health{height:24px}}

/* Clean alpha artwork replaces runtime color-keying and geometry cuts. */

/* Portrait art already has a rim; remove the additional CSS circle. */
.backstreet-screen .route-party-bar .route-avatar,.backstreet-screen .route-party-bar .route-avatar img{border:0!important;border-radius:0!important;outline:0!important;box-shadow:none!important;background:transparent!important}
.backstreet-screen .route-party-bar .route-avatar img{object-fit:contain}

/* Extend the transparent corner's own rail ends, using exactly the same scale and pixels. */

/* 栖苍提灯：仅佩戴者使用苍蓝气力灯。 */
.battle-screen .tp-pips.azure-tp i.filled,.backstreet-screen .route-tp-pips.azure-tp i.filled{filter:hue-rotate(165deg) saturate(.85) drop-shadow(0 0 2px #72caff88)}

/* Unified frame renderer: one measured SVG, no legacy bitmap backgrounds or edge layers. */
[data-ui-frame]{position:relative;isolation:isolate}
[data-ui-frame]>.adaptive-frame,[data-ui-frame]>.ornate-frame,.employee-art>.adaptive-frame{display:none!important}
.ui-clean-frame,.map-frame-overlay{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;z-index:10;overflow:hidden;pointer-events:none;background:none!important;border:0!important;filter:none!important;clip-path:none!important;mix-blend-mode:normal!important;box-shadow:none!important}
.ui-clean-frame>svg,.map-frame-overlay>svg{display:block!important;width:100%!important;height:100%!important;overflow:hidden;pointer-events:none}
.backstreet-screen .route-party-bar>.ui-clean-frame{display:none!important}

/* Shared skill-cost symbol uses the same gas lantern as TP slots. */
body .tp-cost .tp-cost-pip{display:inline-block;box-sizing:border-box;width:13px;height:21px;flex:0 0 13px;border:0;border-radius:0;background:transparent url(ui/tp-gas-lit.webp) center/contain no-repeat;transform:none;box-shadow:none;vertical-align:middle}

/* The inner rail defines one content opening, including picture-backed panels. */
[data-ui-frame]{--ui-opening:calc(var(--ui-corner,48px)*.24)}
[data-ui-frame]:not([data-ui-frame="map"]):not([data-ui-frame="art"]):not([data-ui-frame="battlefield"]){background-size:calc(100% - var(--ui-opening)*2) calc(100% - var(--ui-opening)*2)!important}
.map-viewport .map-opening,.employee-art-viewport,.party-screen .party-portrait-stage,.party-screen .party-portrait .party-empty{inset:var(--ui-opening)!important}
.backstreet-screen .backstreet-map[data-ui-frame="map"]{background-size:calc(100% - var(--ui-opening)*2) calc(100% - var(--ui-opening)*2)!important}

/* Scroll content independently; the outer SVG never moves through its children. */
[data-ui-frame][data-ui-scroll="true"]{overflow:hidden!important}
.ui-frame-scroll{min-width:0;min-height:0;max-width:100%;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#725b35 #000;flex:1 1 auto;position:relative}
.ui-frame-scroll>.ui-clean-frame{display:none!important}
.route-details>.ui-frame-scroll>small{font-size:14px;letter-spacing:3px;color:#af9976}

/* 人员动作键：蓝色烙纹与安全人形。 */
body .employee-action-footer .employee-action-stamp{border:0;border-radius:0;background:transparent url(ui/employee-action-blue-brand-v1.webp) center/contain no-repeat;color:transparent;box-shadow:none;padding:0;transform:rotate(-6deg)}
body .employee-action-footer .employee-action-stamp:hover,body .employee-action-footer .employee-action-stamp:focus-visible{background:transparent url(ui/employee-action-blue-brand-v1.webp) center/contain no-repeat;filter:brightness(1.15) drop-shadow(0 0 4px #76b7ed66);outline:0;box-shadow:none}

/* Expedition inventory scrolls without visible bars or horizontal overflow. */
.backstreet-screen .route-details:has(.route-bag-items),.backstreet-screen .route-details:has(.route-bag-items) .ui-frame-scroll{scrollbar-width:none!important;overflow-x:hidden!important}
.backstreet-screen .route-details:has(.route-bag-items)::-webkit-scrollbar,.backstreet-screen .route-details:has(.route-bag-items) .ui-frame-scroll::-webkit-scrollbar{display:none;width:0;height:0}
.backstreet-screen .route-details:has(.route-bag-items) p{white-space:normal;overflow-wrap:anywhere}

/* 仓库选中物品：沿原贴图发光，不添加矩形框。 */
body .warehouse .stock-item{transition:filter .16s ease}
body .warehouse .stock-item[aria-pressed="true"],body .warehouse .stock-item:hover,body .warehouse .stock-item:focus-visible{outline:0!important;border:0!important;box-shadow:none!important;filter:brightness(1.12) drop-shadow(0 0 3px #e6c37dcc) drop-shadow(0 0 8px #c8a76380)}

/* Stable warehouse dossier; only its inner content scrolls. */
body .warehouse .warehouse-detail{align-self:stretch;height:100%;min-height:0;max-height:100%;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden!important}
body .warehouse .warehouse-detail>.ui-frame-scroll{flex:1 1 auto;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;overflow-wrap:anywhere}

/* Keep warehouse scrolling inside the fixed panels, without compressing inventory rows. */
body .warehouse .warehouse-stock{height:100%;min-height:0;max-height:100%;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden!important}
body .warehouse .warehouse-stock>.ui-frame-scroll,body .warehouse .warehouse-detail>.ui-frame-scroll{display:block!important;flex:1 1 0;min-height:0;height:auto;max-height:none!important;overflow-y:auto!important;overflow-x:hidden;scrollbar-gutter:stable}
body .warehouse .stock-grid{grid-auto-rows:76px;align-content:start}

/* Do not reserve scrollbar space when content fits. */
body .warehouse .warehouse-stock>.ui-frame-scroll,body .warehouse .warehouse-detail>.ui-frame-scroll{scrollbar-gutter:auto}
.ui-frame-scroll{overflow-x:hidden}
#location-loot{display:flex;flex-wrap:wrap;gap:8px;min-width:0}
.location-loot-item{display:flex;flex-direction:column;align-items:center;justify-content:center;width:64px;gap:4px;text-align:center}
.location-loot-item .item-icon{width:42px;height:42px;object-fit:contain}
.location-loot-item small{font-size:11px;line-height:1.3}

/* One scroll owner per warehouse panel; layout determines height without rounding. */
body .warehouse .stock-grid{overflow:visible!important;flex:none}
body .warehouse .warehouse-stock>.ui-frame-scroll,body .warehouse .warehouse-detail>.ui-frame-scroll{max-height:none!important;margin:0;display:flow-root!important;box-sizing:border-box}
.ui-clean-frame,.map-frame-overlay{contain:strict;box-sizing:border-box!important;max-width:100%;max-height:100%}

.employee-art[data-employee-id="05"] .employee-art-viewport #employee-full{translate:4% -1.5%}

#location-loot .location-loot-item{width:64px;height:76px;padding:7px 6px 5px;border:0;background:transparent url(items/slot-frame.webp) center/100% 100% no-repeat;color:#ead8b0;cursor:help;font:inherit;gap:2px;box-sizing:border-box}
#location-loot .location-loot-item b{display:flex;align-items:center;justify-content:center;flex:1;min-height:0}
#location-loot .location-loot-item .item-icon{width:38px;height:38px}
#location-loot .location-loot-item small{font-size:10px;max-width:100%;white-space:nowrap}
#location-loot .location-loot-item:hover,#location-loot .location-loot-item:focus-visible{filter:brightness(1.15) drop-shadow(0 0 5px #bda06c80);outline:0}
.danger-meter{display:flex;gap:5px;align-items:center;flex-wrap:nowrap}
.danger-slot{width:32px;height:32px;border-radius:50%;border:1px solid #8c754b;background:radial-gradient(circle,#233246,#0c1421);box-shadow:inset 0 0 6px #000;display:block;flex:0 0 32px;box-sizing:border-box;overflow:hidden}
.danger-slot img{display:block;width:100%;height:100%;object-fit:contain}

.location-panel .location-content{overflow-x:hidden;min-width:0;box-sizing:border-box}
.location-panel dl,.location-panel dd{min-width:0;max-width:100%;box-sizing:border-box}
#location-loot{width:100%;max-width:100%;box-sizing:border-box;gap:10px 8px}
#location-loot .location-loot-item{background:none;width:64px;height:84px;padding:0;gap:4px;flex:0 0 64px}
#location-loot .location-loot-item b{background:transparent url(items/slot-frame.webp) center/100% 100% no-repeat;width:64px;height:64px;flex:0 0 64px;padding:12px;box-sizing:border-box}
#location-loot .location-loot-item .item-icon{width:38px;height:38px;max-width:100%;max-height:100%}
#location-loot .location-loot-item small{white-space:normal;font-size:10px;line-height:12px}
.danger-meter{gap:6px}
.danger-slot{border:0;background:#101b29;box-shadow:inset 0 0 0 1px #786744;width:30px;height:30px;flex-basis:30px}

/* Painted expressions stand alone; no disk crops their irregular edges. */
.danger-slot{background:none!important;border:0!important;box-shadow:none!important;border-radius:0;overflow:visible;width:32px;height:36px;flex-basis:32px}
.danger-slot:empty{display:none}
.danger-slot img{object-fit:contain}

/* Optical alignment of unframed danger expressions. */
#location-danger .danger-meter{position:relative;left:-4px;top:-6px}

/* Map supplies: three evenly spaced slots per row. */
#location-loot{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 4px;align-items:start;margin-top:8px}
#location-loot .location-loot-item{width:64px;height:84px;min-width:0;justify-self:center;gap:4px}

/* Keep settlement content inside a stationary frame, including short viewports. */
.backstreet-screen .expedition-results{width:100%;max-width:960px;min-width:0;box-sizing:border-box}
.backstreet-screen .result-panel{min-width:0;min-height:0;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;padding:22px 26px}
.backstreet-screen .result-panel-content{flex:1 1 auto;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#725b35 #000;box-sizing:border-box;overflow-wrap:anywhere}
.backstreet-screen .result-note{white-space:normal;max-width:100%;font-size:13px;line-height:1.6;margin:14px 0 0}
.backstreet-screen .result-table-scroll{max-width:100%;min-width:0;overflow-x:auto}
@media(max-width:560px){.backstreet-screen .result-panel{padding:18px}.backstreet-screen .expedition-results{gap:8px}}

/* Pawn outlines replace the shared circular position/range markers. */
.skill-range{align-items:center;gap:4px;line-height:1;vertical-align:middle}
.skill-range i,.skill-range i.on{display:inline-block;width:19px;height:24px;flex:0 0 19px;border:0;border-radius:0;background:none;box-shadow:none;padding:0;color:#647483}
.skill-range i.on{color:#c9ac6c}
.skill-range i svg{display:block;width:100%;height:100%;overflow:visible;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linejoin:round}
.skill-range i svg text{fill:currentColor;stroke:none;text-anchor:middle;font-family:Georgia,serif;font-size:8px;font-style:normal;font-weight:600}

/* Action gallery: lower the heading and reuse the event CG painted edge. */
body .employee-actions-head{padding-top:16px;padding-bottom:4px}
body .employee-action-preview{position:relative;isolation:isolate;overflow:hidden}
body .employee-action-preview::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;background:url(ui/event-cg-black-edge-painted.webp) center/100% 100% no-repeat}
/* Accessories and traits fit the personnel pane without page scrolling. */
.employee-info-scroll:has(.accessory-grid),.employee-info-scroll:has(.trait-orbit){display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
.employee-info-scroll:has(.accessory-grid) .employee-page-heading,.employee-info-scroll:has(.trait-orbit) .employee-page-heading{flex:none}
.employee-info-scroll:has(.accessory-grid) .employee-page-content,.employee-info-scroll:has(.trait-orbit) .employee-page-content{flex:1;min-height:0;display:flex;flex-direction:column;padding-top:12px}
.employee-info-scroll .trait-orbit{flex:1;width:100%;height:100%;min-height:0}
.employee-info-scroll .accessory-stats{flex:none;margin-bottom:10px;gap:6px 18px}
.employee-info-scroll .accessory-grid{flex:1;min-height:0;grid-template-rows:repeat(2,minmax(0,1fr));gap:10px}
.employee-info-scroll .accessory-grid .equipment-slot{min-height:0;gap:6px;padding:8px 10px}
.employee-info-scroll .accessory-note{flex:none;margin:10px 0 0}

/* Keep the formation picker fixed; its background must survive frame fitting. */
.party-screen .party-picker{position:fixed;inset:auto 5% 78px;max-height:calc(100dvh - 150px);box-sizing:border-box;overscroll-behavior:contain;background:#0c1723!important;box-shadow:0 0 0 100vmax #030911b8!important;isolation:isolate}
.party-screen .party-picker-head{top:0;background:#0c1723!important}
@media(max-width:760px){.party-screen .party-picker{inset:auto 3% 65px}}

/* Four formation pieces, ordered from front to rear. */
.party-screen .party-position{display:flex;align-items:center;justify-content:center;gap:9px;min-height:34px}
.party-position-piece{width:22px;height:30px;fill:#060b11;stroke:#6b665b;stroke-width:1;filter:none}
.party-position-piece.is-current{fill:#d7b873;stroke:#f5dd9e;filter:drop-shadow(0 0 4px #d7b87366)}

.expedition .expedition-top{position:relative;display:flex;align-items:center;justify-content:center;min-height:58px}
.expedition .expedition-top h2{margin:0;text-align:center}
.expedition .expedition-top #close-map{position:absolute;left:0;top:50%;transform:translateY(-50%)}
.expedition #map-home{display:grid;place-items:center;min-width:44px;padding:5px}
.expedition #map-home>svg{width:32px;height:32px;fill:none;stroke:#d1b67e;stroke-width:2.2;filter:drop-shadow(0 1px 1px #000)}

.expedition #map-home{border:0!important;border-image:none!important;background:none!important;box-shadow:none!important;outline:none;color:#d1b67e}
.expedition #map-home>.ui-clean-frame,.expedition #map-home::before,.expedition #map-home::after{display:none!important}
.expedition #map-home:hover>svg,.expedition #map-home:focus-visible>svg{filter:drop-shadow(0 0 5px #d1b67e99)}

/* Restore the black backing specifically for the map recenter control. */
.expedition #map-home{background:#000!important;background-image:none!important;border:1px solid #000!important;box-shadow:0 2px 6px #0006!important;border-radius:0}

.discard-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:16px}
.discard-entry{display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center}
.discard-entry>.item-tile{width:82px;height:82px}
.discard-quantity{display:flex;align-items:center;gap:8px;font-size:14px}
.discard-quantity button{padding:4px 10px;min-height:30px}
.warehouse-stock-heading #warehouse-discard{flex:none;margin-left:12px}

/* Recenter retains the same fitted ornamental frame as the other map tools. */
.expedition #map-home>.ui-clean-frame{display:block!important}

/* Scroll the discard inventory inside a stationary modal frame. */
body dialog.discard-dialog[open]{display:flex;flex-direction:column;width:min(780px,calc(100vw - 32px));max-height:calc(100dvh - 64px);overflow:hidden;background:#111e2b!important;box-sizing:border-box;padding:28px;gap:12px}
.discard-dialog .supplies-head,.discard-dialog>p,.discard-dialog .bag-overflow-actions{flex:none;margin:0}
.discard-dialog .discard-grid{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));align-content:start;padding:8px 6px;gap:16px 10px;overscroll-behavior:contain}
.discard-dialog .discard-entry{min-width:0;justify-content:flex-start}
.discard-dialog .discard-entry>span{font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.discard-dialog .discard-quantity{white-space:nowrap}
.discard-dialog .discard-quantity .seal{width:32px;height:32px;min-width:32px;padding:0;letter-spacing:0}
.discard-dialog .bag-overflow-actions{position:static;bottom:auto;padding:10px 0 0;background:#111e2b;align-items:center}
.discard-dialog .item-tile .item-icon{width:50px;height:50px;max-width:100%;max-height:100%}
@media(max-width:560px){body dialog.discard-dialog[open]{padding:22px 18px;max-height:calc(100dvh - 32px)}.discard-dialog .discard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* The picker title has no separate blue backing rectangle. */
.party-screen .party-picker{background:#000!important}
.party-screen .party-picker-head{background:#000!important}

/* Use a viewport backdrop instead of a clipped oversized picker shadow. */
.party-screen:has(.party-picker:not([hidden]))::after{content:"";position:fixed;inset:0;z-index:19;background:#030911b8;pointer-events:auto}
.party-screen .party-picker{box-shadow:none!important;z-index:20;overflow:hidden!important;display:flex;flex-direction:column;min-height:0}
.party-screen .party-picker[hidden]{display:none}
.party-screen .party-picker-head{position:relative;flex:none;top:auto}
.party-screen .party-choice-list,.party-screen .party-equipment{min-height:0;overflow:auto;overscroll-behavior:contain;padding:4px;flex:1 1 auto}
.party-screen .party-choice-list[hidden],.party-screen .party-equipment[hidden]{display:none}

/* Loot and victory share fixed square cells with a dedicated count recess. */
body .reward-items{display:flex!important;flex-wrap:wrap;align-items:flex-start;align-content:flex-start;justify-content:center;gap:12px;padding:4px;overflow:visible;grid-auto-rows:auto}
body .reward-items>.item-tile{display:block!important;flex:0 0 80px;width:80px!important;height:80px!important;min-width:80px;min-height:80px!important;max-width:80px;max-height:80px;box-sizing:border-box;overflow:visible;margin:0;padding:0!important;border-radius:0;line-height:normal;letter-spacing:0;background-size:100% 100%!important}
body .reward-items>.item-tile>b{position:absolute;inset:15% 15% 28%!important;display:flex;align-items:center;justify-content:center;height:auto!important;margin:0!important;padding:0!important;line-height:1}
body .reward-items>.item-tile .item-icon{width:44px!important;height:44px!important;max-width:100%;max-height:100%;object-fit:contain;margin:auto}
body .reward-items>.item-tile>small{position:absolute!important;left:12%!important;right:auto!important;top:76%!important;bottom:auto!important;width:25%!important;height:13%!important;min-width:0!important;max-width:none!important;display:flex!important;align-items:center;justify-content:center;overflow:visible!important;margin:0!important;padding:0!important;font:600 12px/1 Georgia,serif!important;font-variant-numeric:tabular-nums!important;letter-spacing:0!important;white-space:nowrap;color:#f0dfb4;background:transparent!important;border:0!important;box-shadow:none!important;text-shadow:0 1px 2px #000}
