/* N1.5.2 real inventory UI — faithful to reference image (12) upper and image (11) lower.
   Black/gold CAELYTTE palette; no account, stats or equipment state invented here. */
.hud-overlay.inventory-overlay {padding: 10px 12px; align-items:center;}
.hud-dialog.inventory-dialog {width:min(1510px,calc(100vw - 24px)); height:min(96vh,1000px); max-height:calc(100vh - 20px); border-radius:12px;}
.inventory-dialog .hud-dialog-header {padding:10px 20px 12px; flex:0 0 auto;}
.inventory-dialog .hud-dialog-header h2 {font:700 clamp(23px,2.1vw,34px) Georgia,serif; text-transform:uppercase; letter-spacing:.025em;}
.inventory-dialog .hud-dialog-content {flex:1 1 auto; min-height:0; padding:10px 14px 18px; overflow-x:hidden; overflow-y:auto; scrollbar-color:var(--hud-gold-muted) var(--hud-black); scrollbar-width:thin;}
.inventory-frame {display:flex; flex-direction:column; gap:12px; min-width:0;}
.inventory-columns {display:grid; grid-template-columns: 32% 37% minmax(0,1fr); gap:9px; min-width:0; align-items:stretch;}
.inventory-column {border:1px solid var(--hud-gold-muted); border-radius:5px; background:var(--hud-black-soft); padding:10px; min-width:0; display:flex; flex-direction:column; min-height:420px;}
.inventory-eyebrow {font:800 10px system-ui,sans-serif; letter-spacing:.14em; color:var(--hud-gold);}
.inventory-character-heading,.inventory-column-heading {display:flex; justify-content:space-between; align-items:baseline; border-bottom:1px solid var(--hud-gold-muted); padding:4px 0 7px; gap:8px;}
.inventory-character-heading strong,.inventory-column-heading h3 {font:700 19px Georgia,serif; color:var(--hud-gold); margin:0; overflow:hidden; text-overflow:ellipsis;}
.inventory-character-heading small,.inventory-item-total {font:10px system-ui,sans-serif; color:var(--hud-gold-muted);}
.inventory-doll-formation {display:grid; grid-template-columns:clamp(36px,3.1vw,48px) minmax(0,1fr) clamp(36px,3.1vw,48px); gap:8px; flex:1; min-height:285px; align-items:center;}
.inventory-equipment-stack {display:flex; flex-direction:column; align-items:stretch; justify-content:space-around; gap:6px; align-self:stretch; padding:6px 0;}
.inventory-equip-slot {display:grid; place-items:center; width:100%; aspect-ratio:1; padding:2px; border-radius:4px; background:var(--hud-black); border:1px solid var(--hud-gold-muted); color:var(--hud-gold-muted); font-size:21px;}
.inventory-equip-slot.occupied {color:var(--hud-gold); border-color:var(--hud-gold); box-shadow:inset 0 0 0 1px var(--hud-gold-muted);}
.inventory-equip-slot:hover,.inventory-equip-slot:focus-visible {border-color:var(--hud-gold);}
.inventory-doll {position:relative; width:100%; height:100%; min-height:280px; display:flex; justify-content:center; align-items:center; flex-direction:column; overflow:hidden;}
.inventory-doll-image {object-fit:contain; object-position:center bottom; max-width:100%; width:auto; max-height: min(37vh,365px); min-height:170px; filter:drop-shadow(0 8px 12px rgba(0,0,0,.72));}
.inventory-doll-caption {position:absolute; bottom:0; color:var(--hud-gold-muted); font:8px system-ui,sans-serif; letter-spacing:.06em; text-align:center; padding:2px 4px; background:rgba(0,0,0,.75);}
.inventory-bottom-slots {display:flex; border:1px solid var(--hud-gold-muted); border-radius:5px; gap:10px; padding:8px; min-height:74px; align-items:center;}
.inventory-mini-heading {display:block; margin-bottom:4px; font:700 9px system-ui,sans-serif; color:var(--hud-gold); white-space:nowrap;}
.inventory-wings-group {flex:0 0 auto; display:flex; flex-direction:column; align-items:start; padding-right:10px; border-right:1px solid var(--hud-gold-muted);}
.inventory-wings-group .wings-square {width:43px; height:43px; color:var(--hud-gold); border:1px solid var(--hud-gold);}
.inventory-reserved {min-width:0; flex:1;}
.inventory-reserved-grid {display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px;}
.inventory-reserved-square {display:grid; place-items:center; aspect-ratio:1; border:1px solid var(--hud-gold-muted); border-radius:4px; font:12px Georgia,serif; color:var(--hud-gold-muted); opacity:.65;}
.inventory-column-heading {margin:0 0 7px; padding-top:0;}
.inventory-column-heading h3 {margin:2px 0 0;}
.inventory-categories {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; margin:0 0 5px; border:1px solid var(--hud-gold-muted); border-radius:4px; padding:3px;}
.inventory-category {border:1px solid transparent; background:transparent; font:700 clamp(9px,.9vw,12px) Georgia,serif; padding:7px 2px; min-width:0; color:var(--hud-gold); white-space:nowrap;}
.inventory-category.selected {border-color:var(--hud-gold); color:var(--hud-gold); background:var(--hud-black);}
.inventory-bag-controls {display:grid; grid-template-columns:1fr 1fr; gap:5px;}
.inventory-kind-select,.inventory-search {width:100%; height:31px; min-width:0; padding:4px 7px; border:1px solid var(--hud-gold-muted); border-radius:3px; font:11px system-ui,sans-serif; color:var(--hud-gold); background:var(--hud-black);}
.inventory-count {font:10px system-ui,sans-serif; color:var(--hud-gold-muted); margin:7px 0;}
.inventory-grid {display:grid; grid-template-columns:repeat(9,minmax(0,1fr)); gap:3px; align-content:start; border:1px solid var(--hud-gold-muted); border-radius:4px; padding:4px;}
.inventory-cell {position:relative; aspect-ratio:1; display:grid; place-items:center; min-width:0; min-height:0; padding:1px; background:var(--hud-black-soft); border:1px solid var(--hud-gold-muted); border-radius:3px;}
.inventory-cell:disabled {opacity:.72;}
.inventory-cell.is-equipped {border-color:var(--hud-gold);}
.inventory-cell.is-selected {outline:2px solid var(--hud-gold); outline-offset:-1px;}
.inventory-item-icon {font:clamp(16px,1.5vw,25px) Georgia,serif; color:var(--hud-gold);}
.inventory-item-quantity {position:absolute; right:3px; bottom:3px; padding:1px 6px; border-radius:999px; background:rgba(5,8,12,.92); border:1px solid var(--hud-gold-muted); font:800 12px/1 system-ui,sans-serif; color:var(--hud-gold-light); text-shadow:0 1px 0 rgba(0,0,0,.45);}
.inventory-bag-foot {font:9px system-ui,sans-serif; color:var(--hud-gold-muted); margin:5px 0 0; margin-top:auto; padding-top:8px; text-align:center;}
.inventory-detail-heading {margin:0 0 12px; padding:6px 0 9px; color:var(--hud-gold); border-bottom:1px solid var(--hud-gold-muted); font:700 13px Georgia,serif; letter-spacing:.06em;}
.inventory-empty {display:flex; flex:1; flex-direction:column; gap:10px; justify-content:center; align-items:center; text-align:center; padding:14px; color:var(--hud-gold);}
.inventory-empty-symbol {font:78px Georgia,serif; opacity:.28;}
.inventory-empty-mark {font-size:20px; color:var(--hud-gold);}
.inventory-empty p {font:12px/1.6 system-ui,sans-serif; max-width:250px;}
.inventory-empty small {font-size:10px; color:var(--hud-gold-muted);}
.inventory-large-icon {display:grid; place-items:center; min-height:120px; font:70px Georgia,serif; color:var(--hud-gold); border:1px solid var(--hud-gold-muted);}
.inventory-object-name {font:700 18px Georgia,serif; color:var(--hud-gold); overflow-wrap:anywhere;}
.inventory-object-description,.inventory-type,.inventory-cosmetic-note {font:12px/1.5 system-ui,sans-serif; color:var(--hud-gold); overflow-wrap:anywhere;}
.inventory-action {min-height:40px; margin-top:auto; color:var(--hud-gold);}
.inventory-summary {border-top:1px solid var(--hud-gold-muted); padding:10px 2px 18px;}
.inventory-summary-heading {font:700 20px Georgia,serif; color:var(--hud-gold); margin:0 0 5px;}
.inventory-summary-note {font:10px system-ui,sans-serif; color:var(--hud-gold-muted); margin:0 0 10px;}
.inventory-summary-columns {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px;}
.inventory-summary-column {min-height:324px; padding:12px; border:1px solid var(--hud-gold-muted); border-radius:5px; background:var(--hud-black-soft);}
.inventory-stat-row {display:grid; grid-template-columns:clamp(34px,3.2vw,49px) minmax(0,1fr) 18px; gap:8px; align-items:center; border-bottom:1px solid var(--hud-gold-muted); padding:7px 0; min-height:65px;}
.inventory-stat-icon {width:clamp(34px,3.2vw,49px);height:clamp(34px,3.2vw,49px);object-fit:contain;display:block;}
.inventory-stat-value {color:var(--hud-gold);font:700 18px Georgia,serif;}
.inventory-stat-label {color:var(--hud-gold);font:800 clamp(12px,1.08vw,16px)/1.15 Georgia,serif;overflow-wrap:anywhere;}
.inventory-stat-value {text-align:right;}
.inventory-feedback {font:12px system-ui,sans-serif; color:var(--hud-gold); min-height:22px; margin:0; padding:4px;}
.inventory-feedback[data-error="true"] {border:1px solid var(--hud-gold-muted); padding:7px;}
@media(max-width:1100px){.inventory-columns {grid-template-columns:minmax(230px,34%) minmax(270px,1fr) minmax(195px,25%); gap:5px;}.inventory-column {padding:7px;}.inventory-doll-formation {gap:4px;}.inventory-bottom-slots {gap:5px;}.inventory-dialog .hud-dialog-content {padding:7px;}}
@media(max-width:780px){.inventory-columns {grid-template-columns:1fr 1fr;}.item-detail-column {grid-column:1/-1; min-height:210px;}.inventory-summary-columns {grid-template-columns:repeat(2,minmax(0,1fr));}.inventory-dialog .hud-dialog-content {overflow-y:auto;}}
@media(max-width:530px){.inventory-columns {grid-template-columns:1fr;}.item-detail-column {grid-column:1;}.inventory-grid {grid-template-columns:repeat(8,minmax(0,1fr));}.inventory-doll-image {max-height:290px;}.inventory-summary-columns {grid-template-columns:1fr;}.hud-dialog.inventory-dialog {height:calc(100vh - 14px);width:calc(100vw - 12px);}}

.inventory-elemental-heading {color:var(--hud-gold);font:700 16px Georgia,serif;margin:14px 0 8px;border-bottom:1px solid var(--hud-gold-muted);padding-bottom:8px;}
.inventory-element-column {min-height:0;padding:9px 12px;}
.inventory-element-column .inventory-stat-row:last-child {border-bottom:0;}
@media(max-width:780px){.inventory-category{font-size:10px;}.inventory-summary-columns{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:530px){.inventory-summary-columns{grid-template-columns:1fr;}.inventory-category{font-size:9px;padding:6px 1px;}}

/* N1.7.2 · preparación real para imágenes PNG del Director, sin modificar ranuras ni sprite aprobado. */
#hud-root .inventory-slot-art{display:grid;place-items:center;width:100%;height:100%;min-width:0;overflow:hidden}
#hud-root .inventory-cell-art{display:grid;place-items:center;width:100%;height:100%;overflow:hidden}
#hud-root .inventory-large-icon{width:100%;height:124px;min-height:124px;overflow:hidden}
#hud-root .inventory-cell-art img,#hud-root .inventory-slot-art img,#hud-root .inventory-large-icon img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
#hud-root .inventory-cell-art .functional-item-art-placeholder,#hud-root .inventory-slot-art .functional-item-art-placeholder{font:700 clamp(15px,1.5vw,24px) Georgia,serif;color:#727D8B}
#hud-root .inventory-large-icon .functional-item-art-placeholder{font:700 60px Georgia,serif;color:#727D8B}
#hud-root .inventory-object-stats{display:grid;gap:3px;max-width:100%;margin:6px 0}
#hud-root .inventory-stat-bonus{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin:0;padding:5px 0;border-bottom:1px solid var(--hud-gold-muted);font:600 12px/1.3 system-ui,sans-serif;min-width:0}
#hud-root .inventory-stat-bonus>span{min-width:0;overflow-wrap:anywhere}
#hud-root .inventory-stat-bonus>strong{font-variant-numeric:tabular-nums;white-space:nowrap}
#hud-root .inventory-stat-row .stat-tone-vitality{color:#F47BAA!important}
#hud-root .inventory-stat-row .stat-tone-fire{color:#FF625D!important}
#hud-root .inventory-stat-row .stat-tone-water{color:#4DA8FF!important}
#hud-root .inventory-stat-row .stat-tone-earth{color:#C99A58!important}
#hud-root .inventory-stat-row .stat-tone-air{color:#7DE88C!important}
#hud-root .inventory-stat-row .stat-tone-energy{color:#E8C15D!important}
#hud-root .inventory-stat-row .stat-tone-movement{color:#258752!important}
#hud-root .inventory-stat-row .stat-tone-critical{color:#FF963E!important}
#hud-root .inventory-stat-row .stat-tone-wisdom{color:#B78AF5!important}
#hud-root .inventory-stat-row .stat-tone-fortune{color:#74D9F4!important}
#hud-root .inventory-stat-bonus .stat-tone-vitality{color:#F47BAA!important}
#hud-root .inventory-stat-bonus .stat-tone-fire{color:#FF625D!important}
#hud-root .inventory-stat-bonus .stat-tone-water{color:#4DA8FF!important}
#hud-root .inventory-stat-bonus .stat-tone-earth{color:#C99A58!important}
#hud-root .inventory-stat-bonus .stat-tone-air{color:#7DE88C!important}
#hud-root .inventory-stat-bonus .stat-tone-critical{color:#FF963E!important}

/* N1.7.3 D2 · textos con peso visual reforzado y arte oficial sin deformación. */
#hud-root .inventory-object-name{font-weight:900;font-size:19px;line-height:1.25;max-width:100%}
#hud-root .inventory-stat-bonus{font-weight:800;font-size:13px;line-height:1.35}
#hud-root .inventory-stat-bonus>strong{font-weight:900}
#hud-root .inventory-stat-label,#hud-root .inventory-stat-value{font-weight:900}
#hud-root .inventory-cell-art img,#hud-root .inventory-slot-art img,#hud-root .inventory-large-icon img{object-fit:contain;object-position:center;min-width:0;min-height:0}
#hud-root .inventory-large-icon img{padding:6px;box-sizing:border-box}

/* N1.7.4 · la ficha del Inventario amplia el arte existente sin alterar su código ni la propiedad SERVER. */
#hud-root .inventory-large-icon{height:200px;min-height:200px;border-color:#48515D;background:#0E1116;border-radius:10px}
#hud-root .inventory-large-icon img{padding:8px;object-fit:contain}

/* N1.7.4.1 — sólo proyección visual de bonificaciones equipadas. */
#hud-root .inventory-equipment-totals{overflow-y:auto;min-width:0;max-height:540px}
#hud-root .inventory-equipment-total-title{font:800 15px/1.35 Georgia,serif;color:#D4DAE2;margin:0 0 12px}
#hud-root .inventory-equipment-total-row{display:flex;align-items:baseline;justify-content:space-between;gap:8px;border-bottom:1px solid #48515D;padding:7px 0;min-height:29px}
#hud-root .inventory-equipment-total-label{font:700 13px/1.4 system-ui,sans-serif;min-width:0;overflow-wrap:anywhere}
#hud-root .inventory-equipment-total-value{font:800 14px/1.3 system-ui,sans-serif;white-space:nowrap;color:#D4DAE2}
#hud-root .inventory-equipment-total-empty{color:#AAB4C0;font:12px/1.4 system-ui,sans-serif;margin:8px 0}

/* N1.7.4.10.1 · consumable details share the detailed-equipment visual language. */
#hud-root .inventory-potion-card{display:grid;grid-template-columns:minmax(98px,43%) minmax(0,1fr);gap:12px;align-items:start;min-width:0}
#hud-root .inventory-potion-art{display:grid;place-items:center;border:1px solid #48515d;border-radius:10px;background:#0e1116;aspect-ratio:1;overflow:hidden;min-width:0}
#hud-root .inventory-potion-art img{width:100%;height:100%;object-fit:contain;padding:5px;box-sizing:border-box}
#hud-root .inventory-potion-facts{min-width:0;display:grid;gap:8px;align-content:start}
#hud-root .inventory-potion-name{font:800 clamp(16px,1.3vw,21px)/1.12 Georgia,serif;color:#eef1f5;margin:0;overflow-wrap:anywhere}
#hud-root .inventory-potion-type{margin:0;font:700 12px/1.4 system-ui,sans-serif;color:#aeb8c6}
#hud-root .inventory-potion-effect{margin:3px 0 0;font:800 13px/1.4 system-ui,sans-serif;color:#d8dee7}
#hud-root .inventory-potion-condition{margin:0;font:600 11px/1.45 system-ui,sans-serif;color:#aeb8c6}
#hud-root .inventory-potion-description{font:600 12px/1.5 system-ui,sans-serif;color:#d2d9e1;margin:10px 0}
@media(max-width:1100px){#hud-root .inventory-potion-card{grid-template-columns:minmax(80px,40%) minmax(0,1fr);gap:8px}}

/* LAB04 FASE 1: layout funcional de Mochila + Estadísticas. MISMOS marcos y colores existentes.
   El HUD, los mapas, las demás ventanas y las APIs no se modifican. */
#hud-root .caelytte-workspace {
  position:absolute;inset:0;z-index:141;box-sizing:border-box;
  display:flex;align-items:flex-start;justify-content:center;gap:12px;
  padding:clamp(66px,12vh,118px) 12px 0;
  pointer-events:none;background:transparent;
}
#hud-root .caelytte-workspace .caelytte-workspace-panel {
  box-sizing:border-box;position:relative;min-width:0;
  height:min(74dvh,740px);max-height:calc(100dvh - 95px);
  margin:0;flex:0 1 auto;pointer-events:auto;
  border-radius:10px;
}
#hud-root .caelytte-workspace .inventory-dialog {
  width:min(800px,62vw);max-width:calc(100vw - 24px);
}
#hud-root .caelytte-workspace .hud-dialog-header {padding:7px 11px 8px;min-height:35px;}
#hud-root .caelytte-workspace .inventory-dialog .hud-dialog-header h2 {
  font-size:clamp(16px,1.3vw,20px);
}
#hud-root .caelytte-workspace .inventory-dialog .hud-dialog-content {
  box-sizing:border-box;padding:7px;min-height:0;overflow:auto;
}
#hud-root .caelytte-workspace .inventory-frame {gap:7px;}
#hud-root .caelytte-workspace .inventory-columns {
  display:grid;grid-template-columns:minmax(206px,41%) minmax(0,1fr);
  gap:7px;align-items:start;height:auto;max-height:none;
}
#hud-root .caelytte-workspace .inventory-column {
  min-width:0;min-height:0;box-sizing:border-box;height:auto;max-height:none;padding:7px;
}
#hud-root .caelytte-workspace .equipment-column {grid-column:1;grid-row:1;}
#hud-root .caelytte-workspace .bag-column {grid-column:2;grid-row:1;}
#hud-root .caelytte-workspace .item-detail-column {
  grid-column:1/-1;grid-row:2;max-height:206px;min-height:130px;
  display:flex;flex-direction:column;overflow:hidden;
}
#hud-root .caelytte-workspace .item-detail-column .inventory-detail-scroll {
  min-height:0;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;
}
#hud-root .caelytte-workspace .item-detail-column .inventory-detail-actions {
  flex:0 0 auto;display:flex;flex-wrap:wrap;gap:4px;max-height:76px;overflow:auto;
}
#hud-root .caelytte-workspace .item-detail-column .inventory-action {
  margin:0;min-height:28px;padding:4px 8px;font-size:11px;
}
#hud-root .caelytte-workspace .item-detail-column .n3744-detail-hero {
  grid-template-columns:95px minmax(0,1fr);gap:8px;
}
#hud-root .caelytte-workspace .item-detail-column .n3744-detail-hero .inventory-large-icon {
  width:95px;max-width:95px;min-height:95px!important;height:95px!important;
}
#hud-root .caelytte-workspace .item-detail-column .inventory-object-name {font-size:15px;}
#hud-root .caelytte-workspace .inventory-doll-formation {
  min-height:180px;gap:4px;grid-template-columns:36px minmax(0,1fr) 36px;
}
#hud-root .caelytte-workspace .inventory-doll {min-height:188px;}
#hud-root .caelytte-workspace .inventory-doll-image {
  max-height:190px;min-height:112px;
}
#hud-root .caelytte-workspace .inventory-equipment-stack {gap:3px;padding:2px 0;}
#hud-root .caelytte-workspace .inventory-equip-slot {font-size:15px;}
#hud-root .caelytte-workspace .inventory-bottom-slots {padding:5px;gap:5px;min-height:58px;}
#hud-root .caelytte-workspace .inventory-wings-group {padding-right:5px;}
#hud-root .caelytte-workspace .inventory-wings-group .wings-square {width:31px;height:31px;}
#hud-root .caelytte-workspace .inventory-mini-heading {font-size:8px;white-space:normal;}
#hud-root .caelytte-workspace .bag-column .inventory-categories {
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;
}
#hud-root .caelytte-workspace .bag-column .inventory-category {
  font-size:10px;padding:5px 1px;overflow:hidden;text-overflow:ellipsis;
}
#hud-root .caelytte-workspace .bag-column .inventory-bag-controls {grid-template-columns:100px minmax(0,1fr);}
#hud-root .caelytte-workspace .bag-column .inventory-grid {
  grid-template-columns:repeat(6,minmax(0,1fr));max-height:270px;min-height:145px;
  overflow:auto;grid-auto-rows:min-content;
}
#hud-root .caelytte-workspace .bag-column .inventory-item-quantity {
  font-size:10px;padding:1px 3px;
}
#hud-root .caelytte-workspace .inventory-count {margin:4px 0;}
#hud-root .caelytte-workspace .inventory-optional-summary {
  min-width:0;border:1px solid var(--hud-gold-muted);border-radius:5px;
  padding:5px 7px;color:var(--hud-gold);background:var(--hud-black-soft);
}
#hud-root .caelytte-workspace .inventory-optional-summary>summary {
  cursor:pointer;font:700 11px Georgia,serif;
}
#hud-root .caelytte-workspace .inventory-optional-summary .inventory-summary {margin-top:5px;}
#hud-root .caelytte-workspace .inventory-summary-columns {grid-template-columns:repeat(2,minmax(0,1fr));}
@media(max-width:1180px){
 #hud-root .caelytte-workspace .inventory-columns {grid-template-columns:minmax(192px,42%) minmax(0,1fr);}
 #hud-root .caelytte-workspace .inventory-doll-formation {grid-template-columns:31px minmax(0,1fr) 31px;}
 #hud-root .caelytte-workspace .inventory-bottom-slots {flex-wrap:wrap;}
 #hud-root .caelytte-workspace .inventory-reserved {flex-basis:100%;}
 #hud-root .caelytte-workspace .bag-column .inventory-grid {grid-template-columns:repeat(5,minmax(0,1fr));}
}
@media(max-width:850px){
 #hud-root .caelytte-workspace {padding:8px;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;overflow-y:auto;}
 #hud-root .caelytte-workspace .caelytte-workspace-panel {flex:0 0 auto;width:100%;max-width:none;height:min(74dvh,660px);}
 #hud-root .caelytte-workspace.has-both .caelytte-workspace-panel {height:43dvh;min-height:235px;}
 #hud-root .caelytte-workspace .inventory-columns {grid-template-columns:minmax(160px,42%) minmax(0,1fr);}
 #hud-root .caelytte-workspace .inventory-columns .inventory-column {height:auto;max-height:none;}
 #hud-root .caelytte-workspace .bag-column .inventory-grid {grid-template-columns:repeat(5,minmax(0,1fr));}
}
@media(max-width:480px){
 #hud-root .caelytte-workspace .inventory-columns {grid-template-columns:1fr;}
 #hud-root .caelytte-workspace .equipment-column {grid-column:1;grid-row:1;}
 #hud-root .caelytte-workspace .bag-column {grid-column:1;grid-row:2;}
 #hud-root .caelytte-workspace .item-detail-column {grid-column:1;grid-row:3;}
}
/* Orden fijo incluso cuando el jugador abre primero Estadísticas. */
#hud-root .caelytte-workspace .inventory-dialog {order:1}
#hud-root .caelytte-workspace .statistics-dialog {order:2}

/* P22 · Pointer/touch drag and precise adjacent ground targeting. */
#hud-root .p22-drag-source{touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
#hud-root .inventory-equip-slot.p22-drop-hover,#hud-root .p22-drop-tile:hover{outline:3px solid #8ddeb4}
.p22-drag-ghost{position:fixed;left:0;top:0;z-index:999999;pointer-events:none;transform:translate(-50%,-110%);padding:9px 14px;border-radius:10px;border:2px solid #c6d7e2;background:#13232c;color:#fff;box-shadow:0 7px 24px #000b;font:800 13px system-ui,sans-serif;max-width:210px;text-align:center}
.p22-inventory-ground{margin-top:12px;padding:10px;border:1px solid #48515d;border-radius:10px;background:#101b25;color:#dceaf1}
.p22-inventory-ground strong{font:800 12px Georgia,serif}.p22-inventory-ground p{font:600 11px/1.4 system-ui,sans-serif;color:#b8c5d0;margin:5px 0}
.p22-ground-tiles{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}.p22-drop-tile{min-width:45px;min-height:48px;border-radius:9px;border:1px solid #8799ac;background:#213343;color:#ebf7ff;font-size:26px;cursor:pointer;touch-action:manipulation}
.p22-quantity-dialog{position:fixed;inset:0;margin:auto;border:2px solid #8a9aa8;border-radius:13px;background:#131c25;color:#f1f3f6;padding:18px;box-shadow:0 15px 65px #000c;max-width:min(420px,90vw);font:600 14px system-ui,sans-serif}
.p22-quantity-dialog::backdrop{background:#0009}.p22-quantity-dialog h3{margin:0 0 10px}.p22-quantity-dialog input{display:block;width:100%;box-sizing:border-box;margin:12px 0;padding:11px;font-size:19px;background:#f8fbfc;color:#171c25;border-radius:6px}
.p22-quantity-actions{display:flex;justify-content:space-between;gap:10px}.p22-quantity-actions button{min-height:44px;padding:10px;border-radius:7px}
