.pb-shell{
    max-width:1500px;
    margin:auto;
    padding:40px 32px 64px;
    color:#e9e5dc
}
.pb-heading{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
    margin-bottom:30px
}
.pb-heading h1{
    font-family:Cinzel,serif;
    font-size:clamp(28px,3vw,44px);
    margin:6px 0 12px;
    letter-spacing:-.03em
}
.pb-heading p,.pb-save-panel p{
    color:#a8b1bd;
    max-width:640px
}
.pb-eyebrow{
    font-size:11px!important;
    letter-spacing:.18em;
    font-weight:700;
    color:#d5b274!important
}
.pb-toolbar{
    display:flex;
    align-items:center;
    gap:24px;
    padding:18px 24px;
    border:1px solid #343b45;
    background:#141b24;
    border-radius:12px
}
.pb-shell label{
    display:grid;
    gap:7px;
    font-size:12px;
    font-weight:600;
    color:#b8c1cc
}
.pb-shell input:not([type=checkbox]),.pb-shell select{
    width:100%;
    min-height:42px;
    background:#0d131c;
    border:1px solid #3b4656;
    border-radius:6px;
    padding:9px 12px;
    color:#eee9df;
    font:inherit;
    font-size:14px;
    box-sizing:border-box
}
.pb-toolbar select{
    min-width:145px
}
.pb-toolbar input{
    max-width:100px
}
.pb-budget{
    margin-left:8px;
    display:grid;
    gap:1px
}
.pb-budget strong{
    font-family:'JetBrains Mono',monospace;
    font-size:23px;
    color:#e4be76
}
.pb-budget span{
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.1em;
    color:#99a5b4
}
.pb-toolbar-actions{
    margin-left:auto;
    display:flex;
    gap:8px
}
.pb-shell button{
    cursor:pointer;
    border:1px solid #425061;
    border-radius:6px;
    padding:9px 13px;
    background:#1b2633;
    color:#e5e9ec;
    font:inherit;
    font-size:13px;
    min-height:40px
}
.pb-shell button:hover:not(:disabled){
    background:#2c3d4e;
    border-color:#b4a078
}
.pb-shell button:disabled{
    opacity:.45;
    cursor:not-allowed
}
.pb-shell :focus-visible{
    outline:2px solid #e3c88a;
    outline-offset:3px
}
.pb-shell [hidden]{
    display:none!important
}
.pb-status{
    font-size:13px;
    min-height:22px;
    color:#a9c1bc;
    margin:14px 0
}
.pb-status.is-error,.pb-stale{
    color:#f1b893
}
.pb-workspace{
    display:grid;
    grid-template-columns:minmax(0,1fr) 325px;
    gap:18px;
    align-items:start
}
.pb-map-panel{
    border:1px solid #3a414b;
    border-radius:12px;
    overflow:hidden;
    background:#0b121b
}
.pb-map-tools{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 16px;
    border-bottom:1px solid #2b3542;
    background:#131c28
}
.pb-map-tools>span{
    font-size:10px;
    letter-spacing:.14em;
    color:#c5ac81
}
.pb-map-tools small{
    display:block;
    color:#8e9dab;
    letter-spacing:0;
    margin-top:4px
}
.pb-map-tools>div{
    display:flex;
    gap:5px
}
.pb-map-tools button{
    padding:6px 9px;
    min-width:34px;
    min-height:34px
}
.pb-map{
    position:relative;
    height:640px;
    background:radial-gradient(ellipse at 45% 50%,#1a2a3b 0%,#101c2a 45%,#090f18 100%)
}
.pb-map::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    opacity:.28;
    background-image:radial-gradient(#8695a5 .6px,transparent .8px);
    background-size:35px 35px
}
.pb-map canvas{
    display:block;
    width:100%;
    height:100%;
    touch-action:none;
    position:relative;
    cursor:grab
}
.pb-map canvas:active{
    cursor:grabbing
}
.pb-map-caption{
    position:absolute;
    bottom:17px;
    left:0;
    right:0;
    text-align:center;
    pointer-events:none;
    font-size:11px;
    color:#a4b1c0;
    text-shadow:0 1px 3px #000
}
.pb-legend{
    display:flex;
    flex-wrap:wrap;
    gap:22px;
    padding:14px 18px;
    font-size:11px;
    color:#acb6c2;
    border-top:1px solid #283442
}
.pb-legend span{
    display:flex;
    align-items:center;
    gap:7px
}
.pb-dot{
    width:8px;
    height:8px;
    display:inline-block;
    border:1px solid #63768a;
    border-radius:50%
}
.pb-selected{
    background:#bd9957;
    border-color:#e4be76
}
.pb-available{
    border-color:#70cfba
}
.pb-inspector{
    display:grid;
    gap:14px
}
.pb-search,.pb-node,.pb-summary{
    padding:20px;
    background:#141d28;
    border:1px solid #343f4e;
    border-radius:10px
}
.pb-search>input{
    margin-top:8px
}
.pb-check{
    display:flex!important;
    align-items:center;
    gap:9px!important;
    font-size:12px!important;
    font-weight:400!important;
    line-height:1.5;
    margin:12px 0
}
.pb-check input{
    accent-color:#d5b274;
    width:16px;
    height:16px;
    flex:none
}
.pb-results{
    max-height:172px;
    overflow:auto;
    margin-top:10px
}
.pb-results>button{
    display:block;
    width:100%;
    text-align:left;
    background:transparent;
    border:0;
    border-bottom:1px solid #293541;
    border-radius:0;
    font-size:12px;
    padding:9px 4px;
    color:#b4c0cb;
    line-height:1.4
}
.pb-results>button.is-allocated{
    color:#e4be76
}
.pb-results>p{
    padding:5px 0
}
.pb-node h2,.pb-summary h2{
    font-family:Cinzel,serif;
    font-size:19px;
    margin:8px 0 14px
}
.pb-node p{
    font-size:13px;
    line-height:1.65
}
.pb-node>button{
    width:100%;
    margin-top:10px;
    border-color:#87734e;
    color:#e4be76
}
.pb-muted{
    font-size:12px!important;
    line-height:1.6;
    color:#99a8ba!important
}
.pb-summary{
    max-height:350px;
    overflow:auto
}
.pb-summary h3{
    font-size:11px;
    color:#d2b77d;
    text-transform:uppercase;
    letter-spacing:.08em;
    margin:20px 0 9px
}
.pb-summary ul{
    padding-left:17px;
    margin:0
}
.pb-summary li{
    font-size:13px;
    color:#c4d1da;
    margin:7px 0;
    line-height:1.5
}
.pb-summary [data-summary]{
    font-size:13px;
    color:#a9b7c7
}
.pb-save-panel{
    display:grid;
    grid-template-columns:1fr 1.3fr;
    gap:38px;
    margin-top:24px;
    padding:30px;
    border:1px solid #3c414b;
    border-radius:12px;
    background:linear-gradient(125deg,#1a242f,#141a23)
}
.pb-save-panel h2{
    font-family:Cinzel,serif;
    font-size:25px;
    margin:10px 0 15px
}
.pb-save-panel p{
    font-size:14px;
    line-height:1.7
}
.pb-save-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:18px
}
.pb-shell .pb-primary{
    background:#c1a062;
    border-color:#d7b478;
    color:#151b23;
    font-weight:700
}
.pb-shell .pb-primary:hover:not(:disabled){
    background:#dfbf82
}
.pb-save-panel [data-delete]{
    color:#eab6a7
}
.pb-save-panel [data-link]{
    font-family:'JetBrains Mono',monospace;
    font-size:11px
}
.pb-empty{
    padding:50px 30px;
    border:1px solid #343f4e;
    background:#141d28;
    border-radius:12px;
    text-align:center
}
.pb-build-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:20px
}
.pb-build-card{
    padding:24px;
    border:1px solid #343f4e;
    border-radius:10px;
    background:#141d28
}
.pb-build-card h2{
    font-size:21px;
    overflow-wrap:anywhere
}
.pb-build-card p{
    font-size:13px
}
.pb-shell a{
    color:#e2c28a
}
.pb-shell .account-subnav{
    margin-bottom:30px
}
.pb-route{
    padding:22px;
    border:1px solid #416274;
    border-radius:12px;
    background:#141f2a
}
.pb-route>button{
    width:100%;
    margin-top:9px
}
.pb-route [data-route]{
    border-color:#80bfd3;
    color:#b8edff;
    background:#233946
}
.pb-route p{
    font-size:13px;
    margin:12px 0
}
.pb-targets{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    max-height:180px;
    overflow:auto
}
.pb-targets button{
    max-width:100%;
    overflow-wrap:anywhere;
    font-size:12px;
    text-align:left
}
.pb-results button.is-target{
    box-shadow:inset 3px 0 #83dcf5;
    background:#233946
}
.pb-route .is-error{
    color:#ffb6ab
}
@media(max-width:1100px){
    .pb-shell{
        padding:28px 20px
    }
    .pb-workspace{
        grid-template-columns:minmax(0,1fr) 280px
    }
    .pb-map{
        height:600px
    }
    .pb-map-tools>span{
        display:none
    }
    .pb-map-tools{
        justify-content:flex-end
    }
    .pb-build-grid{
        grid-template-columns:repeat(2,1fr)
    }
}
@media(max-width:760px){
    .pb-shell{
        padding:24px 14px
    }
    .pb-heading{
        align-items:flex-start;
        flex-direction:column;
        gap:10px
    }
    .pb-toolbar{
        flex-wrap:wrap;
        gap:15px;
        padding:16px
    }
    .pb-toolbar-actions{
        margin-left:0;
        width:100%
    }
    .pb-budget{
        margin-left:auto
    }
    .pb-toolbar select{
        min-width:120px
    }
    .pb-workspace{
        grid-template-columns:1fr
    }
    .pb-map{
        height:460px
    }
    .pb-inspector{
        grid-template-columns:1fr
    }
    .pb-save-panel{
        grid-template-columns:1fr;
        padding:22px;
        gap:12px
    }
    .pb-build-grid{
        grid-template-columns:1fr
    }
    .pb-legend{
        gap:14px
    }
    .pb-results{
        max-height:180px
    }
}

/* The atlas is a workspace: keep the selected passive above all optional tools. */
.pb-shell[data-passive-builder]{padding-top:18px}
[data-passive-builder] .pb-heading{margin-bottom:14px;gap:16px}
[data-passive-builder] .pb-heading h1{font-size:clamp(24px,2.3vw,34px);margin:2px 0 5px}
[data-passive-builder] .pb-heading p{margin:4px 0;font-size:13px}
[data-passive-builder] .pb-toolbar{padding:12px 18px;gap:18px}
[data-passive-builder] .pb-status{margin:8px 0;font-size:12px}
[data-passive-builder] .pb-workspace{
    --pb-height:clamp(440px,calc(100dvh - 390px),900px);
    grid-template-columns:minmax(0,1fr) 340px;
    gap:14px
}
[data-passive-builder] .pb-map-panel{height:var(--pb-height);display:flex;flex-direction:column}
[data-passive-builder] .pb-map{height:auto;flex:1;min-height:0}
[data-passive-builder] .pb-map-tools{padding:8px 12px;flex:none}
[data-passive-builder] .pb-legend{padding:9px 12px;gap:15px;flex:none}
[data-passive-builder] .pb-inspector{
    max-height:var(--pb-height);overflow:auto;overscroll-behavior:contain;
    scrollbar-width:thin;scrollbar-color:#716044 #101821;
    gap:8px;align-content:start;padding-right:3px
}
[data-passive-builder] .pb-node,[data-passive-builder] .pb-route,
[data-passive-builder] .pb-search,[data-passive-builder] .pb-summary{padding:12px 14px;min-width:0}
[data-passive-builder] .pb-node{border-color:#8b744b;background:linear-gradient(135deg,#202a35,#141d28)}
.pb-node-heading{display:flex;gap:12px;align-items:center}
.pb-node-heading>div{min-width:0}
.pb-node-icon{
    width:72px;height:72px;flex:none;display:grid;place-items:center;overflow:hidden;
    color:#e4be76;background:#101923;border:1px solid #716044;border-radius:50%;
    box-shadow:inset 0 0 16px #b8945420
}
.pb-node-icon svg{width:30px;height:30px}
.pb-node-icon[data-type=Keystone]{color:#dfc7ff;border-color:#9479b8;border-radius:8px;background:#241e31}
.pb-node-icon[data-type=Notable]{border-width:3px;box-shadow:0 0 0 2px #141d28,0 0 0 3px #716044}
.pb-node-icon[data-type=JewelSocket]{border-radius:12px;border-color:#b8a2d6}
.pb-painted-icon{display:block;width:100%;height:100%;background-size:800% 600%;background-repeat:no-repeat}
.pb-region-label{position:absolute;top:14px;left:14px;pointer-events:none;padding:9px 12px;
    border:1px solid #aa8f543d;border-radius:6px;background:#09111de8;box-shadow:0 4px 18px #0005}
.pb-region-label span{display:block;font-size:8px;letter-spacing:.2em;color:#a18a61;margin-bottom:3px}
.pb-region-label strong{font-family:Cinzel,serif;font-size:13px;color:#e1cea7}
[data-passive-builder] .pb-node h2{font-size:18px;margin:4px 0;overflow-wrap:anywhere}
[data-passive-builder] .pb-node p{margin:7px 0;line-height:1.5}
[data-passive-builder] .pb-node .pb-eyebrow{font-size:10px!important;margin:0}
[data-passive-builder] .pb-node>button{margin-top:5px}
[data-passive-builder] .pb-route .pb-check{margin:0}
[data-passive-builder] .pb-route p{margin:7px 0;line-height:1.4;font-size:12px}
[data-passive-builder] .pb-route>button{margin-top:5px}
[data-passive-builder] .pb-targets{max-height:64px}
[data-passive-builder] .pb-targets button{padding:4px 8px;min-height:30px}
[data-passive-builder] [data-clear-targets]:disabled{display:none}
[data-passive-builder] details>summary{cursor:pointer;font-size:13px;font-weight:600;color:#dfc38e;padding:3px 0}
[data-passive-builder] details[open]>summary{margin-bottom:12px}
[data-passive-builder] .pb-summary{max-height:none;overflow:visible}
[data-passive-builder] .pb-save-panel{margin-top:16px;padding:20px 24px;gap:24px}
[data-passive-builder] .pb-save-panel h2{font-size:21px;margin:6px 0}
[data-passive-builder] .pb-save-panel p{font-size:12px;margin:8px 0}
[data-passive-builder] .pb-workspace.is-focused{
    position:fixed;inset:12px;z-index:200;--pb-height:calc(100dvh - 48px);
    background:#090e16;padding:12px;border:1px solid #716044;border-radius:12px;
    box-shadow:0 0 0 20px #090e16
}
@media(max-width:1100px) and (min-width:761px){
    [data-passive-builder] .pb-workspace{grid-template-columns:minmax(0,1fr) 310px}
}
@media(max-width:760px){
    [data-passive-builder] .pb-heading{flex-direction:row;align-items:center}
    [data-passive-builder] .pb-heading .btn{padding:8px;white-space:nowrap;font-size:12px}
    [data-passive-builder] .pb-heading h1{font-size:24px}
    [data-passive-builder] .pb-heading p:not(.pb-eyebrow){display:none}
    [data-passive-builder] .pb-toolbar{padding:10px;gap:10px}
    [data-passive-builder] .pb-toolbar select{min-width:105px}
    [data-passive-builder] .pb-toolbar input{max-width:70px}
    [data-passive-builder] .pb-budget{margin-left:0}
    [data-passive-builder] .pb-budget strong{font-size:19px}
    [data-passive-builder] .pb-toolbar-actions{gap:6px}
    [data-passive-builder] .pb-toolbar-actions>*{flex:1;text-align:center}
    [data-passive-builder] .pb-workspace{grid-template-columns:1fr}
    [data-passive-builder] .pb-inspector{display:contents}
    [data-passive-builder] .pb-node{grid-row:1;scroll-margin-top:84px}
    [data-passive-builder] .pb-map-panel{grid-row:2;height:clamp(280px,42dvh,420px)}
    [data-passive-builder] .pb-route{grid-row:3}
    [data-passive-builder] .pb-map-tools>div{flex-wrap:wrap}
    [data-passive-builder] .pb-map-caption{font-size:10px;bottom:10px;padding:0 8px}
    [data-passive-builder] .pb-workspace.is-focused{inset:0;border-radius:0;overflow:auto;align-content:start}
    [data-passive-builder] .is-focused .pb-node{scroll-margin-top:12px}
}
