/* KD Browser V165: visual polish for desktop while preserving live HUD and game handlers. */
@media(min-width:801px) and (min-height:521px){
 body.kd-ui-compact154{--kd-top:70px!important;--kd-dock-h:clamp(286px,36vh,375px)!important}
 body.kd-ui-compact154 #top.kd-topbar163{background:linear-gradient(180deg,#17211a 0%,#0a110f 80%)!important;border-bottom:2px solid #bd965b!important;box-shadow:0 7px 26px #000c!important}
 body.kd-ui-compact154 #top.kd-topbar163 .head{background:linear-gradient(90deg,#293326bb,transparent)!important}
 body.kd-ui-compact154 #top.kd-topbar163 .head h1{color:#fae2af!important;text-shadow:0 2px 9px #000!important}
 body.kd-ui-compact154 #top.kd-topbar163 #statePill{background:linear-gradient(180deg,#293329db,#101a17e9)!important;border:1px solid #9a7749!important;border-radius:6px!important}
 body.kd-ui-compact154 #top.kd-topbar163 #statePill>div b{font-variant-numeric:tabular-nums!important}
 #kd-reference-sidebar{background:linear-gradient(180deg,#18221d,#080e0b)!important;border-top:2px solid #a7804a!important;padding:5px 10px!important}
 #kd-reference-sidebar>.kd-hud-block:first-child{filter:drop-shadow(0 2px 6px #000a)}
 #kd-reference-sidebar #kd-one-context{background:#101713!important;filter:drop-shadow(0 2px 7px #0009)}
 #kd-one-context #kd-context-body{gap:6px!important}
 #kd-one-context #kd-selection-slot{background:#161d18e8!important}
 #kd-one-context #kd-orders-slot .orders-buttons button,
 #kd-one-context #kd-action-zone123 .kd-build-option82 button{transition:filter .15s ease,border-color .15s ease,transform .12s ease!important}
 #kd-one-context #kd-orders-slot .orders-buttons button:hover:not(:disabled),
 #kd-one-context #kd-action-zone123 .kd-build-option82 button:hover:not(:disabled){filter:brightness(1.2)!important;transform:translateY(-1px)}
 #kd-one-context #kd-orders-slot .orders-buttons button:active,
 #kd-one-context #kd-action-zone123 .kd-build-option82 button:active{transform:translateY(1px)}
 #kd-one-context button:focus-visible,#kd-one-context select:focus-visible{outline:2px solid #eccc86!important;outline-offset:1px}
 #kd-reference-sidebar .kd-hud-header{text-shadow:0 2px 6px #000!important}
 #hudlog{max-width:min(30vw,350px)!important;opacity:.94}
 #hudlog .event{border-radius:0 4px 4px 0;border-left-color:#b29059!important;background:#0e1916ef!important;box-shadow:0 4px 18px #0007!important}
 #bottom #help{border:1px solid #735a3c!important;background:#111b17dc!important;border-radius:5px!important}
 #load .inner{border:2px solid #9f824e!important;border-radius:8px!important;box-shadow:0 25px 80px #000e!important}
 #kd25dPreviewLink{opacity:.72;transition:opacity .2s}
 #kd25dPreviewLink:hover{opacity:1}
}
@media(min-width:801px) and (max-width:1120px) and (min-height:521px){
 body.kd-ui-compact154{--kd-rail:295px!important}
 #kd-reference-sidebar{padding-left:5px!important;padding-right:5px!important}
 #kd-one-context #kd-orders-slot .orders-buttons{gap:3px!important}
 #kd-reference-sidebar #mini{max-width:185px!important;max-height:185px!important}
}
@media (prefers-reduced-motion:reduce){#kd-one-context button,#kdMobileBar164 button{transition:none!important}}
/* V166 desktop corrections verified against 1536x960 screenshot. */
@media(min-width:801px) and (min-height:521px){
 body.kd-ui-compact154{--kd-dock-h:clamp(205px,25vh,258px)!important}
 body.kd-ui-compact154 #top.kd-topbar163{grid-template-columns:minmax(230px,285px) minmax(0,1fr) 114px!important}
 body.kd-ui-compact154 #top.kd-topbar163 .head{min-width:230px!important;max-width:285px!important;width:100%!important;flex:0 1 285px!important;overflow:visible!important;padding-left:53px!important}
 body.kd-ui-compact154 #top.kd-topbar163 .head h1{font-size:clamp(17px,1.45vw,23px)!important;white-space:nowrap!important;overflow:visible!important}
 #kd-reference-sidebar{overflow:hidden!important}
 #kd-reference-sidebar #kd-one-context{min-height:0!important}
 #kd-reference-sidebar #kd-one-context #kd-context-body{overflow-y:auto!important;scrollbar-width:thin}
 #kd-reference-sidebar .kd-map-wrap{height:auto!important;max-height:calc(var(--kd-dock-h) - 40px)!important}
 #kd-reference-sidebar #mini{width:min(100%,calc(var(--kd-dock-h) - 78px),168px)!important;height:min(100%,calc(var(--kd-dock-h) - 78px),168px)!important}
 #kd-one-context #kd-context-heading{min-height:23px!important}
 #kd-one-context #kd-context-body{padding:3px 7px!important}
 #kd-one-context .kd-context-description{padding:3px 7px!important;font-size:10px!important}
 #kd-reference-sidebar #kd-one-context #kd-selection-slot{min-height:0!important}
}
@media(min-width:801px) and (max-width:1120px) and (min-height:521px){
 body.kd-ui-compact154 #top.kd-topbar163{grid-template-columns:minmax(185px,218px) minmax(0,1fr) 90px!important}
 body.kd-ui-compact154 #top.kd-topbar163 .head{min-width:185px!important;max-width:218px!important}
 body.kd-ui-compact154 #top.kd-topbar163 .head h1{font-size:15px!important}
}

/* KAELEN DOUR V175 - clean battlefield, tactical notifications opt-in */
body:not(.kd-show-log) #hudlog{display:none!important}
body.kd-show-log #hudlog{display:block!important;max-width:min(28vw,320px)!important;opacity:.83!important}
