/* The selected frame stays inside each page cell, including the right edge. */
#knowledge-root .mastery-tree{box-sizing:border-box;padding:6px 3px 18px;max-width:100%}
#knowledge-root .mastery-tier{gap:7px;align-items:stretch}
#knowledge-root .mastery-node{box-sizing:border-box;padding:7px 3px 9px;outline:0!important;min-height:116px;position:relative;transition:background .24s,box-shadow .24s}
#knowledge-root .mastery-node.preview{outline:0!important;border:0;box-shadow:inset 0 0 0 1.5px #8d9a61,inset 0 0 15px #b9b57426;background:#d6c38318;border-radius:11px}
#knowledge-root .mastery-node>small:empty{display:none}
#knowledge-root .mastery-node>small{min-height:16px;margin:0;position:relative;z-index:1}
#knowledge-root .mastery-branches{height:30px;stroke:#aa8b4c;stroke-opacity:.5;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
#knowledge-root .mastery-branches .chosen{stroke:#6b8250;stroke-opacity:.9;stroke-width:1.8;stroke-dasharray:none;animation:mastery-ink-0185 3.5s ease-in-out infinite}
#knowledge-root .mastery-stems{height:22px}
#knowledge-root .mastery-stems>i{position:relative;width:1px;height:22px;margin:0;background:linear-gradient(transparent,#aa8b4c99,transparent)}
#knowledge-root .mastery-stems>i:after{content:'';position:absolute;width:4px;height:4px;top:9px;left:-1.5px;background:#b19b64;transform:rotate(45deg)}
#knowledge-root .mastery-stems>i.chosen{background:linear-gradient(transparent,#6b8250,transparent)}
#knowledge-root .mastery-stems>i.chosen:after{background:#6b8250;box-shadow:0 0 5px #8c9c6355}
@keyframes mastery-ink-0185{50%{stroke-opacity:.5}}
#hero .hero-loadout{padding-bottom:0}
.hero-loadout-content{padding:0 12px 12px}
.hero-loadout-slots{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;max-width:300px;margin:3px auto 9px}
.hero-loadout-slot{position:relative;min-width:0}
.hero-loadout-slot>button:first-child{position:relative;width:100%;aspect-ratio:1;border:1px solid #b5a375;border-radius:10px;background:linear-gradient(#fbf6e6,#e7dec2);padding:7px;display:grid;place-items:center;box-shadow:inset 0 0 0 2px #fff7de88}
.hero-loadout-slot.selected>button:first-child{border-color:#65876b;box-shadow:inset 0 0 0 2px #71927955}
.hero-loadout-slot img{width:100%;height:100%;object-fit:contain;max-height:47px}
.hero-loadout-slot small{position:absolute;bottom:2px;left:5px;font:11px system-ui;color:#6e6850}
.hero-empty-slot{font:24px Interface;color:#9b956e}
#hero .hero-loadout-remove{position:absolute;right:-5px;top:-5px;padding:0;width:23px;height:23px;min-height:0;border:1px solid #c0ad86;border-radius:6px;background:#f3ead5;font:18px/21px system-ui;color:#7b5b41}
.hero-loadout-hint{font:12px/1.5 system-ui;color:#6a735e;margin:4px 0 10px}
.hero-loadout-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding-bottom:12px}
#hero .hero-loadout-choice{display:flex;align-items:center;gap:7px;min-width:0;text-align:left;padding:7px;border:1px solid #b8ad895c;border-radius:9px;background:#fff9e970;color:#3c594c;min-height:51px;position:relative}
.hero-loadout-choice img{width:34px;height:34px;object-fit:contain;flex:none}
.hero-loadout-choice>span{min-width:0}.hero-loadout-choice strong{display:block;font:600 12px/1.3 system-ui;overflow-wrap:anywhere}.hero-loadout-choice small{display:block;font:10px/1.4 system-ui;color:#7d785b;margin-top:3px}.hero-loadout-choice.equipped{border-color:#7a966d;background:#dce4c550}.hero-loadout-choice i{position:absolute;right:3px;top:1px;font:12px system-ui;color:#5d815d}
.combat-passive-label{position:absolute;bottom:4px;left:2px;right:2px;text-align:center;font:9px system-ui;color:#eee5c7;background:#24382ed9;border-radius:3px;padding:2px 0}
.combat-skill-row:has([data-passive-info]) .combat-skill-art{opacity:.88}
@media(prefers-reduced-motion:reduce){#knowledge-root .mastery-branches .chosen{animation:none}}
#app.reduced-motion .mastery-branches .chosen{animation:none}

/* Keep long mastery conditions inside the existing compact effect window. */
#battle-root .spell-panel-battle>.enemy-effect-popover{display:grid;grid-template-rows:auto minmax(0,1fr);max-height:190px;height:auto}
#battle-root .spell-panel-battle>.enemy-effect-popover[hidden]{display:none}
#battle-root .spell-panel-battle>.enemy-effect-popover>.enemy-effect-copy{min-height:0;max-height:136px;overflow-y:auto;overflow-x:hidden;contain:paint;overscroll-behavior:contain;padding-bottom:3px}
