dialog:has(.talent-panel) {width:min(1120px,96vw);max-height:93dvh;padding:0}
.talent-panel {padding:clamp(12px,2vw,24px);color:#263c32}
.talent-heading {position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;background:#fffdf6}
.talent-heading h2 {margin:0}
.talent-heading .dialog-close {position:static;flex:none}
.talent-panel :is(button,select,input) {min-height:44px}
.talent-progress {margin:.5em 0}
.talent-presets,.talent-controls>div,.talent-tabs,.talent-edit {display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.talent-presets {margin:10px 0}
.talent-presets label {display:grid;gap:3px;font-size:.83rem;min-width:0}
.talent-presets input,.talent-presets select {width:100%;max-width:14rem}
.talent-trees {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.talent-branch {padding:8px;border:1px solid #b4b59e;border-radius:5px}
.talent-branch h3 {margin:0 0 8px}
.talent-branch ol {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 5px;padding:0;margin:0;list-style:none}
.talent-branch li {position:relative;min-width:0}
.talent-linked:before {content:"";position:absolute;bottom:100%;height:12px;left:50%;border-left:2px solid #8b927a}
.talent-branch button {display:flex;align-items:center;gap:4px;width:100%;padding:4px;min-height:53px;text-align:left;overflow-wrap:anywhere}
.talent-panel button[aria-pressed=true] {outline:2px solid #567356;outline-offset:-2px;background:#e7eddf}
.talent-branch .frontier-art,.talent-detail .frontier-art {width:34px;flex:none;height:34px}
.talent-branch small {display:block;font-size:.72rem}
.talent-tabs {display:none}
.talent-detail {margin:10px 0;padding:10px;background:#eef0e5;border-left:3px solid #5b755b}
.talent-detail>div:first-child {display:flex;align-items:center;gap:8px}
.talent-detail p,.talent-confirm p {margin:4px 0}
.talent-controls {display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;position:sticky;bottom:-1px;background:#fbf7ee;border-top:1px solid #b9baa5;padding:6px 0;z-index:1}
.talent-controls small {display:block}
.talent-reload {font-size:.78rem}
@media(max-width:760px){
  dialog:has(.talent-panel) {width:100%;max-width:100%;max-height:94dvh;max-height:94svh;margin:auto 0 0;border-radius:12px 12px 0 0}
  .talent-trees {display:block}.talent-tabs {display:flex;margin:8px 0}
  .talent-branch:not([data-shown]) {display:none}
  .talent-branch h3 {display:none}
  .talent-presets label {flex:1}
  .talent-branch .frontier-art {width:38px;height:38px}
  .talent-controls {padding-bottom:max(6px,env(safe-area-inset-bottom))}
}
