/* Screen-sized game panels: only content columns scroll. */
html,body{height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
body{min-height:0;justify-content:start;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
body>header{padding:10px 3%}body>footer{padding:8px;font-size:12px}
.scene{height:100%;width:auto;max-width:100%;max-height:100%;aspect-ratio:1672/941;align-self:center;justify-self:center;margin:0;overflow:hidden}.scene>img{height:100%;width:100%;object-fit:contain}
[hidden]{display:none!important}
.employees,.warehouse,.party-screen,.expedition,.backstreet-screen,.battle-screen{height:100dvh;max-height:100dvh;min-height:0;overflow:hidden;padding:16px 3%;display:grid;gap:12px;box-sizing:border-box}
.employees{grid-template-rows:auto auto minmax(0,1fr) auto}.warehouse,.party-screen{grid-template-rows:auto minmax(0,1fr) auto}
.employee-head,.warehouse-head,.party-head{width:100%;margin:0 auto;padding-bottom:10px}.employee-head h2,.warehouse-head h2,.party-head h2{font-size:26px}
.employee-filters{margin:0 auto;width:100%;padding:0;gap:8px}.employee-filters .seal{padding:7px 14px}
.employee-layout,.warehouse-layout,.party-grid{width:100%;height:100%;min-height:0;margin:0 auto;gap:16px}
.employee-layout{grid-template-columns:170px minmax(0,1fr) minmax(300px,36%)}
.employee-list{min-height:0;overflow:auto;gap:10px}.employee-card{padding:12px}
.employee-art,.employee-info{height:100%;min-height:0;max-height:100%;max-width:none}.employee-art{width:100%;overflow:hidden}.employee-art img{max-height:100%;object-fit:contain}.employee-info{overflow:auto;padding:22px}
.employee-footer,.warehouse-foot,.party-foot{width:100%;margin:0 auto;padding:8px 0 0;min-height:0}.warehouse-foot p,.party-foot p{margin:0}.seal{padding:9px 18px}
.warehouse-layout{grid-template-columns:140px minmax(0,1fr) 280px}.warehouse-nav,.warehouse-stock,.warehouse-detail{min-height:0;overflow:auto}.warehouse-stock,.warehouse-detail{padding:20px}.warehouse-stock-heading{margin-bottom:14px;padding-bottom:12px}.stock-grid{gap:12px}.warehouse-foot{gap:12px}
.party-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.party-slot{min-height:0;padding:16px;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:8px;overflow:hidden}.party-slot h3{margin:0;font-size:23px}.party-portrait{height:100%;min-height:0;margin:0;display:flex;align-items:center;justify-content:center}.party-oil-portrait{height:min(90%,240px);width:auto;max-width:100%;aspect-ratio:1;flex-shrink:1}.party-oil-portrait img{width:100%;height:100%;object-fit:contain}.party-actions{gap:6px;flex-wrap:wrap}.party-actions .seal{padding:7px 10px;font-size:14px}
.party-picker{position:absolute;z-index:5;inset:auto 5% 78px;max-height:calc(100dvh - 150px);overflow:auto;margin:0 auto;padding:20px;background:#102138;box-shadow:0 0 0 100vmax #03091199}.party-picker-head{position:sticky;top:-20px;background:#102138;z-index:2;padding:10px 0}
.expedition{grid-template-rows:auto minmax(0,1fr) 82px}.expedition-top{min-height:0}.expedition-body{min-height:0;grid-template-columns:minmax(0,1fr) 280px}.map-viewport{min-height:0;height:100%}.location-panel{min-height:0;padding:22px;overflow:auto}.expedition-bottom{height:100%;min-height:0}.protagonist{height:100%;min-height:0}.protagonist img{height:100%;width:auto;object-fit:contain}.protagonist p{margin:4px 0}.map-message{overflow:auto}
.backstreet-screen{grid-template-rows:auto auto minmax(0,1fr) auto}.backstreet-top h2{font-size:25px}.backstreet-intro{margin:0;line-height:1.5}.backstreet-layout{min-height:0;height:100%;align-items:stretch;gap:18px}.backstreet-map{align-self:stretch;height:100%;min-height:0;padding:12px;display:flex;flex-direction:column}.route-board{flex:1;min-height:0;height:auto;margin:0 20px}.route-details{min-height:0;height:100%;overflow:auto;padding:18px}.route-legend{margin:0;font-size:13px}.route-status{min-height:0}
.backstreet-screen:has(.expedition-results){display:block}.expedition-results{height:100%;min-height:0;margin:0 auto;display:grid;grid-template-rows:auto auto minmax(0,1fr) minmax(0,.7fr) auto;gap:12px}.result-panel{min-height:0;overflow:auto;margin:0;padding:18px}.result-panel h3{margin-bottom:12px}.result-table th,.result-table td{padding:10px}.result-footer{margin:0}.result-loot li{padding:10px 14px}
.battle-screen{grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px;padding:12px 3%}.battle-top{padding-bottom:8px}.battle-top h2{font-size:24px}.battle-order{margin:2px 0;gap:5px}.battle-order span{padding:4px 8px}.battle-field{height:100%;min-height:0}.battle-team{min-height:0;height:100%}.battle-sprite{height:clamp(80px,calc(100dvh - 430px),310px)}.battle-unit.enemy .battle-sprite{height:clamp(70px,calc(100dvh - 450px),240px)}.battle-unit strong{margin:3px 0}.battle-unit-info{min-height:32px;font-size:12px}.battle-buff-bar{height:30px}.battle-bottom{min-height:0;max-height:34dvh;grid-template-columns:minmax(0,1fr) 280px;gap:16px;padding-top:8px;overflow:auto}.battle-controls{margin-top:5px;gap:12px;flex-wrap:nowrap}.battle-command{width:82px;flex-shrink:0}.skill-icon{width:72px;height:72px;margin-bottom:3px}.battle-command b{font-size:14px}.battle-command small{font-size:12px;margin-top:2px}.battle-desc{font-size:14px;line-height:1.5;min-height:0;margin:8px 0}.battle-log{height:100%;max-height:170px;font-size:13px}.battle-start{grid-row:2/-1;height:100%;min-height:0;width:min(800px,100%);margin:0 auto;overflow:auto;gap:12px}.battle-start p{margin:0}.battle-start>button{position:sticky;bottom:0}.battle-result{padding:12px}
dialog{max-height:calc(100dvh - 32px);overflow:auto}.employee-actions-dialog[open]{height:min(720px,calc(100dvh - 32px));display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px;padding:20px}.employee-action-preview{height:100%;min-height:0}
@media(max-height:700px){.employees,.warehouse,.party-screen,.expedition,.backstreet-screen{padding:12px 2%;gap:8px}.employee-info{padding:16px}.employee-head h2,.party-head h2,.warehouse-head h2{font-size:23px}.employee-card{padding:8px}.route-agent{width:64px;height:90px}.route-node{width:42px;height:42px}.route-details{font-size:14px}.party-slot{padding:12px;gap:5px}.battle-command{width:72px}.skill-icon{width:62px;height:62px}.battle-top h2{font-size:21px}}
@media(max-width:900px){.employee-layout{grid-template-columns:140px minmax(0,1fr) minmax(260px,38%)}.warehouse-layout{grid-template-columns:100px minmax(0,1fr) 230px}.employee-info{padding:16px}.party-slot h3{font-size:20px}.battle-bottom{grid-template-columns:minmax(0,1fr) 220px}.battle-controls{gap:6px}}
@media(max-width:600px){.employees{grid-template-rows:auto auto minmax(0,1fr) auto}.employee-layout{grid-template-columns:minmax(0,.8fr) minmax(0,1fr);grid-template-rows:60px minmax(0,1fr);gap:8px}.employee-list{grid-column:1/-1;flex-direction:row;overflow:auto}.employee-card{flex:0 0 130px}.employee-info{padding:12px;font-size:14px}.warehouse-layout{grid-template-columns:minmax(0,1fr) minmax(0,.8fr);grid-template-rows:auto minmax(0,1fr);gap:8px}.warehouse-nav{grid-column:1/-1;display:flex;overflow:auto}.warehouse-stock,.warehouse-detail{padding:12px}.stock-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.warehouse-foot,.party-foot{flex-direction:row;font-size:12px}.party-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px}.party-slot{padding:10px;gap:3px}.party-slot h3{font-size:17px}.party-job,.party-position{font-size:12px}.party-actions .seal{font-size:12px;padding:5px}.expedition-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 32%;gap:8px}.expedition{grid-template-rows:auto minmax(0,1fr) 65px}.location-panel{padding:12px}.backstreet-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 30%;gap:8px}.route-details{padding:12px}.battle-bottom{grid-template-columns:minmax(0,1fr);max-height:36dvh}.battle-log{display:none}.battle-command{width:65px}.skill-icon{width:56px;height:56px}.battle-sprite{height:clamp(65px,calc(100dvh - 370px),250px)}.battle-unit.enemy .battle-sprite{height:clamp(60px,calc(100dvh - 390px),200px)}}

/* Keep the ornamental frames independent from content sizing. */
.gilt-panel{position:relative;min-width:0}.gilt-panel>.adaptive-frame{position:absolute;inset:4px;display:block;width:auto;height:auto;overflow:visible}.gilt-panel>.adaptive-frame .frame-corner{max-width:20%;max-height:22%;}.party-slot{padding:24px 20px;overflow:visible;gap:10px}.party-grid{padding:5px;box-sizing:border-box}.party-position{padding:0 0 8px;letter-spacing:2px}.party-portrait{overflow:hidden;border-color:#b9945533}.party-portrait .party-battle-mini{width:100%;height:100%;object-fit:contain;object-position:center bottom;transform:none}.party-slot .frame-flourish{width:65px;height:18px}.party-actions{justify-content:center}.party-slot h3,.party-job{position:relative;z-index:1;text-align:center}
/* Keep all commands in the full-width lower action area. */
.battle-screen{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto}.battle-top,.battle-order,.battle-field,.battle-bottom,.battle-result{grid-column:1}.battle-field{grid-row:3}.battle-bottom{grid-row:4;display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,24%);height:auto;max-height:32dvh;gap:18px;padding:12px 16px;border:1px solid #9a7b4955;background:#101f30;overflow:auto}.battle-bottom>div:first-child{display:grid;grid-template-columns:auto minmax(0,1fr) 170px;grid-template-rows:auto auto auto;align-items:center;gap:6px 20px}.battle-status{grid-column:1/-1;font-size:14px}.battle-controls{grid-column:1;grid-row:2/4;margin:0;gap:12px}.battle-desc{grid-column:2;grid-row:2;margin:0;line-height:1.5}.battle-action-detail{grid-column:2;grid-row:3;margin:0;line-height:1.5}.battle-bottom [data-confirm]{grid-column:3;grid-row:2/4;width:100%;min-height:48px;margin:0;font-size:16px}.battle-log{height:auto;min-height:0;max-height:180px}.battle-sprite{height:clamp(90px,calc(100dvh - 390px),360px)}.battle-unit.enemy .battle-sprite{height:clamp(80px,calc(100dvh - 420px),290px)}.battle-start{grid-column:1;grid-row:2/-1}.battle-result{grid-row:4}
@media(max-width:1000px){.battle-bottom{grid-template-columns:minmax(0,1fr)}.battle-log{display:none}.battle-bottom>div:first-child{grid-template-columns:auto minmax(0,1fr) 140px;gap:6px 12px}}
@media(max-width:760px){.battle-bottom>div:first-child{grid-template-columns:auto minmax(0,1fr)}.battle-controls{grid-row:2/5}.battle-desc{grid-column:2;grid-row:2}.battle-action-detail{grid-column:2;grid-row:3}.battle-bottom [data-confirm]{grid-column:2;grid-row:4;min-height:38px}.battle-bottom{padding:8px;gap:8px}.battle-controls{gap:4px}.battle-command{width:60px}.skill-icon{width:52px;height:52px}.battle-desc,.battle-action-detail{font-size:12px}}
.route-party-bar{display:flex;flex:0 0 auto;gap:12px;align-items:center;justify-content:flex-start;padding:10px 14px;margin-top:12px;border:1px solid #94764c88;background:#0d2034;overflow-x:auto;z-index:4}.route-party-bar .route-member{flex:1 0 120px;min-width:0;max-width:190px;display:flex;gap:8px;align-items:center;margin:0}.route-party-bar .route-member img{width:42px;height:42px;flex-shrink:0;border-radius:50%;object-fit:cover;border:1px solid #ba985e}.route-party-bar .route-member>div{flex:1;min-width:0}.route-party-bar strong{font-size:14px;display:block;white-space:nowrap}.route-party-bar progress{width:100%;height:8px;display:block;margin:4px 0;accent-color:#91b59e}.route-party-bar small{font-size:12px;white-space:nowrap}.route-board{width:auto;max-width:none}.backstreet-map{overflow:hidden}.route-party-bar{align-self:stretch}.backstreet-map .adaptive-frame{z-index:1}
@media(max-width:760px){.battle-screen{grid-template-columns:1fr;grid-template-rows:auto auto minmax(0,1fr) auto}.battle-bottom{max-height:38dvh}.party-slot{padding:16px 12px;gap:5px}.route-party-bar{padding:7px;gap:8px}.route-party-bar .route-member{flex-basis:110px}.route-party-bar .route-member img{width:32px;height:32px}}

/* Restore the employee roster and constrain decorations to their own panels. */
.employee-layout{grid-template-columns:235px minmax(280px,1fr) minmax(360px,440px)}.employee-card{box-sizing:border-box;grid-template-columns:68px minmax(0,1fr);gap:12px;padding:14px;flex:0 0 auto}.employee-card strong,.employee-card small{white-space:nowrap}.employee-card strong{font-size:20px}.employee-info{padding:26px}.employee-profile-title{flex-wrap:wrap}.employee-page-menu{grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;gap:10px;padding:20px 0}.employees .employee-page-link,.employees .employee-page-link:nth-child(even){height:200px;min-height:200px;box-sizing:border-box;justify-content:flex-start;gap:18px;padding:24px 6px 38px;transform:none;line-height:1.4;font-size:19px}.employee-page-link .bookmark-icon{flex:0 0 44px;margin:0}.employee-layout,.employee-art,.employee-info{box-sizing:border-box}.employee-footer{box-sizing:border-box}.employees{grid-template-rows:auto auto minmax(0,1fr) auto}
.party-picker>.adaptive-frame{display:none}.party-picker{border:1px solid #b99455;padding:20px;box-sizing:border-box}.party-picker:before{pointer-events:none}.party-choice-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.party-choice{width:100%;min-width:0;grid-template-columns:80px minmax(0,1fr)}.party-choice img.party-choice-mini{width:80px;height:110px;border:0;object-fit:contain;object-position:center bottom;transform:scaleX(-1);border-radius:0}.party-portrait .party-battle-mini,.party-portrait:hover .party-battle-mini{transform:scaleX(-1)}.battle-picks img.battle-pick-mini{object-fit:contain;object-position:center bottom;transform:scaleX(-1)}
.location-kicker:empty,#map-summary:empty{display:none}
/* The initiative track is outside the full-width lower command panel. */
.battle-screen{grid-template-columns:110px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;column-gap:14px}.battle-top{grid-column:1/-1;grid-row:1}.battle-order{grid-column:1;grid-row:2;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:10px;margin:10px 0 0;padding:12px 4px;min-height:0;overflow:auto;border-right:1px solid #947a4e55;background:linear-gradient(90deg,transparent,#15283a55)}.order-diamond{display:block;flex:0 0 18px;width:18px;height:18px;box-sizing:border-box;transform:rotate(45deg);border:2px solid #f3d392;box-shadow:0 0 8px #dcb46a;margin:3px 0 12px}.battle-order .order-token{width:100%;box-sizing:border-box;text-align:center;padding:9px 3px;font-size:13px;flex-shrink:0;transition:transform .2s;background:#132538;border-color:#6f634d}.battle-order .order-token.next{border-color:#ecd29b;color:#ffe2a9;box-shadow:0 0 10px #dfb86444}.battle-order .order-token.enemy{color:#d2a293}.battle-field{grid-column:2;grid-row:2;position:relative;padding-bottom:34px;box-sizing:border-box}.battle-round{position:absolute;left:10px;bottom:5px;font-size:15px;color:#e8ce98;letter-spacing:2px;z-index:3}.battle-bottom,.battle-result{grid-column:1/-1;grid-row:3}.battle-start{grid-column:1/-1;grid-row:2/-1}.battle-unit .battle-sprite canvas{height:75%}.battle-unit.current .battle-sprite::after,.battle-unit.target .battle-sprite::after{top:25%}
.cinema-blunt-impact{position:absolute;width:70px;height:70px;border:3px solid #e7d6b8;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 14px #e7d6b8;animation:blunt-impact .35s ease-out forwards}@keyframes blunt-impact{from{opacity:1;scale:.3}to{opacity:0;scale:1.4}}
@media(max-width:1100px){.employee-layout{grid-template-columns:210px minmax(200px,1fr) minmax(300px,36%)}.employee-info{padding:18px}.employee-card{padding:10px;gap:8px}.employee-page-menu{gap:6px}.party-choice-list{grid-template-columns:repeat(2,minmax(0,1fr))}.employee-card strong{font-size:18px}.employee-page-link{letter-spacing:1px}}
@media(max-width:760px){.battle-screen{grid-template-columns:74px minmax(0,1fr);column-gap:6px}.battle-order .order-token{font-size:11px;padding:7px 2px}.battle-field{padding-bottom:28px}.battle-round{font-size:12px}.employee-layout{grid-template-columns:170px minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr)}.employee-list{grid-column:1;grid-row:1/-1;flex-direction:column}.employee-art{grid-column:2;grid-row:1}.employee-info{grid-column:2;grid-row:2}.employee-page-menu{grid-template-columns:repeat(2,minmax(0,1fr))}.employees .employee-page-link,.employees .employee-page-link:nth-child(even){height:120px;min-height:120px;padding:12px 4px 22px;font-size:15px;gap:8px}.employee-card strong{font-size:16px}.employee-card small{font-size:12px}.employee-card{grid-template-columns:50px minmax(0,1fr)}.employee-mini-portrait{width:50px}.party-choice{grid-template-columns:60px minmax(0,1fr)}.party-choice img.party-choice-mini{width:60px;height:90px}.party-choice-list{gap:8px}.party-picker{inset:auto 3% 65px;padding:12px}}

.battle-screen{grid-template-columns:64px minmax(0,1fr)}.battle-order{padding:10px 4px;gap:8px}.battle-order .order-token{width:44px;height:44px;padding:2px;border-radius:50%;overflow:hidden}.order-token canvas{width:100%;height:100%;object-fit:contain;display:block}.order-token.ally canvas{transform:scaleX(-1)}.battle-order .order-token.next{border-width:2px}.battle-unit-slot[data-unit-id="04"] .battle-sprite canvas{height:86.25%}.battle-unit-slot[data-unit-id="04"] .battle-sprite::after{top:13.75%}
.battle-friendly-prompt{position:fixed;left:50%;top:45%;transform:translate(-50%,-50%);z-index:140;max-width:90vw;box-sizing:border-box;white-space:nowrap;padding:24px 42px;color:white;font-size:22px;text-align:center;background:#000b;backdrop-filter:blur(10px);box-shadow:0 0 28px 16px #0009;border-radius:18px;pointer-events:none;animation:friendly-prompt-in .15s ease-out}@keyframes friendly-prompt-in{from{opacity:0}to{opacity:1}}
.cinema-support-effect{position:absolute;transform:translate(-50%,-50%);z-index:5;pointer-events:none;animation:support-arrive 1.05s ease-out forwards;color:#e0c48c;filter:drop-shadow(0 0 8px #d1a852)}.cinema-support-effect svg{width:100%;height:100%;fill:#172c3b66;stroke:currentColor;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}.cinema-support-effect.cover{color:#a6d2ef;filter:drop-shadow(0 0 10px #70b5e0)}.clock-hand{transform-origin:60px 60px;animation:clock-expedite .8s ease-out}.battle-cinema.returning .cinema-support-effect{display:none}@keyframes clock-expedite{from{transform:rotate(-160deg)}to{transform:rotate(0)}}@keyframes support-arrive{0%{opacity:0;scale:.6}20%{opacity:1;scale:1}75%{opacity:1}100%{opacity:0;scale:1.15}}@media(max-width:760px){.battle-screen{grid-template-columns:50px minmax(0,1fr)}.battle-order .order-token{width:36px;height:36px}.battle-friendly-prompt{font-size:16px;padding:18px 22px}}

/* Compact roster, soft mist prompt, and final battle size adjustment. */
@media(min-width:761px){.employee-layout{grid-template-columns:185px minmax(240px,1fr) minmax(340px,36%)}.employee-list .employee-card{grid-template-columns:48px minmax(0,1fr);gap:8px;padding:12px 10px}.employee-list .employee-mini-portrait{width:48px;height:60px}.employee-list .employee-mini-crop{inset:4px}.employee-list .employee-card strong{font-size:18px}.employee-list .employee-card small{font-size:12px}}
.battle-unit-slot[data-unit-id="04"] .battle-sprite canvas{height:75.9%}.battle-unit-slot[data-unit-id="04"] .battle-sprite::after{top:24.1%}
.battle-friendly-prompt{background:none;backdrop-filter:none;box-shadow:none;border:0;border-radius:0;isolation:isolate;padding:24px 42px;text-shadow:0 2px 5px #000}.battle-friendly-prompt:before{content:"";position:absolute;z-index:-1;inset:-28px -70px;background:radial-gradient(ellipse at 45% 52%,#000e 0%,#000b 30%,#0007 48%,transparent 72%),radial-gradient(ellipse at 65% 43%,#0009,transparent 65%);filter:blur(18px);border:0;box-shadow:none;pointer-events:none}
@media(max-width:760px){.battle-friendly-prompt{padding:20px}.battle-friendly-prompt:before{inset:-24px -32px}}

.music-library{width:min(560px,calc(100vw - 32px));box-sizing:border-box;padding:28px;color:#e8d4ad;background:radial-gradient(ellipse at top,#294056,#0d1c2e 70%);border:1px solid #c5a16a;border-radius:4px;box-shadow:0 20px 90px #000a,inset 0 0 0 6px #12243a,inset 0 0 0 7px #a9874e55;font-family:inherit}.music-library::backdrop{background:#030a13b8;backdrop-filter:blur(6px)}.music-library-head{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #b9945566;padding-bottom:18px}.music-library-head small{font-size:12px;letter-spacing:3px;color:#abbbca}.music-library h2{margin:8px 0 0;font-size:30px;font-weight:400;letter-spacing:8px}.music-library-close{width:34px;height:34px;border:1px solid #b9945555;background:#0e2033;color:#d7bc86;font:inherit;font-size:24px;cursor:pointer}.music-library-intro{font-size:14px;color:#b6c4ce;margin:20px 0}.music-track-list{display:grid;gap:14px}.music-track{position:relative;display:flex;align-items:center;gap:18px;width:100%;padding:18px;box-sizing:border-box;text-align:left;color:#dbc7a6;background:linear-gradient(110deg,#14283d,#102035);border:1px solid #8f774e77;font:inherit;cursor:pointer;transition:background .2s,border-color .2s}.music-track:before{content:"";position:absolute;inset:5px;border:1px solid #b9945522;pointer-events:none}.music-track[aria-pressed=true]{background:linear-gradient(110deg,#30485d,#172a40);border-color:#e5c18a;box-shadow:inset 3px 0 #dbb56f}.music-disc{display:grid;place-items:center;width:62px;height:62px;flex-shrink:0;border-radius:50%;background:repeating-radial-gradient(circle,#243444 0 3px,#101c28 4px 5px);border:2px solid #a78b5d;box-shadow:0 0 0 3px #071323}.music-disc i{display:grid;place-items:center;font-style:normal;width:25px;height:25px;border-radius:50%;background:#b29560;color:#102133;font-size:20px}.music-disc.original i{background:#8c9ea9}.music-track-copy{flex:1;min-width:0}.music-track-copy strong{display:block;font-size:23px;font-weight:400;letter-spacing:2px}.music-track-copy small{display:block;margin-top:7px;font-size:12px;letter-spacing:2px;color:#aabcc9}.music-track-state{font-size:12px;color:#d1b580;white-space:nowrap}.music-silence{display:flex;align-items:center;gap:12px;width:100%;box-sizing:border-box;margin-top:20px;padding:16px 18px;background:#0c1b2c;color:#afbfca;border:1px solid #64748455;font:inherit;text-align:left;cursor:pointer}.music-silence strong{font-size:16px;font-weight:400;letter-spacing:2px}.music-silence small{margin-left:auto;font-size:12px}.music-silence[aria-pressed=true]{border-color:#d9bb83;color:#e6cfa6;background:#263b4d}.music-library-foot{display:flex;justify-content:space-between;gap:12px;margin-top:22px;font-size:12px;color:#b7aa8e}.music-library button:focus-visible{outline:2px solid #f0d396;outline-offset:4px}.music-track:hover,.music-silence:hover{border-color:#d4b47b}@media(max-width:500px){.music-library{padding:22px}.music-disc{width:48px;height:48px}.music-track{gap:12px;padding:16px 12px}.music-track-copy strong{font-size:20px}.music-silence{flex-wrap:wrap}.music-silence small{margin-left:0}.music-library-intro{font-size:13px}}

@media(min-width:761px){.employee-layout{grid-template-columns:185px clamp(250px,26vw,430px) minmax(0,1fr)}.employee-info{min-width:0}.employee-art{width:100%}}

/* Keep stock headings clear of the ornamental corners. */
.warehouse-stock-heading{padding-left:24px;padding-right:24px;box-sizing:border-box}.music-library h2{margin:0}.music-library-head form{margin:0;display:flex;align-items:center}.music-library-close{display:grid;place-items:center;padding:0;line-height:1;box-sizing:border-box}

.employees{grid-template-rows:auto auto minmax(0,1fr)}.employee-head{justify-content:flex-start;gap:24px}.employee-head>span{margin-left:auto}.employee-head #close-employees{flex-shrink:0}@media(max-width:600px){.employee-head{gap:12px;flex-wrap:wrap}.employee-head #close-employees{padding:8px 12px;font-size:14px}.employee-head>span{font-size:12px}}

.stock-count{font-weight:700;font-size:16px;color:#f2d49a}.employee-head #close-employees{order:3}.employee-profile-title{flex-direction:column;align-items:flex-start;gap:0}.employee-profile-title h3{margin-bottom:6px}.employee-profile-title .detail-badge{border:0;box-shadow:none;background:none;padding:0;margin:0 0 16px;font-size:16px;color:#c3b18e}.employee-action-preview canvas{width:100%;height:100%;object-fit:contain}

.employee-filters #close-employees{margin-left:auto}.employee-filters{align-items:center}

.employee-skills-list{display:grid;gap:20px}.employee-skill-entry{padding:0 0 20px;border-bottom:1px solid #b9945544}.employee-skill-title{display:flex;align-items:center;gap:14px}.employee-skill-title img{width:58px;height:58px;object-fit:contain}.employee-skill-title small{color:#a9bac9;font-size:12px;letter-spacing:2px}.employee-skill-title h5{margin:5px 0 0;font-size:23px;font-weight:500;letter-spacing:3px;color:#edcc8c}.employee-info .employee-skill-entry p{margin:12px 0;font-size:15px;line-height:1.8}.employee-info .employee-skill-entry dl{grid-template-columns:44px minmax(0,1fr);gap:8px 14px;border:0;margin:0;padding:0;font-size:13px;line-height:1.7}.employee-skill-entry:last-child{border-bottom:0}

.accessory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.accessory-grid .equipment-slot,.accessory-grid .equipment-slot:first-child{grid-column:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;padding:20px 12px;font:inherit;cursor:pointer;color:#ead0a0}.accessory-grid .equipment-slot strong{margin:0;font-size:17px;color:#e5cc9a}.accessory-grid small{color:#aabccd;font-size:12px}.accessory-mark{font-size:30px;font-weight:400;color:#c6a36c}.accessory-stats{display:flex;flex-wrap:wrap;gap:12px 24px;margin-bottom:20px;font-size:14px;color:#adbac8}.accessory-stats strong{color:#edcc8c}.employee-info .accessory-note{font-size:13px;line-height:1.7}.accessory-dialog{width:min(560px,90vw);max-height:85dvh;box-sizing:border-box;overflow:auto;padding:24px;background:radial-gradient(ellipse at top,#294056,#101f33);color:#e3cfa6;border:3px double #b18b4e;font-family:inherit}.accessory-dialog::backdrop{background:#020711bb;backdrop-filter:blur(5px)}.accessory-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.accessory-dialog h2{font-size:22px;font-weight:500;margin:0}.accessory-options{display:grid;gap:12px;margin:24px 0}.accessory-option{display:flex;align-items:center;gap:16px;text-align:left;font:inherit;background:#14263d;color:#e2c594;border:1px solid #ac8b55;padding:16px;cursor:pointer}.accessory-option>b{font-size:28px;font-weight:400}.accessory-option>span{flex:1}.accessory-option strong,.accessory-option small{display:block}.accessory-option small{font-size:12px;color:#b0bdca;margin-top:6px}.accessory-option[aria-pressed=true]{background:#304860;border-color:#efd398}.accessory-option:disabled{opacity:.4;cursor:default}.accessory-dialog button:focus-visible,.accessory-grid button:focus-visible{outline:2px solid #f1d298;outline-offset:3px}
/* TP and positional combat */
.battle-team{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:end;gap:6px}.battle-team .battle-unit-slot{width:100%}.battle-empty-slot{height:100%;min-width:0;display:flex;align-items:end;justify-content:center;padding-bottom:40px}.battle-empty-position{width:100%;min-height:70px;background:#14253440;border:1px dashed #aa8d5a88;border-radius:50%;color:#efce92;font:inherit;font-size:12px}.battle-empty-position small{display:block;margin:6px}.battle-empty-position:disabled{opacity:.18;min-height:35px;cursor:default}.battle-empty-position[aria-pressed=true]{border-color:#ffe2a8;box-shadow:0 0 12px #eac16c66}.battle-unit.in-range progress{box-shadow:0 0 7px #e4c08155}.battle-position{font-size:11px;color:#cfb886}.tp-pips{display:flex;align-items:center;justify-content:center;gap:3px;height:18px}.tp-pips i{display:block;width:9px;height:11px;border:1px solid #73929f;border-radius:2px;background:#0a1724}.tp-pips .filled{background:#d8ad61;border-color:#f4d398;box-shadow:0 0 4px #d5b67188}.skill-range{display:inline-flex;gap:4px;vertical-align:middle}.skill-range i{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;border:1px solid #77849266;color:#71818d;font-style:normal;font-size:11px;background:#0c1927}.skill-range i.on{background:#b89556;color:#081421;border-color:#f0cc89}.battle-range-detail{font-size:12px;line-height:1.7}.battle-bottom{max-height:40dvh;grid-template-columns:minmax(0,1fr) minmax(160px,20%)}.battle-bottom>div:first-child{grid-template-columns:minmax(0,1fr) 160px;grid-template-rows:auto auto auto auto auto;gap:5px 16px}.battle-controls{grid-column:1/-1;grid-row:2;gap:12px;overflow-x:auto;padding:2px 3px 8px}.battle-desc{grid-column:1;grid-row:3}.battle-range-detail{grid-column:1;grid-row:4}.battle-action-detail{grid-column:1;grid-row:5}.battle-bottom [data-confirm]{grid-column:2;grid-row:3/6}.battle-sprite{height:clamp(80px,calc(100dvh - 475px),300px)}.battle-unit.enemy .battle-sprite{height:clamp(70px,calc(100dvh - 475px),260px)}.battle-command small{min-height:28px}.skill-system-note{font-size:13px;line-height:1.8;color:#b9c4cd}
@media(max-width:760px){.battle-bottom{grid-template-columns:minmax(0,1fr);max-height:44dvh;padding:8px}.battle-log{display:none}.battle-bottom>div:first-child{grid-template-columns:minmax(0,1fr) 100px;gap:4px 8px}.battle-controls{grid-row:2;grid-column:1/-1;gap:6px}.battle-command{width:62px}.skill-icon{height:50px;width:50px}.battle-command b{font-size:12px}.battle-command small{font-size:10px}.battle-desc{grid-row:3;grid-column:1}.battle-range-detail{grid-row:4;grid-column:1;font-size:10px}.battle-action-detail{grid-row:5;grid-column:1}.battle-bottom [data-confirm]{grid-column:2;grid-row:3/6;font-size:13px}.tp-pips{gap:2px}.tp-pips i{width:7px;height:9px}.battle-unit strong{font-size:11px}.battle-unit-info{font-size:10px}.battle-position{font-size:9px}.battle-sprite{height:clamp(70px,calc(100dvh - 425px),250px)}.battle-unit.enemy .battle-sprite{height:clamp(65px,calc(100dvh - 425px),220px)}}
@media(max-height:600px){.battle-screen{overflow:auto}.battle-field{min-height:235px}.battle-bottom{max-height:none}.battle-sprite{height:90px}.battle-unit.enemy .battle-sprite{height:85px}}
.battle-position-holder{position:relative;min-width:0}.battle-corpse-position{position:absolute;left:4px;right:4px;bottom:15px;padding:8px 2px;background:#172a3d;border:1px solid #d0ac69;color:#eed096;font:inherit;font-size:12px}.battle-corpse-position[aria-pressed=true]{box-shadow:0 0 10px #e7c87988}

/* Compact command panel without the action-status heading. */
.battle-bottom>div:first-child{grid-template-rows:auto auto auto auto}.battle-controls{grid-row:1}.battle-desc{grid-row:2}.battle-range-detail{grid-row:3}.battle-action-detail{grid-row:4}.battle-bottom [data-confirm]{grid-row:2/5}

.cinema-support-effect.expedite{color:#8bceff;filter:drop-shadow(0 0 10px #4da9f3)}.cinema-support-effect.expedite svg{fill:#14385966}

.backstreet-map{overflow-x:auto}.route-board{min-width:850px;min-height:280px;margin:12px 34px 22px;flex:1 0 auto}.route-node{width:38px;height:38px}.route-node b{width:88px;font-size:14px;top:calc(100% + 7px)}.route-node.event span{font-family:serif}.route-agent{width:54px;height:76px}.route-event{border-top:1px solid #88734e66;padding-top:12px}.route-event h4{font-size:18px;margin:6px 0}.route-event p,.route-event-note{font-size:15px;line-height:1.7}.route-event button{white-space:normal;padding:12px 8px;letter-spacing:1px}.route-event button small{display:block;font-size:13px;font-weight:normal;line-height:1.6;margin-top:6px;letter-spacing:0}.route-event button:disabled{opacity:.45;cursor:default}.route-party-bar{position:sticky;left:0}.backstreet-map .adaptive-frame{pointer-events:none}

.battle-unit-slot[data-unit-id="red-crown"] .battle-sprite canvas{transform:scale(1.698);transform-origin:center bottom;position:relative;z-index:2;pointer-events:none}.battle-unit-slot[data-unit-id="red-crown"] .battle-sprite{overflow:visible}.route-node[data-node="boss"]{border-color:#b06b60;background:#4b252c}.route-node[data-node="boss"] b{color:#e5afa0}
.battle-top .battle-round{position:static;bottom:auto;left:auto;font-size:18px;letter-spacing:2px}.enemy-intent-mark{display:block;width:30px;height:30px;margin:6px auto 0;border:1px solid #b97365;border-radius:50%;background:#281b20;color:#efad91;font:inherit;font-size:22px;line-height:1;cursor:help;box-shadow:0 0 8px #c4543825}.enemy-intent-mark[aria-expanded=true]{border-color:#ff9d86;box-shadow:0 0 12px #ed675966}.enemy-intent-tooltip{position:fixed;z-index:150;width:min(300px,calc(100vw - 32px));box-sizing:border-box;padding:15px 18px;border:1px solid #965f53;background:#111721ef;color:#ded2bd;box-shadow:0 8px 25px #000a;pointer-events:none}.enemy-intent-tooltip strong{color:#f0b29a;font-size:16px}.enemy-intent-tooltip p{font-size:14px;line-height:1.7;margin:8px 0}.enemy-intent-tooltip small{color:#bca78c;font-size:13px;line-height:1.6}.enemy-intent-arrows{position:fixed;inset:0;width:100vw;height:100dvh;z-index:145;pointer-events:none;overflow:visible}.enemy-intent-arrows>path{fill:none;stroke:#f46c61;stroke-width:3;filter:drop-shadow(0 0 4px #b72c25)}

/* Fit eight initiative portraits without scrolling, including short laptop viewports. */
.battle-order{display:grid;grid-template-columns:1fr;grid-template-rows:12px repeat(8,minmax(0,1fr));gap:3px;align-items:center;justify-items:center;align-content:start;margin:0;padding:4px 2px;box-sizing:border-box;height:100%;max-height:394px;overflow:visible}
.battle-order .order-diamond{width:10px;height:10px;margin:0;flex:none}
.battle-order .order-token{width:auto;height:100%;max-height:44px;max-width:44px;min-height:0;aspect-ratio:1;padding:1px;box-sizing:border-box}
@media(max-width:760px){.battle-order{max-height:330px}.battle-order .order-token{width:auto;height:100%;max-width:36px;max-height:36px}}

/* Shared ground line, inset health values and head-level intent controls. */
.battle-unit-slot{position:relative}.battle-unit-info{display:none}
.battle-unit-slot[data-unit-id="red-crown"] .battle-sprite canvas{position:absolute;left:50%;transform:translateX(-50%) scale(1.698);transform-origin:center bottom}
.battle-health{display:block;position:relative;width:100%;height:20px;background:#000;border:1px solid #9c7d54;box-sizing:border-box;overflow:hidden}
.battle-health progress{display:block;width:100%;height:100%;margin:0;border:0;border-radius:0;appearance:none;background:#000}
.battle-health progress::-webkit-progress-bar{background:#000}.battle-health progress::-webkit-progress-value{background:#8c403c}.battle-health progress::-moz-progress-bar{background:#8c403c}
.battle-health-value{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:12px;line-height:1;text-shadow:0 1px 2px #000,0 0 3px #000;white-space:nowrap}
.enemy-intent-mark{position:absolute;left:50%;transform:translateX(-50%);margin:0;z-index:5}
.bag-icon{display:grid;place-items:center;color:#d6ba82;font-size:34px;background:#152233}.battle-controls .battle-supply-button{margin:0;align-self:flex-start}
.battle-retreat-result{position:absolute;left:50%;top:35%;transform:translateX(-50%);z-index:180;padding:24px 32px;background:#0e1b2bf5;border:1px solid #b49359;color:#ead5ae;text-align:center;box-shadow:0 12px 40px #000b}.battle-retreat-result strong{font-size:40px}.battle-retreat-result p{font-size:16px}

.enemy-tp-spacer{display:block;height:18px}

/* Scroll contents inside stable warehouse frames, rather than scrolling the ornamental frame. */
.warehouse .warehouse-stock,.warehouse .warehouse-detail{position:relative;overflow:hidden;padding:24px;min-width:0}.warehouse .warehouse-stock{display:flex;flex-direction:column}.warehouse .stock-grid{overflow:auto;min-height:0;flex:1;padding:4px 6px 12px}.warehouse .warehouse-detail{overflow-y:auto;border:1px solid #a88a55;box-shadow:inset 0 0 0 4px #17283b,inset 0 0 0 5px #79623c}.warehouse .warehouse-detail>.adaptive-frame{display:none}.warehouse .warehouse-nav{padding:6px;min-width:0}.warehouse .stock-card{min-width:0}.warehouse .adaptive-frame{pointer-events:none}

/* Skill descriptions use the full command-panel width and wrap naturally. */
.battle-screen .battle-bottom .battle-desc{grid-column:1/-1;width:100%;box-sizing:border-box;white-space:normal;overflow:visible;overflow-wrap:anywhere;min-height:3em;line-height:1.6;padding:8px 12px;margin:4px 0;background:#0a172580;border:1px solid #b2945c40}
.battle-screen .battle-bottom>div:first-child{grid-template-columns:minmax(0,1fr)}
.battle-screen .battle-bottom .battle-controls{grid-column:1/-1}
.battle-screen .battle-bottom .battle-range-detail,.battle-screen .battle-bottom .battle-action-detail{grid-column:1/-1}

.battle-top .battle-playback-actions{display:flex;gap:10px;align-items:center}.battle-top .battle-auto{position:static;transform:none;font-size:14px;padding:8px 12px}.battle-top .battle-exit-actions{margin-left:auto}.route-party-bar{border:0;background:transparent;box-shadow:none}.route-party-bar progress{accent-color:#b74746}.route-party-bar progress::-webkit-progress-bar{background:#291b20}.route-party-bar progress::-webkit-progress-value{background:#b74746}.route-party-bar progress::-moz-progress-bar{background:#b74746}

/* Raise the expedition HP row and fade the map header into the artwork. */
.backstreet-screen .backstreet-map{position:relative;isolation:isolate}.backstreet-screen .route-party-bar{margin-top:0}.backstreet-screen .backstreet-map.gilt-panel::before{content:"";display:block;position:absolute;inset:0 0 auto;height:96px;z-index:-1;border:0;box-shadow:none;pointer-events:none;background:linear-gradient(to bottom,#000e 0%,#0009 42%,#0000 100%)}

/* Keep the TP row close to the battlefield edge on both sides. */
.battle-screen .battle-field{padding-bottom:4px}.battle-screen .battle-team{align-items:flex-end}.battle-screen .tp-pips{margin-bottom:0}

/* Keep card ornaments beneath the replacement picker and its dimmer. */
.party-grid{isolation:isolate}
.party-screen .party-picker{z-index:20}
