/* One compact HUD layout owner. Large surfaces exist only while explicitly open. */
.hudCompact {
  --hud-paper: #f3ead2; --hud-ink: #302b20; --hud-muted: #5b563f;
  --hud-edge: #978159; --hud-olive: #495238; --hud-cell: 44px;
}
.hudCompact #hint { display:none!important; }
.hudCompact #stats { gap:9px; }
.hudCompact .stat { width:52px;height:52px; }
.hudCompact .hudButton, .hudCompact .hudPin, .hudCompact .hudHeldSlot {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:40px; margin:0; padding:8px 11px; border:1px solid #99815a; border-radius:9px;
  background:#f3ead2; color:#302b20; font:600 14px/1.2 system-ui,sans-serif; cursor:pointer;
  box-shadow:0 2px 7px #1f22192b; flex:none;
}
.hudCompact button:focus-visible, .hudCompact input:focus-visible, .hudCompact [tabindex="0"]:focus-visible {
  outline:3px solid #345b86!important; outline-offset:2px;
}
.hudCompact .hudButton:hover, .hudCompact .hudPin:hover:not(:disabled), .hudCompact .hudHeldSlot:hover { background:#fff7e2; border-color:#5d663b; }
.hudCompact kbd { display:inline-block; padding:2px 4px; border:1px solid #9d9279; border-radius:4px; background:#fff9e9; color:#47432f; font:11px/1.1 system-ui,sans-serif; }
.hudCompact .hudButton[aria-expanded="true"] { background:#d7dfbd; border-color:#53633b; }
.hudCompact #hudCraftRail { position:absolute;left:16px;top:100px;display:flex;align-items:center;gap:7px;pointer-events:auto; }
.hudCompact #hudCraftPins { display:flex;gap:5px; }
.hudCompact .hudPin { width:40px;height:40px;padding:4px;background:#f3ead2de; }
.hudCompact .hudPin:disabled { opacity:.68;cursor:default; }
.hudCompact .hudPin canvas { width:30px;height:30px; }
.hudCompact #hudPrimaryActions { position:absolute;right:14px;top:142px;display:flex;gap:6px;pointer-events:auto; }
.hudCompact #hudPrimaryActions .hudButton { min-height:36px; }
.hudCompact #dayWrap { top:10px!important;right:16px!important; }
.hudCompact #dayNum { padding:2px 7px;background:#303723e6;border-radius:7px;color:#fff2d1;font:13px/1.35 system-ui,sans-serif;margin-top:0; }
.hudCompact #wth {color:#eef0d5;font:12px/1.3 system-ui,sans-serif;}

/* Pockets stay a single row. Trim only the frame; hitboxes and text keep their size. */
.hudCompact #s4InventoryDock {
  position:absolute; bottom:10px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 24px);
  display:flex;flex-direction:row;align-items:center;gap:8px;padding:3px;
  border:1px solid #8b805c;border-radius:12px;background:#4b5439e8;box-shadow:0 3px 12px #22251633;
  pointer-events:auto;z-index:26;box-sizing:border-box;
}
.hudCompact #s4InventoryDock #inv.inventoryV4 {
  position:static;display:flex;flex-direction:row;gap:0;align-items:center;width:auto;max-width:none;max-height:none;
  transform:none;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none;overflow:visible;
}
.hudCompact #inv [data-compartment="base"]>.s4InventoryGrid {display:flex;gap:4px;}
.hudCompact #inv .s4Slot {width:var(--hud-cell);height:var(--hud-cell);flex:none;border-radius:7px;border:1px solid #b2b38a;background:#2b3426;}
.hudCompact #inv .s4Slot.empty {background:#626c49;border:1px solid #acb187;opacity:.38;}
.hudCompact #inv .s4Slot[hidden] {display:none!important;}
.hudCompact #inv .s4Slot:hover {transform:none;border-color:#eedda4;}
.hudCompact .s4ItemUse {border-radius:6px;padding:3px;}
.hudCompact #inv .s4Slot canvas {width:34px;height:34px;}
.hudCompact #inv .s4Slot .cnt {font:700 12px/1.2 system-ui,sans-serif;color:#fff7d8;background:#253020d9;border-radius:4px;padding:1px 2px;right:2px;bottom:1px;}
.hudCompact #s4InventoryDock:not(.hudInventoryOpen) #inv .s4InventoryLabel,
.hudCompact #s4InventoryDock:not(.hudInventoryOpen) #inv [data-compartment="equipment-backpack"],
.hudCompact #s4InventoryDock:not(.hudInventoryOpen) #inv [data-compartment="backpack"],
.hudCompact #s4InventoryDock:not(.hudInventoryOpen) #inv [data-compartment="overflow"],
.hudCompact #s4InventoryDock:not(.hudInventoryOpen) #clothes {display:none!important;}
.hudCompact #hudInventoryControls {display:flex;gap:7px;align-items:center;flex:none;}
.hudCompact #hudInventoryToggle {height:44px;min-height:44px;display:grid;grid-template-columns:auto auto;gap:1px 5px;min-width:67px;padding:4px 7px;}
.hudCompact #hudInventoryToggle .hudBagLabel {font-size:11px;grid-column:1;}
.hudCompact #hudInventoryToggle .hudPocketCount {font-size:14px;grid-column:1;}
.hudCompact #hudInventoryToggle kbd {grid-column:2;grid-row:1/3;}
.hudCompact #hudHeldGear {display:flex;gap:4px;}
.hudCompact .hudHeldSlot {width:44px;height:44px;padding:4px;background:#d7dcc0;}
.hudCompact .hudHeldSlot canvas {width:32px;height:32px;}
.hudCompact .hudHeldSlot span {font-size:22px;}
.hudCompact #hudPocketPages {display:flex;align-items:center;gap:3px;}
.hudCompact #hudPocketPages button {width:26px;height:40px;min-height:40px;padding:0;font-size:22px;}
.hudCompact #hudPocketPages button:disabled {opacity:.4;cursor:default;}
.hudCompact #hudPocketPage {color:#fff4d9;font:12px system-ui,sans-serif;min-width:21px;text-align:center;}
.hudCompact #hudBagSummary {position:absolute;right:4px;bottom:calc(100% + 5px);padding:3px 8px;min-height:25px;font-size:12px;background:#f3ead2;}
.hudCompact #hudBagSummary.hudWarning {background:#fff0c4;border:2px solid #9c553a;}
.hudCompact #s4InventoryDock .s4Drop.enotDropBtn {
  width:18px!important;height:18px!important;font:bold 16px/1 system-ui!important;
  opacity:0!important;pointer-events:none!important;transition:opacity .1s;
}
.hudCompact #s4InventoryDock .s4Slot:hover>.s4Drop,
.hudCompact #s4InventoryDock .s4Slot:focus-within>.s4Drop,
.hudCompact #s4InventoryDock #clothes .cslot:hover>.s4Drop,
.hudCompact #s4InventoryDock #clothes .cslot:focus-within>.s4Drop {opacity:1!important;pointer-events:auto!important;}

/* The same real inventory nodes expand; no duplicated items or second save model. */
.hudCompact #s4InventoryDock.hudInventoryOpen {width:min(640px,calc(100vw - 24px));max-height:calc(100vh - 155px);flex-direction:column;align-items:stretch;padding:12px;background:#f3ead2;border-color:#978159;box-shadow:0 8px 24px #171c1940;overflow:auto;}
.hudCompact #s4InventoryDock.hudInventoryOpen #inv {display:flex;flex-direction:column;gap:10px;width:100%;align-items:stretch;}
.hudCompact #s4InventoryDock.hudInventoryOpen .s4InventoryGrid {display:grid!important;grid-template-columns:repeat(10,minmax(0,1fr));gap:5px;}
.hudCompact #s4InventoryDock.hudInventoryOpen .s4Slot {width:auto;height:48px;}
.hudCompact #s4InventoryDock.hudInventoryOpen .s4InventoryLabel {color:#393b28;font:600 13px/1.5 system-ui,sans-serif;padding-bottom:4px;}
.hudCompact #s4InventoryDock.hudInventoryOpen #clothes {display:flex!important;position:relative!important;flex-direction:row!important;justify-content:flex-start;flex-wrap:wrap;gap:6px!important;padding:4px 0 22px!important;background:none!important;box-shadow:none!important;border:0!important;}
.hudCompact #s4InventoryDock.hudInventoryOpen #clothes .slot {width:46px!important;height:44px!important;}
.hudCompact #s4InventoryDock.hudInventoryOpen #clothes .yoEquipCaption {color:#4b492f;font:11px system-ui,sans-serif;}
.hudCompact #s4InventoryDock.hudInventoryOpen #clothes>span:first-child {color:#4b492f!important;}
.hudCompact #s4InventoryDock.hudInventoryOpen #hudHeldGear {display:none;}
.hudCompact #s4InventoryDock.hudInventoryOpen #hudBagSummary {position:static;align-self:flex-start;}
.hudCompact .s4BackpackSlot {color:#4c4d32;font:13px system-ui,sans-serif;}
.hudCompact .s4BackpackSlot .s4Slot {width:48px!important;}
.hudCompact #inventoryV4Tooltip,.hudCompact #inventoryV4Menu {font:14px/1.45 system-ui,sans-serif;background:#f6eedb;color:#302b20;border-color:#8d7953;box-shadow:0 4px 15px #16211840;}
.hudCompact #inventoryV4Menu button {font-size:14px;background:#e5e6cf;color:#282f1c;border-color:#899367;min-height:38px;}

/* Craft and help drawers have legible paper, an explicit close button and bounded scroll. */
.hudCompact .hudPanel {position:absolute;z-index:80;pointer-events:auto;background:#f3ead2;color:#302b20;border:1px solid #978159;border-radius:13px;padding:14px;box-shadow:0 8px 24px #171c1940;box-sizing:border-box;}
.hudCompact .hudPanelHeader {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 9px;flex:none;}
.hudCompact .hudPanelHeader h2 {font:700 19px/1.3 system-ui,sans-serif;color:#302b20;margin:0;}
.hudCompact .hudPanelHeader button {min-height:32px;width:32px;height:32px;padding:0;font:20px system-ui,sans-serif;}
.hudCompact #hudCraftPanel {left:16px;top:150px;width:360px;max-height:calc(100vh - 230px);display:flex;flex-direction:column;gap:8px;}
.hudCompact #hudCraftSearch {width:100%;padding:10px 12px;border:1px solid #8c8b67;border-radius:8px;background:#fffaee;color:#302b20;font:14px/1.3 system-ui,sans-serif;user-select:text;}
.hudCompact .hudCraftFilters {display:flex;flex-wrap:wrap;gap:5px;flex:none;}
.hudCompact .hudCraftFilters .hudButton {font-size:12px;min-height:30px;padding:6px 8px;box-shadow:none;}
.hudCompact .hudCraftFilters [aria-pressed="true"] {background:#485438;color:#fff7dc;border-color:#485438;}
.hudCompact #hudCraftPanel #craftList {position:static;display:flex;flex-direction:column;min-height:0;max-height:none;overflow:auto;padding:3px 4px 3px 0;gap:7px;}
.hudCompact .hudRecipe {display:flex;align-items:stretch;border:1px solid #b6ad8e;border-radius:8px;background:#fff9e8;flex:none;}
.hudCompact .hudRecipe .craftBtn {display:flex;flex:1;min-width:0;gap:9px;padding:9px;border:0;background:none;color:#302b20;font:14px/1.3 system-ui,sans-serif;box-shadow:none;}
.hudCompact .hudRecipe .craftBtn:hover {transform:none;background:#e5ebd2;}
.hudCompact .hudRecipe .craftBtn:disabled {opacity:1;color:#625c48;cursor:not-allowed;}
.hudCompact .hudRecipe .craftBtn>canvas {width:36px;height:36px;flex:none;}
.hudCompact .hudRecipe .cinfo {display:flex;flex-direction:column;gap:4px;min-width:0;}
.hudCompact .hudRecipe .cname {font-weight:650;}
.hudCompact .hudRecipe .ccost {display:flex;flex-wrap:wrap;gap:3px 8px;font-size:11px;line-height:1.4;}
.hudCompact .hudRecipe .ccost .ok {color:#405a25;}.hudCompact .hudRecipe .ccost .no {color:#914131;}
.hudCompact .hudFavourite {flex:none;width:33px;background:none;border:0;border-left:1px solid #d1c7a9;border-radius:0 7px 7px 0;font:23px system-ui;color:#776849;cursor:pointer;}
.hudCompact .hudFavourite[aria-pressed="true"] {color:#886218;background:#fff0c2;}
.hudCompact .hudFine,.hudCompact .hudEmpty {font:12px/1.45 system-ui,sans-serif;color:#59563f;margin:0;}
.hudCompact #hudHelpPanel {right:14px;top:188px;width:430px;max-height:calc(100vh - 262px);overflow:auto;}
.hudCompact .hudKeyList {display:grid;grid-template-columns:minmax(125px,.8fr) 1.4fr;gap:0;font:14px/1.45 system-ui,sans-serif;}
.hudCompact .hudKeyList dt,.hudCompact .hudKeyList dd {padding:7px 6px;margin:0;border-bottom:1px solid #d9ceb0;}
.hudCompact .hudKeyList dt {font-weight:650;color:#354428;}
.hudCompact #hudHelpPanel #enotGuide {position:static!important;transform:none!important;width:100%!important;box-shadow:none;margin:12px 0 5px;padding:10px;font:14px/1.5 system-ui,sans-serif;border:1px solid #b6a06d;}
.hudCompact #hudHelpPanel #enotGuide.hiddenGuide {display:none;}
.hudCompact #hudHelpPanel #enotGuideClose {display:none;}
.hudCompact #hudHelpPanel #enotGuideToggle {max-width:none;min-height:36px;opacity:1;font:13px system-ui,sans-serif!important;}
.hudCompact #enotActionDock {display:none;right:14px;top:188px;width:250px;max-height:calc(100vh - 265px);overflow:auto;padding:12px;background:#f3ead2;border:1px solid #978159;border-radius:12px;box-shadow:0 8px 24px #171c1940;}
.hudCompact #enotActionDock.hudMoreOpen {display:flex;gap:6px;}
.hudCompact #enotActionDock button {background:#fff8e7!important;color:#302b20!important;font:14px/1.3 system-ui,sans-serif!important;box-shadow:none!important;backdrop-filter:none!important;border:1px solid #b7ac8a!important;min-height:38px;padding:8px!important;text-align:left;}
.hudCompact #enotActionDock .hudPanelHeader button {width:32px;min-width:32px;min-height:32px!important;text-align:center;}
.hudCompact #enotActionDock button:hover {transform:none;background:#e4ebd2!important;}
.hudCompact [hidden] {display:none!important;}
.hudCompact #chest {max-height:calc(100vh - 270px);top:188px;}
.hudCompact #yoGearPicker {background:#f3ead2;color:#302b20;bottom:80px;border:1px solid #978159;}
.hudCompact #yoGearPicker .choice {color:#302b20;font:14px system-ui,sans-serif;}
.hudCompact #yoGearPicker h3 {font:18px system-ui,sans-serif;}
@media (max-width:1000px) {
 .hudCompact #hudCraftRail {top:96px;left:12px;}
 .hudCompact #hudPrimaryActions {right:12px;top:139px;}
 .hudCompact #hudCraftPanel {left:12px;top:144px;max-height:calc(100vh - 223px);}
 .hudCompact #hudHelpPanel {top:183px;max-height:calc(100vh - 260px);}
 .hudCompact #chest {top:175px;left:12px;width:260px;max-height:calc(100vh - 480px);}
}
@media (max-width:600px) {
 .hudCompact {--hud-cell:42px;}
 .hudCompact #stats {top:10px;left:10px;gap:7px;}.hudCompact .stat {width:42px;height:42px;}
 .hudCompact #hudCraftRail {top:78px;left:10px;gap:5px;}
 .hudCompact #hudCraftRail .hudButton {padding:8px;font-size:13px;}
 .hudCompact .hudPin {width:36px;height:36px;min-height:36px;}
 .hudCompact #hudPrimaryActions {right:10px;top:127px;gap:4px;}
 .hudCompact #hudPrimaryActions .hudButton {font-size:12px;padding:6px 8px;min-height:32px;}
 .hudCompact #hudHeldGear {display:none;}
 .hudCompact #s4InventoryDock {padding:5px;gap:5px;bottom:8px;max-width:calc(100vw - 16px);}
 .hudCompact #hudInventoryControls {gap:4px;}
 .hudCompact #hudInventoryToggle {min-width:60px;padding:3px 4px;}
 .hudCompact #hudPocketPages {gap:2px;}.hudCompact #hudPocketPages button {width:23px;}
 .hudCompact #s4InventoryDock.hudInventoryOpen {max-height:calc(100vh - 175px);padding:10px;}
 .hudCompact #s4InventoryDock.hudInventoryOpen .s4InventoryGrid {grid-template-columns:repeat(5,minmax(0,1fr));}
 .hudCompact #s4InventoryDock.hudInventoryOpen #clothes .slot {width:42px!important;height:42px!important;}
 .hudCompact #hudCraftPanel,.hudCompact #hudHelpPanel {left:10px;right:10px;top:168px;width:auto;max-height:calc(100vh - 245px);padding:12px;}
 .hudCompact #enotActionDock {right:10px;top:166px;max-height:calc(100vh - 242px);}
 .hudCompact #chest {top:165px!important;left:10px!important;width:calc(100vw - 20px);max-height:27vh;}
 .hudCompact:has(#chest.show) #s4InventoryDock.hudInventoryOpen {max-height:40vh;}
 .hudCompact .hudKeyList {grid-template-columns:1fr 1.3fr;font-size:13px;}
 .hudCompact #coopHud {top:56px;max-width:calc(100vw - 190px);}.hudCompact #peerRows {display:none;}
}
@media(pointer:coarse) {.hudCompact #s4InventoryDock .s4Drop.enotDropBtn{opacity:1!important;pointer-events:auto!important;width:22px!important;height:22px!important;}}
@media(prefers-reduced-motion:reduce) {.hudCompact * {transition:none!important;}}
