/* In-game spatial order; no fixed-height text or nested scrolling. */
.upgrade-workspace{--upgrade-gold:#dec77c;display:grid;grid-template-columns:minmax(210px,1.05fr) minmax(0,3fr) minmax(170px,.82fr);gap:20px;align-items:start;padding:20px;background:linear-gradient(120deg,#10151def,#21252ce8 56%,#10151dec);border:1px solid #756a4c;border-radius:5px;color:#e7e1d1}
.upgrade-workspace>*{min-width:0}.upgrade-left{background:#12121bcc;border:1px solid #6d644b}.upgrade-capacity{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;padding:12px;background:#4343446b;color:var(--upgrade-gold);gap:6px}.upgrade-capacity>span{font-size:18px}.upgrade-capacity>strong{font-size:23px;color:#fff5d2}.upgrade-capacity>small{width:100%;font-size:11px;line-height:1.6}.upgrade-capacity-track{flex-basis:100%;height:5px;background:#282a33}.upgrade-capacity-track>i{display:block;height:100%;background:var(--upgrade-gold)}
.upgrade-stat-group{padding:10px 9px 8px}.upgrade-stat-group h4{font-size:15px;color:var(--upgrade-gold);margin:0 0 4px}.upgrade-stat-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px;line-height:1.6;padding:3px 5px;overflow-wrap:anywhere;font-size:12px}.upgrade-stat-row:nth-child(even){background:#2b2c354f}.upgrade-stat-row>strong{color:#ffedb9;text-align:right;flex-shrink:0}.upgrade-stat-row small{color:#aeb9bf;font-weight:400}.upgrade-stat-note{font-size:11px;line-height:1.7;padding:10px;margin:0;color:#bec5cb;white-space:normal}
.upgrade-config-title{font-size:15px;padding:0 0 9px;border-bottom:2px solid var(--upgrade-gold);color:#fff0b3;margin-bottom:12px;overflow-wrap:anywhere}.upgrade-trait{position:relative;width:fit-content;max-width:100%;margin:0 0 14px;z-index:4}.upgrade-trait summary{display:flex;align-items:center;flex-wrap:wrap;gap:7px;cursor:pointer;color:var(--upgrade-gold);font-size:16px;min-height:44px;list-style:none}.upgrade-trait summary:focus-visible{outline:2px solid #d9c271;outline-offset:3px}.upgrade-trait-icon{font-size:35px;line-height:1}.upgrade-trait summary small{font-size:10px;color:#acb7be}.upgrade-trait-description{padding:16px;background:#15151df5;border:1px solid #a09369;line-height:1.8;font-size:13px;overflow-wrap:anywhere}.upgrade-trait[open]{width:100%}
.upgrade-workspace .arsenal-config{min-width:0}.upgrade-workspace .upgrade-top-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding-bottom:0;margin-bottom:12px;border:0}.upgrade-workspace .frame-upgrade-header{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.upgrade-workspace .frame-upgrade-header>:first-child{grid-column:2}.upgrade-workspace .frame-upgrade-header.double-aura>:first-child{grid-column:1}.upgrade-workspace .mod-slots,.upgrade-workspace .arsenal-config .mod-slots{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.upgrade-workspace .mod-slots.shared-companion-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.upgrade-workspace .frame-slot{min-width:0;padding:0;background:transparent;border:0}.upgrade-workspace .frame-slot>p{font-size:10px;line-height:1.6;white-space:normal;margin:0 0 4px}.upgrade-workspace .forma-slot-tag,.upgrade-workspace .component-badge{font-size:10px;line-height:1.6;height:auto;min-height:0;max-height:none;white-space:normal;overflow:visible;margin-bottom:4px;padding:4px}.upgrade-workspace .mod-card{min-height:0;height:auto;border-radius:6px 6px 15px 15px}.upgrade-workspace .mod-art-frame{height:64px}.upgrade-workspace .mod-card .mod-art{height:64px;width:100%;object-fit:cover}.upgrade-workspace .mod-label{font-size:12px;line-height:1.5;white-space:normal;padding:5px 4px;overflow-wrap:anywhere}.upgrade-workspace .mod-en{font-size:9px;line-height:1.4;white-space:normal;padding:0 4px 4px;overflow-wrap:anywhere}.upgrade-workspace .mod-card .mod-top{font-size:14px;padding:4px;gap:3px;right:4px;top:4px}.upgrade-workspace .mod-effects{height:auto;min-height:0;max-height:none;overflow:visible;white-space:pre-line;font-size:10px;line-height:1.7;padding:7px 6px}.upgrade-workspace .mod-meta,.upgrade-workspace .mod-drain-note{font-size:9px;line-height:1.5}.upgrade-workspace .mod-rank{padding:3px;display:flex;justify-content:center;flex-wrap:wrap;gap:3px}.upgrade-workspace .mod-rank i{width:5px;height:5px}.upgrade-empty-slot{min-height:145px;border:1px solid #5b5a65;border-radius:6px 6px 16px 16px;background:linear-gradient(150deg,#34344078,#15151d88);display:flex;align-items:center;justify-content:center;color:#a9a5a0;font-size:12px}.upgrade-empty-slot span{padding:12px;text-align:center}
.upgrade-right>h4{color:var(--upgrade-gold);margin:0 0 12px;font-size:15px}.upgrade-right .frame-arcane-section{border:0;padding:0;margin:0;background:none}.upgrade-right .frame-arcane-section>h3{font-size:11px}.upgrade-right .frame-arcane-row{display:flex;flex-direction:column;gap:15px}.upgrade-right .arcane-build-card{display:flex;flex-direction:column;align-items:center;padding:10px;text-align:center;background:#131921b0;min-width:0;border-color:#665c43}.upgrade-right .arcane-build-card img,.upgrade-right .arcane-art-frame{height:82px;width:82px;object-fit:contain}.upgrade-right .arcane-identity{display:flex;flex-direction:column;align-items:center;gap:6px}.upgrade-right .arcane-effects,.upgrade-right .arcane-build-card p{font-size:11px;white-space:pre-line;max-height:none;height:auto;overflow:visible;line-height:1.7}.upgrade-right .arcane-build-card strong{font-size:13px}.upgrade-right .arcane-build-card span,.upgrade-right .arcane-meta,.upgrade-right .arcane-drain-note{font-size:10px}.upgrade-no-arcane{padding:15px;border:1px solid #5a5548;color:#b8babd;line-height:1.8;font-size:12px}
.frame-build-section>.build-body:has(.upgrade-workspace){display:block}.equipment-build-section .build-body:has(.upgrade-workspace){display:block}.upgrade-workspace .frame-slot .empty-card{height:auto;min-height:145px}.upgrade-workspace .polarity-name{font-size:9px}
#simulator .sim-panel.upgrade-personal{display:grid;grid-template-columns:minmax(210px,1.05fr) minmax(0,3fr) minmax(170px,.82fr);gap:20px;background:linear-gradient(120deg,#10151def,#21252ce8 56%,#10151dec);padding:20px;border:1px solid #756a4c;align-items:start}#simulator .upgrade-personal .sim-upgrades{padding:0;background:none;border:0;min-width:0}#simulator .upgrade-personal .sim-summary{position:static;min-width:0;border:0;background:#12121bcc;padding:10px}#simulator .upgrade-personal #sim-art{width:80px;height:80px;object-fit:contain}#simulator .upgrade-personal #sim-title{font-size:17px}#simulator .upgrade-personal .config-tabs{margin-bottom:12px;display:flex;gap:10px}#simulator .upgrade-personal .config-tabs button{min-height:40px;flex:1;background:#202029;border-color:#766744;color:#e6d499}#simulator .upgrade-personal .config-tabs button[aria-pressed=true]{border-bottom:2px solid #ead490;background:#4b4435}#simulator .upgrade-personal .arsenal-layout-scroll{overflow:visible;padding:0}#simulator .upgrade-personal .arsenal-config{min-width:0}#simulator .upgrade-personal .upgrade-right .arcane-slots{display:flex;flex-direction:column;gap:15px}#simulator .upgrade-personal .arcane-control{min-width:0;padding:10px;border:1px solid #6b634e;background:#151921}.upgrade-personal .arcane-control select{width:100%;white-space:normal}.upgrade-personal .arcane-control img{display:block;width:86px;height:86px;object-fit:contain;margin:10px auto}.upgrade-personal .slot-wrap{min-width:0}.upgrade-personal .mod-effects{height:auto;max-height:none;overflow:visible}.upgrade-personal .investment{margin-top:18px;display:flex;flex-wrap:wrap;gap:9px}.upgrade-personal .investment label{min-width:0;flex:1 1 140px}.upgrade-personal .investment input[type=number]{width:100%}.upgrade-personal .slot-edit{font-size:11px}.upgrade-personal .slot-edit select{max-width:100%}
@media(max-width:1200px){.upgrade-workspace,#simulator .sim-panel.upgrade-personal{grid-template-columns:minmax(190px,.9fr) minmax(0,2.8fr);gap:14px;padding:14px}.upgrade-workspace>.upgrade-right,.upgrade-personal>.upgrade-right{grid-column:2}.upgrade-right .frame-arcane-row,.upgrade-personal .upgrade-right .arcane-slots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.upgrade-workspace .mod-art-frame,.upgrade-workspace .mod-card .mod-art{height:55px}}
@media(max-width:760px){.upgrade-workspace,#simulator .sim-panel.upgrade-personal{grid-template-columns:minmax(0,1fr);padding:12px}.upgrade-workspace>.upgrade-right,.upgrade-personal>.upgrade-right{grid-column:1}.upgrade-left{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.upgrade-capacity,.upgrade-left>.upgrade-stat-note{grid-column:1/-1}.upgrade-stat-row{font-size:11px}.upgrade-workspace .mod-slots,.upgrade-workspace .arsenal-config .mod-slots{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.upgrade-workspace .mod-label{font-size:11px}.upgrade-workspace .mod-card .mod-top{font-size:12px}.upgrade-workspace .mod-art-frame,.upgrade-workspace .mod-card .mod-art{height:42px}.upgrade-workspace .mod-en{font-size:8px}.upgrade-personal .sim-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px}.upgrade-personal #sim-ability-stats,.upgrade-personal #sim-base-stats,.upgrade-personal #forma-plan,.upgrade-personal #sim-validation{grid-column:1/-1}}
@media(prefers-reduced-motion:reduce){.upgrade-workspace *{transition:none!important}}

.upgrade-trait-hover{display:none}.upgrade-trait:not([open]):hover .upgrade-trait-hover,.upgrade-trait:not([open]):focus-within .upgrade-trait-hover{display:block;position:absolute;top:100%;left:0;width:min(390px,70vw);padding:16px;background:#15151df5;border:1px solid #a09369;color:#e7e1d1;font-size:13px;line-height:1.8;overflow-wrap:anywhere;box-shadow:0 6px 25px #000b}
.upgrade-workspace .mod-label,.upgrade-workspace .mod-en{word-break:keep-all;overflow-wrap:break-word}
@media(max-width:600px){.upgrade-workspace .mod-slots,.upgrade-workspace .arsenal-config .mod-slots,.upgrade-workspace .mod-slots.shared-companion-grid,.upgrade-workspace .frame-upgrade-header,.upgrade-workspace .upgrade-top-row{grid-template-columns:repeat(2,minmax(0,1fr))}.upgrade-workspace .frame-upgrade-header>:first-child{grid-column:auto}}
