/* KnightLive compact HUD for a touch screen turned sideways: width alone misclassified these as
   desktop, and so did a height cut-off of 500px — a tablet or a large phone in landscape is taller
   than that and was getting the full desktop HUD, where the action bar alone took a third of the
   view (user report, 2026-09-21). A coarse pointer is what separates those from a real desktop,
   which stays on the desktop layout at the same height. */
@media(orientation:landscape) and (max-height:500px),
       (orientation:landscape) and (max-height:1000px) and (pointer:coarse){
 header{height:42px;padding:0 max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left))}
 .brand,.hero-card,#camera-reset,.location>small,.location>h2,.location>p,#potion{display:none!important}
 header nav{gap:0;max-width:100%;overflow-x:auto;white-space:nowrap}header nav button{padding:6px 9px;font-size:11px}header nav button:last-child{display:block}
 .top-tools{display:flex;position:fixed;top:46px;left:max(10px,env(safe-area-inset-left));right:195px;z-index:12;align-items:center;gap:8px}
 .mini-bars{flex:1;display:grid;gap:3px;min-width:0}.mini{display:block;height:5px;background:#0009;border-radius:3px;overflow:hidden}.mini i{display:block;height:100%;width:100%}.mini.hp i{background:#c0503f}.mini.mp i{background:#4a82c0}
 .top-tools .text-button{font-size:10px;white-space:nowrap;padding:3px 7px}
 #run-toggle{top:46px!important;right:98px!important;left:auto!important;bottom:auto!important;font-size:10px!important;padding:3px 7px!important}
 .location{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;width:auto!important;top:46px!important;right:max(10px,env(safe-area-inset-right))!important;left:auto;bottom:auto;transform:none;backdrop-filter:none!important}
 #minimap-wrap,#minimap{width:76px!important;height:76px!important;margin:0!important}
 .target{top:76px;width:165px;padding:4px 8px}.target h2{font-size:17px}.target small{font-size:8px}
 .quest-tracker{top:80px;bottom:auto;left:max(10px,env(safe-area-inset-left));right:auto;transform:none;width:205px;max-height:calc(100dvh - 182px);overflow-y:auto;padding:9px}
 .quest-tracker h3{font-size:15px}.quest-tracker p,.quest-tracker .text-button{font-size:10px}.quest-tracker small{font-size:7px}.tracker-progress{font-size:10px}
 .bottom{bottom:max(5px,env(safe-area-inset-bottom));top:auto;left:50%;right:auto;transform:translateX(-50%);width:min(780px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
 #event-feed{display:none}.hotkey-bar{padding:3px;gap:3px;flex-wrap:nowrap;justify-content:center}.hotkey-slot{width:30px;height:30px;font-size:13px}.hotkey-page{padding:2px 5px}.hotkey-auto{padding:3px;font-size:10px}
 .action-bar{display:flex!important;flex-wrap:nowrap;gap:5px;padding:4px;justify-content:center}.action-bar>.primary{order:0;min-width:0;width:auto;flex:1;height:34px;margin:0;font-size:11px;padding:3px 6px}.action-bar .skill-slot{flex:0 0 40px;width:40px;height:34px;padding:0 0 7px;font-size:18px}.skill-slot small{font-size:6px}.action-bar .hunt-info{display:none}
 body .chat{bottom:98px;top:auto;right:max(10px,env(safe-area-inset-right));left:auto;transform:none;width:225px;max-height:calc(100dvh - 140px);overflow-y:auto}.chat.minimized{width:auto}.chat-list{max-height:60px}
 .activity-log{bottom:98px;top:auto;left:50%;right:auto;transform:translateX(-50%);width:330px}.activity-log.minimized{width:170px}.activity-log-list{height:80px}
 body:has(#activity-log:not(.minimized)) .quest-tracker,body:has(#activity-log:not(.minimized)) #chat{display:none}
 .drawer,body .classic-panel{top:46px!important;bottom:auto!important;left:auto!important;right:max(10px,env(safe-area-inset-right))!important;max-height:calc(100dvh - 144px)!important;overflow-y:auto;padding:0;width:min(360px,calc(100vw - 24px))}.drawer-heading{padding-bottom:8px;margin-bottom:8px}.drawer-heading h2{font-size:23px}
 dialog{max-height:calc(100dvh - 20px);max-width:calc(100vw - 24px);overflow-y:auto;padding:18px}dialog h2{font-size:27px}dialog p{margin-bottom:10px}
 .audio-panel{top:46px;right:98px;max-height:calc(100dvh - 56px);overflow-y:auto}#toast{top:46px;font-size:12px;padding:6px 12px}#loading{top:44%;padding:12px 20px}
}

/* KnightLive window controls: compact chrome, readable content, mouse and touch movement. */
#panel{padding:0;display:flex;flex-direction:column;overflow:hidden}
#panel[hidden]{display:none}
#panel .drawer-heading{flex:none;min-height:40px;padding:8px 12px;margin:0;touch-action:none;user-select:none;cursor:grab}
#panel .drawer-heading:active{cursor:grabbing}
#panel .drawer-heading:focus-visible{outline:2px solid #efd492;outline-offset:-2px}
#panel .drawer-heading h2{font-size:19px;line-height:1.2}
#panel-eyebrow{display:none}
#panel #panel-body{min-height:0;padding:10px 12px;overflow:auto;overscroll-behavior:contain}
#panel .list-card{padding:10px;margin-bottom:8px}
#panel .section-label{margin-top:12px}
@media(orientation:landscape) and (max-height:500px){
 .hud-grip{display:block!important;width:26px;height:26px;font-size:19px;touch-action:none}
 .location>.hud-grip{left:0;right:auto;top:0;background:#172019dd!important;color:#efd492}
 #panel{max-height:calc(100dvh - 144px)!important}
 #panel .drawer-heading{min-height:36px;padding:6px 10px}
 #panel .drawer-heading h2{font-size:17px}
 #panel #panel-body{padding:8px 10px}
 #panel .equipment-layout{grid-template-columns:1fr 140px;gap:6px}
 #panel .equipment-slot{width:40px;height:40px}
 #panel .paperdoll{min-height:160px}
 #panel .paperdoll img{max-height:160px}
 #panel .list-card h3{font-size:17px}
 .quest-tracker{width:185px;padding:7px}
 .quest-tracker h3{padding-right:30px;font-size:13px}
}
