/* Shared content-sized dock; equipment receives inspection room, backpack stays compact. */
.hud038[data-inventory-view=equipment]{--side-width:min(366px,calc(100vw - 20px))}
.hud038 #inventoryPanel[data-view=equipment]:not(.bankView) .i28Content{padding:6px!important}
.i45PaperDoll{display:grid;grid-template-columns:52px minmax(0,1fr) 52px;grid-template-rows:repeat(5,52px);gap:6px;align-items:center}
.i45Avatar{grid-column:2;grid-row:1/6;min-width:0;height:100%;overflow:hidden;border:1px solid #7b8155;border-radius:12px;touch-action:none;user-select:none;-webkit-touch-callout:none;cursor:grab;background:#172e25}
.i45Avatar:active{cursor:grabbing}.i45Avatar:focus-visible{outline:2px solid #f0d78d;outline-offset:2px}.i45Avatar canvas{width:100%;height:100%;display:block;pointer-events:none}
.i45Slot{min-width:0;align-self:stretch;display:flex;flex-direction:column;align-items:center;gap:2px}.i45Slot small{font:10px/12px system-ui;color:#e0d2a8;white-space:nowrap}.hud038 #inventoryPanel.inventory28 .i45Slot .i28Cell{height:38px!important;min-height:38px!important;width:44px!important;min-width:44px!important;aspect-ratio:auto!important;flex:1}.i45EmptySlot svg{opacity:.32}
.i45Rotation{display:flex;align-items:center;justify-content:center;gap:8px;margin:5px 0}.i45Rotation button{min-width:44px;min-height:36px;padding:2px;font-size:22px}.i45Rotation small{font:11px system-ui;color:#d9d6be}
.i45Choices{display:grid;gap:5px}.i45EquipChoice{display:flex;align-items:center;text-align:left;gap:7px;min-height:44px!important;padding:4px!important;font-size:12px!important}.i45EquipChoice svg{width:32px;height:32px;flex:none}.i45Empty,.i45Requirement{font:12px/1.4 system-ui}
.hud038 #inventoryPanel[data-view=equipment] .i28Status{display:block!important;height:auto!important;padding:3px 7px!important;font:11px/1.3 system-ui!important;max-height:44px!important;overflow:auto!important}
@media(orientation:landscape) and (max-height:550px){.hud038[data-inventory-view=equipment]{--side-width:350px}.i45PaperDoll{grid-template-columns:48px minmax(0,1fr) 48px;grid-template-rows:repeat(5,48px);gap:4px}.i45Rotation{margin:3px 0}}
.hud038[data-inventory-view=skills]{--side-width:min(320px,max(244px,60vw))}
.i45SkillGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-bottom:8px}.i45SkillTile{position:relative;min-width:0;min-height:48px;aspect-ratio:1;padding:4px!important;background:radial-gradient(ellipse at 35% 30%,#284235,#12251c);border:1px solid #b3975d;border-radius:7px}.i45SkillTile svg{width:80%;height:80%;display:block;margin:auto}.i45SkillTile strong{position:absolute;right:4px;bottom:1px;color:#fff4bf;text-shadow:0 1px 3px #000;font:bold 15px system-ui}.i45SkillTile[aria-pressed=true]{border-color:#f3d88d;background:#405937;box-shadow:inset 0 0 0 1px #f3d88d}
.i45SkillDetails{font:13px/1.4 system-ui;color:#e9dfc5;max-height:260px;overflow:auto;overscroll-behavior:contain;border-top:1px solid #8e7d4d;padding-top:7px}.i45SkillDetails h3{display:inline;font:700 18px Georgia;margin:0 8px 0 0}.i45SkillDetails p{margin:7px 0}.i45SkillDetails progress{height:12px;width:100%;accent-color:#bdd768}.i45SkillDetails h4{margin:8px 0 4px;font-size:13px}.i45Unlocks{list-style:none;padding:0;margin:0}.i45Unlocks li{padding:3px 0;border-bottom:1px solid #77916a33}.i45Unlocks li[data-unlocked=true]{color:#b6c79e}.i45NextUnlock{color:#f0d98f;font-weight:bold}.i45SkillNote{color:#c8cdbb;font-size:12px}
@media(orientation:landscape) and (max-height:550px){.hud038[data-inventory-view=skills]{--side-width:300px}.i45SkillTile{height:48px;aspect-ratio:auto}.i45SkillTile svg{height:36px;width:36px}.i45SkillDetails{max-height:170px}}
@media(orientation:portrait){
 .hud038[data-inventory-view=equipment] #inventoryPanel.inventory28:not(.bankView){max-height:calc(100dvh - var(--hud-top) - var(--hud-bottom) - 228px)!important}
 .hud038.inventoryDockOpen.activityBusy[data-inventory-view=equipment] #inventoryPanel.inventory28:not(.bankView){max-height:calc(100dvh - var(--hud-top) - var(--hud-bottom) - 414px)!important}
}
/* DEV080: actions overlay the pack; selecting an item never grows its height. */
.hud038 #inventoryPanel .i28BagGrid .i28Cell{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
#inventoryPanel .i80ItemMenu[hidden]{display:none!important}
#inventoryPanel .i80ItemMenu{position:absolute;z-index:10;inset:auto 8px 8px;max-height:calc(100% - 16px);overflow:auto;overscroll-behavior:contain;padding:12px;border:2px solid #b99b56;border-radius:10px;background:#172e25;box-shadow:0 4px 24px #000b;color:#f2e5c4;display:grid;gap:7px;font:14px/1.4 system-ui}
.i80ItemMenu h3{margin:0;font:700 19px Georgia}.i80ItemMenu p{margin:3px 0}.i80ItemMenu button{min-height:44px!important;padding:8px!important}.i80ItemMenu button:focus-visible{outline:2px solid #f3d88d;outline-offset:1px}
/* DEV081: compact inspection panel with body-focused avatar framing. */
.hud038[data-inventory-view=equipment]{--side-width:min(310px,calc(100vw - 20px))}
.hud038 #inventoryPanel[data-view=equipment] .i45PaperDoll{grid-template-columns:44px minmax(0,1fr) 44px;grid-template-rows:repeat(5,48px);gap:3px}
.hud038 #inventoryPanel[data-view=equipment] .i45Slot{justify-content:center;position:relative;gap:0}
.hud038 #inventoryPanel[data-view=equipment] .i45Slot small{display:none}
.hud038 #inventoryPanel.inventory28[data-view=equipment] .i45Slot .i28Cell{height:44px!important;min-height:44px!important;width:44px!important;flex:none}
.i45Avatar{position:relative}.i45Avatar .i45Rotation{position:absolute;bottom:2px;left:2px;right:2px;margin:0;gap:3px;justify-content:space-between;pointer-events:none}.i45Avatar .i45Rotation button{pointer-events:auto;min-width:32px;min-height:32px;font-size:18px;padding:0!important;background:#172e25bf}.i45Avatar .i45Rotation small{font:9px/1.1 system-ui;text-align:center;max-width:70px;color:#f3dfaf;text-shadow:0 1px 2px #000}
.hud038 #inventoryPanel[data-view=equipment] .i81Options{display:grid!important;grid-template-columns:1fr 1fr;gap:4px;margin:3px 0!important}.hud038 #inventoryPanel[data-view=equipment] .i81Options button{min-height:44px!important;padding:4px!important;font-size:11px!important}
@media(orientation:landscape) and (max-height:550px){.hud038[data-inventory-view=equipment]{--side-width:290px}.hud038 #inventoryPanel[data-view=equipment] .i45PaperDoll{grid-template-rows:repeat(5,44px);gap:2px}}

/* Compact Health shares the existing coin row, outside minimap/action/backpack. */
#health046{width:94px;height:44px;box-sizing:border-box;display:grid;grid-template-columns:19px 1fr;grid-template-rows:24px 5px;gap:2px 4px;align-content:center;padding:4px 6px;border:1px solid #ad9259;border-radius:8px;background:#172e25;color:#f1e4c5;font:11px/1.2 system-ui}
#health046>span{grid-row:1/3;align-self:center}#health046 svg{width:18px;height:18px}#health046 b{white-space:nowrap;align-self:center;font-size:11px}.health046Bar{height:5px;background:#3d3c2c;border-radius:3px;overflow:hidden}.health046Bar i{height:100%;display:block;background:#9caf75}#health046[data-critical=true] .health046Bar i{background:#cc735b}
.hud038 #playerControls.healthPresent046{max-width:calc(100vw - var(--navigation-width) - 30px);display:grid;grid-template-columns:minmax(52px,90px) 94px;gap:5px}.hud038 #playerControls.healthPresent046 #coinBalance{min-width:52px!important;max-width:90px!important;padding:3px 5px!important}

/* Compact backpack slots for short phone landscape viewports. */
@media (orientation: landscape) and (max-height: 550px) {
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28BagGrid {
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28BagGrid .i28Cell {
  --backpack-cell-height:clamp(24px,calc((100dvh - var(--hud-top) - var(--hud-bottom) - var(--backpack-reserved-height,110px))/4),36px);
  height:var(--backpack-cell-height)!important;
  min-height:var(--backpack-cell-height)!important;
  padding:2px!important;
 }
}


/* Keep the landscape map in the corner and its controls in the top row. */
@media (orientation: landscape) and (max-height: 550px) {
 .hud038:not(.inventoryDockOpen) #navigationHUD,
 .hud038.inventoryDockOpen[data-inventory-view="inventory"] #navigationHUD {
  top:calc(var(--hud-top) + 6px)!important;
  right:var(--hud-right)!important;
  width:auto!important;
  display:grid;
  grid-template-columns:var(--navigation-width) 68px;
  align-items:start;
  column-gap:6px;
  pointer-events:none;
 }
 .hud038:is(:not(.inventoryDockOpen),[data-inventory-view="inventory"]) #navigationHUD .mapControls {grid-column:1;grid-row:1;pointer-events:auto}
 .hud038:is(:not(.inventoryDockOpen),[data-inventory-view="inventory"]) #navigationHUD #minimap {grid-column:2;grid-row:1;pointer-events:auto}
 .hud038:is(:not(.inventoryDockOpen),[data-inventory-view="inventory"]) #navigationHUD #destinationHint {grid-column:2;grid-row:2;max-width:88px}
 .hud038[data-inventory-view="inventory"] {--side-width:264px}
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) {
  --pack-top:calc(var(--hud-top) + 114px);
  --backpack-reserved-height:224px;
 }
}
@media (orientation: landscape) and (max-height: 339px) {
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) {
  right:var(--hud-right)!important;
  --pack-top:calc(var(--hud-top) + 80px);
  --backpack-reserved-height:178px;
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28Head {
  height:24px!important;min-height:24px!important;
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28Close {
  height:22px!important;min-height:22px!important;
  display:grid;place-items:center;padding:0!important;font:700 16px/1 system-ui;
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28Nav {
  height:28px!important;min-height:28px!important;
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28Nav button {
  height:24px!important;min-height:24px!important;
  display:flex;align-items:center;justify-content:center;padding:0!important;
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28Nav svg {
  display:block;width:18px!important;height:18px!important;flex:none;
 }
 .hud038.inventoryDockOpen[data-inventory-view="inventory"] #navigationHUD #destinationHint {
  grid-column:1;justify-self:end;
 }
}

/* Compact portrait HUD for phone-width screens. */
#health046 .health046Bar i{background:#268137}
@media (orientation:portrait) and (max-width:600px) {
 .hud038,.hud038.inventoryDockOpen{
  --navigation-width:108px;
  --message-width:min(226px,calc(100vw - var(--navigation-width) - 30px));
  --message-height:96px;
 }
 .hud038.messagesCollapsed{--message-height:34px}
 .hud038 #messageWindow{font-size:10px;line-height:1.25;padding:3px}
 .hud038 #messageWindow nav button{min-height:24px;font-size:9px!important}
 .hud038 #messageLog{margin-top:3px;padding:0 3px}
 .hud038 #messageLog li{gap:4px;padding:1px 0}
 .hud038 #messageLog li>span{width:12px}
 .hud038 #minimap{width:90px!important;height:90px!important}
 .hud038 #navigationHUD #menuToggle,.hud038 #navigationHUD #mapToggle,.hud038 #navigationHUD #runToggle{
  height:34px!important;min-height:34px!important;padding:4px!important
 }
 .hud038 .mapControls svg{width:21px!important;height:21px!important}
 .hud038 #gameHUD{top:calc(var(--hud-top) + 149px)!important}
 .hud038 #gameHUD .roundIcon{width:34px;height:34px;min-width:34px;padding:4px}
 .hud038 #gameHUD .roundIcon svg{width:19px;height:19px}
 .hud038 #inventoryRestore .i28Shortcut{width:37px;height:40px;flex-basis:37px;padding:3px}
 .hud038 #inventoryRestore .i28Shortcut svg{width:23px!important;height:23px!important}
 .hud038 #inventoryRestore .i28Shortcut[data-tab="inventory"]{padding-bottom:10px}
 .hud038 #playerControls.healthPresent046{grid-template-columns:48px 73px;gap:4px}
 .hud038 #playerControls.healthPresent046 #coinBalance{min-width:0!important;height:30px!important;font-size:11px;gap:3px}
 .hud038 #coinBalance svg{width:17px;height:17px}
 .hud038 #health046{width:73px;height:30px;grid-template-columns:14px 1fr;grid-template-rows:14px 4px;gap:1px 3px;padding:2px 4px}
 .hud038 #health046 svg{width:14px;height:14px}
 .hud038 #health046 b{font-size:10px}
 .hud038 #health046 .health046Bar,.hud038 #health046 .health046Bar i{height:4px}
 .hud038[data-inventory-view="inventory"]{--side-width:min(238px,57vw)}
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView){
  --pack-top:calc(var(--hud-top) + 185px);
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28Nav button{
  min-height:32px!important;height:32px!important;padding:2px!important
 }
 .hud038 #inventoryPanel.inventory28[data-view="inventory"]:not(.bankView) .i28BagGrid .i28Cell{
  height:clamp(28px,5.5dvh,39px)!important;min-height:28px!important;aspect-ratio:auto!important
 }
}

/* Touching or holding fire controls must not activate native text selection. */
#dialog.survivalFireDialog {
 -webkit-user-select:none;
 user-select:none;
 -webkit-touch-callout:none;
}
#dialog.survivalFireDialog input {
 -webkit-user-select:text;
 user-select:text;
}

.combatPanel{display:grid;gap:10px;min-width:0;padding:2px}
.combatPanel h3{margin:0 0 5px;font-size:13px;color:#f5dfab}
.combatSkills,.combatStyles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.combatSkill{display:grid;gap:4px;min-width:0;padding:6px 8px;border:1px solid #78653e;border-radius:6px;background:#242a20}
.combatSkillHeading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px 6px;font-size:12px}
.combatSkillHeading span{color:#f3cf77;white-space:nowrap}
.combatPanel small,.combatTrainingHint{font-size:11px;color:#e0d3b8}
.combatSkill progress{appearance:none;width:100%;height:4px;border:0;border-radius:3px;background:#404331;overflow:hidden;accent-color:#d3ac56}
.combatSkill progress::-webkit-progress-bar{background:#404331}
.combatSkill progress::-webkit-progress-value{background:#d3ac56}
.combatSkill progress::-moz-progress-bar{background:#d3ac56}
.combatTrainingHint{margin:0 0 6px;line-height:1.3}
#inventoryPanel .combatStyles button{display:grid;align-content:center;gap:2px;min-height:42px;min-width:0;padding:4px;font-size:12px;text-align:center;white-space:normal}
#inventoryPanel .combatStyles button[aria-pressed=true]{background:#54401f;border-color:#f3cf77;color:#fff0bc;box-shadow:inset 0 0 0 1px #e1bd69}

/* Fishing uses a single button above the bottom-right inventory shortcuts. */
.hud038:not(.inventoryDockOpen) #actionDock[data-fishing=true],
.hud038.inventoryDockOpen #actionDock[data-fishing=true] {
 left:auto!important;
 right:var(--hud-right)!important;
 top:auto!important;
 bottom:calc(var(--hud-bottom) + 68px)!important;
 width:auto!important;
 max-width:none!important;
 grid-template-columns:1fr!important;
 grid-template-rows:auto!important;
}
.hud038.inventoryDockOpen #actionDock[data-fishing=true] {
 right:calc(var(--hud-right) + var(--side-width) + 8px)!important;
 bottom:calc(var(--hud-bottom) + 15px)!important;
}
.hud038 #actionDock[data-fishing=true] #cancelWork {
 grid-column:1!important;
 grid-row:1!important;
 width:58px!important;
 min-width:58px!important;
 min-height:52px!important;
 flex-direction:column!important;
 margin:0!important;
}

/* Keep the center of a phone's landscape viewport clear for gameplay. */
@media (orientation: landscape) and (max-height: 550px) {
 .hud038,.hud038.inventoryDockOpen {
  --navigation-width:122px;
  --message-width:clamp(160px,34vw,270px);
  --message-height:76px;
 }
 .hud038 #messageWindow {padding:3px;font-size:11px}
 .hud038 #messageWindow nav button {min-height:28px;min-width:29px;padding:2px 4px}
 .hud038 #playerControls.healthPresent046 {grid-template-columns:58px 76px;gap:4px}
 .hud038 #playerControls.healthPresent046 #coinBalance {height:32px!important;min-width:0!important;gap:3px}
 .hud038 #coinBalance svg {width:17px;height:17px}
 .hud038 #coinBalance #coinValue {font-size:13px}
 .hud038 #health046 {width:76px;height:32px;grid-template-rows:15px 4px;padding:2px 4px}
 .hud038 #minimap {width:68px!important;height:68px!important}
 .hud038 #navigationHUD :is(#menuToggle,#mapToggle,#runToggle) {height:36px!important;min-height:36px!important;padding:3px!important}
 .hud038 .mapControls svg {width:20px!important;height:20px!important}
 .hud038 #gameHUD .roundIcon {width:37px;height:37px;min-width:37px;padding:3px}
 .hud038 #gameHUD .roundIcon svg {width:21px;height:21px}
 .hud038 #travelHUD:not([hidden]) {width:max-content;max-width:var(--message-width)!important;padding:3px 5px;gap:8px}
 .hud038 #travelHUD #cancelTravel {min-height:30px;padding:3px 7px;font-size:11px}
}
