main>header{flex-wrap:wrap}
main>header #gold{white-space:nowrap}
#bannerOrders{display:flex;align-items:stretch;gap:3px;flex:none}
.mapPower{--accent:#ebc675;display:flex;align-items:center;gap:.4rem;padding:.22rem .46rem;line-height:1.1;text-align:left;white-space:nowrap;border:1px solid #776b4c;border-left:2px solid var(--accent);background:linear-gradient(#2d3f49,#1b2b36)}
.mapPower.power1{--accent:#8fceda;border-color:#4b7180;border-left-color:var(--accent)}
.mapPower.power2{--accent:#f1ad94;border-color:#805f58;border-left-color:var(--accent)}
.mapPower .powerSymbol{color:var(--accent);font:1.05rem Georgia}
.powerText{display:grid;gap:2px}
.powerText b{font-size:.82rem;font-weight:650}
.powerText small{font-size:.72rem;line-height:1.1;color:var(--accent);font-variant-numeric:tabular-nums}
.mapPower:disabled{background:#1a2b38;border-left:2px solid var(--accent);color:#c4cdd2}
.mapPower:disabled small{color:#b9c7ce}
.mapPower.chosen{outline:2px solid var(--accent);outline-offset:-2px}
dialog:has(#council){width:min(94vw,44rem);padding:1rem 1.3rem}
dialog:has(#council) #sheet>.row:first-child{top:-1rem}
dialog:has(#council .researchGrid){width:min(95vw,61rem)}
#council{display:grid;gap:.66rem}
.councilHead{display:flex;align-items:center;gap:.85rem;padding:.55rem .85rem;border-left:3px solid var(--banner);background:linear-gradient(110deg,color-mix(in srgb,var(--banner) 16%,#162837),#13232f)}
.councilHead canvas{width:2.5rem;height:2.9rem;flex:none}
.councilHead b{font:bold 1.4rem Georgia}
.councilHead small,.escortUnit small{display:block}
.councilHead strong{margin-left:auto;color:var(--gold)}
.councilTabs{display:flex;border-bottom:1px solid #526064;gap:.3rem}
.councilTabs button{background:none;border:0;border-radius:0;padding:.5rem .95rem;border-bottom:2px solid transparent}
.councilTabs button.active{border-bottom-color:var(--gold);color:var(--gold)}
.abilityCard{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.8rem;padding:.75rem .8rem;background:linear-gradient(110deg,#253744,#182a37);border:1px solid #40505a;border-radius:3px}
.orderGlyph{display:grid;place-items:center;width:2.2rem;height:2.2rem;border:1px solid currentColor;color:#ecca79;background:#28291f;font:bold 1.4rem Georgia}
.ability1 .orderGlyph{color:#90c9d8;background:#15313a}
.ability2 .orderGlyph{color:#eda996;background:#392a2b}
.orderType{color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.12em}
.abilityCard h3{margin:0;font:bold 1.16rem Georgia;color:var(--cream)}
.abilityCard p,.castDetail p,#escortOrder p{margin:.26rem 0 .45rem;line-height:1.35}
.orderFoot,.escortSummary,.researchProgress,.orderOutcome{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.orderFoot b,.orderOutcome b,.escortSummary,.researchProgress b{color:var(--gold)}
.orderFoot button,.tradeActions button{padding:.28rem .56rem}
.studyBanner{display:flex;align-items:center;gap:.75rem;padding:.35rem .75rem;border-left:3px solid var(--banner);background:linear-gradient(100deg,#2b4050,#192b38 70%)}
.studyBanner canvas{width:2.35rem;height:2.75rem}.studyBanner>b{font:bold 1.3rem Georgia}
.studyRP{margin-left:auto;display:flex;align-items:baseline;gap:.55rem}.studyRP strong{color:#b9ecdc;font:bold 1.4rem Georgia}.studyRP small{color:#b5d3cd}
.studySwitch{display:none}
.researchGrid{display:grid;grid-template-columns:1fr 1.18fr 1fr;gap:.65rem}
[data-tree=Economy]{--study:#eac17c;--wash:#474031}
[data-tree=Military]{--study:#9ac3d5;--wash:#304552}
[data-tree=Faction]{--study:#b9a6dd;--wash:#3d394e}
.researchBranch{min-width:0;overflow:hidden;border:1px solid #435560;border-top:2px solid var(--study);border-radius:4px;background:#142431}
.researchBranch h3{display:flex;align-items:center;justify-content:space-between;margin:0;padding:.55rem .75rem;background:linear-gradient(100deg,var(--wash),#21323f);font:bold 1.1rem Georgia;color:var(--study)}
.researchBranch h3 small{color:#ccd4d4;font:500 .77rem 'Segoe UI',sans-serif;font-variant-numeric:tabular-nums}
.studyField{position:relative;height:10.8rem;background:radial-gradient(#32424c .65px,transparent .95px) center/12px 12px,linear-gradient(#1a2a36,#14212e)}
.studyField>svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.studyField path{fill:none;stroke:#71808a;stroke-width:1.5px;vector-effect:non-scaling-stroke}.studyField path.open{stroke:var(--study);stroke-width:2px}
.studyNode,.studyPortrait{display:grid;place-items:center;background:linear-gradient(145deg,var(--wash),#15242f 95%);border:1px solid #73818a;box-shadow:inset 0 0 0 2px #18232d,0 2px 0 #0b1520}
.studyNode{position:absolute;translate:-50% -50%;width:3.25rem;height:3.25rem;border-radius:5px;padding:.32rem}
#sheet .studyNode canvas,#sheet .studyPortrait canvas{width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;image-rendering:pixelated}
#sheet .studyNode canvas[data-emblem]{width:85%;height:85%}
.studyNode.available{border-color:var(--study)}
.studyRank{position:absolute;top:-.28rem;left:-.26rem;padding:0 .2rem;min-width:1.1rem;border:1px solid var(--study);border-radius:3px;background:#172735;color:var(--study);font:bold .75rem/1.05rem 'Segoe UI',sans-serif}
.researchBranch:has(.studyRank) .studyField{height:12rem}
.studyNode.inspected{outline:2px solid var(--study);outline-offset:3px}
.studyNode:focus-visible{outline:2px solid white;outline-offset:3px}
.studyNode.locked{background:#1c2934}.studyNode.locked canvas{filter:saturate(.55);opacity:.79}
.studyMark{position:absolute;bottom:-4px;right:-3px;width:.85rem;height:.85rem;display:grid;place-content:center;font:bold .7rem/1 'Segoe UI',sans-serif;background:#1c2d39;border:1px solid #627380;border-radius:2px}
.available .studyMark{color:#ffe8ac;border-color:#ba9a5d}.available .studyMark:after{content:'+'}
.learned .studyMark{background:#204638;border-color:#75ac91;color:#d8ffdb}.learned .studyMark:after{content:'✓'}
.locked .studyMark:after{content:'';width:.37rem;height:.29rem;background:#c0c9cb;border-radius:1px}
.locked .studyMark:before{content:'';position:absolute;top:.11rem;left:50%;translate:-50%;width:.2rem;height:.21rem;border:1px solid #c0c9cb;border-radius:3px}
.saving .studyMark{display:none}
#studyDetail{display:grid;grid-template-columns:3.8rem 1fr auto;align-items:center;gap:.9rem;min-height:7rem;background:#1d303e;border:1px solid #435663;border-left:3px solid #c6aa72;border-radius:3px;padding:.8rem}
.studyPortrait{width:3.8rem;height:3.8rem;border-radius:4px;padding:.42rem}
.studyCopy h4{font:bold 1.28rem Georgia;color:var(--cream);margin:.12rem 0}
.studyCopy p{margin:.2rem 0 .3rem;font-size:.92rem;line-height:1.35}
.studyCopy small{display:block;font-size:.78rem;color:#b7c9ce}
.studyCopy small:first-child{color:#edca89;font-weight:600}
.studyCommit button{max-width:12rem;white-space:normal}
.researchProgress,.orderOutcome,.escortSummary{background:#142630;border-left:3px solid var(--gold);padding:.6rem .75rem}
.researchProgress{flex-wrap:wrap}.researchProgress progress{width:100%;height:.45rem;accent-color:#d8b15e}
.castDetail,#escortOrder,.escortUnits,.tradeRoute{display:grid;gap:.5rem}
.tradeRoute{background:#142833;border:1px solid #42525b;border-radius:4px;overflow:hidden;padding-bottom:.52rem}
.tradeRoute .realmRow{background:#263945;border:0;border-radius:0}
.tradeActions{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:0 .62rem}
.tradeRoute .shipmentLine{padding:0 .62rem;color:#c7d5d2}
.escortUnit{display:grid;grid-template-columns:2rem minmax(0,1fr) 2rem 1.5rem 2rem;gap:.45rem;align-items:center;border-bottom:1px solid #394b55;padding:.22rem 0}
.escortUnit [data-unit]{width:2rem!important;height:2rem!important}
.escortUnit>b{text-align:center}
.escortUnit button{padding:.28rem}
#commandAim{position:absolute;z-index:3;bottom:.75rem;left:50%;transform:translateX(-50%);background:#152735f5;border:1px solid #e5bf78;box-shadow:0 4px 16px #08121ec9;display:flex;align-items:center;gap:.55rem;padding:.55rem .65rem;width:max-content;max-width:96%}
#commandAim b,#commandAim small{display:block}
#commandAim b{font:bold 1.06rem Georgia;color:var(--gold)}
#commandAim small{font-size:.85rem}
#overlay.casting{cursor:crosshair!important}
@media(max-width:1200px){main>header .brand{font-size:0;margin:0}main>header .brand svg{width:28px;height:24px}}
@media(max-width:1000px){.mapPower{gap:.23rem;padding:.23rem .35rem}.mapPower .powerSymbol{font-size:.92rem}}
@media(max-width:890px){.mapPower .powerSymbol{display:none}}
@media(max-width:760px){#bannerOrders{order:1;width:100%}.mapPower{flex:1;justify-content:center}.mapPower .powerSymbol{display:inline}}
@media(max-width:800px){.orderOutcome{flex-wrap:wrap}}
@media(max-width:660px){
 .studySwitch{display:flex;gap:.35rem}.studySwitch button{flex:1}.studySwitch [aria-pressed=true]{border-color:var(--gold);color:var(--gold)}
 .researchGrid{display:block}.researchBranch:not(.currentTree){display:none}.studyField{height:9.3rem}
 #studyDetail{grid-template-columns:2.8rem 1fr;gap:.6rem;align-items:start}.studyPortrait{height:2.8rem;width:2.8rem}
 .studyCommit{grid-column:2}.studyCommit button{max-width:100%}
}
