.desktop-loadout-actions { display:flex; align-items:center; gap:24px; margin-bottom:16px; }
.desktop-loadout-actions span { color:var(--muted); }
.loadout-attributes-dialog { width:min(760px,calc(100% - 32px)); max-height:calc(100dvh - 32px); box-sizing:border-box; overflow:auto; margin:auto; padding:24px; background:var(--blue-950); color:var(--ink); border:1px solid var(--muted); border-radius:12px; }
.loadout-attributes-dialog::backdrop { background:#07101de6; }
.loadout-hover { position:fixed; inset:auto; margin:0; padding:0; border:1px solid var(--gold-300); border-radius:12px; background:var(--blue-950); color:var(--ink); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; }
.loadout-hover:popover-open { display:flex; }
.loadout-hover article { padding:20px; width:280px; flex:1; min-width:0; }
.loadout-hover article + article { border-left:1px solid var(--muted); }
.loadout-hover h3 { margin:0 0 8px; color:var(--gold-300); }
.loadout-hover p { margin:8px 0; }
.loadout-hover .familiar-progress { display:block; }
.desktop-ring-slot { display:none; }
.mobile-attributes-button { min-height:44px; padding:6px 3px; border:1px solid #8b794f; border-radius:6px; background:#243344; color:#f4d27b; font:600 max(var(--desktop-text-min, 0px), calc(12px * var(--desktop-text-scale, 1)))/1.3 'Barlow',sans-serif; text-transform:none; white-space:nowrap; }
#profilesDrawer.preparation-war-room #equipmentPaperDoll .mobile-attributes-button { position:relative; flex:none; width:66px; margin-top:-8px; }
.mobile-attributes-dialog { box-sizing:border-box; inset:0; margin:auto; width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:16px; }
.mobile-attributes-dialog::backdrop { background:#07101ddd; }
.loadout-hover.mobile-attributes-dialog .attribute-hover-sheet { box-sizing:border-box; width:100%; padding:16px 0 0; }
.loadout-hover.mobile-attributes-dialog .attribute-hover-sheet .equipment-stat-sheet { grid-template-columns:repeat(2,minmax(0,1fr)); }
.mobile-attributes-close { position:sticky; top:0; z-index:1; width:100%; min-height:44px; padding:10px; border:1px solid #8b794f; border-radius:6px; background:#243344; color:#f4d27b; font:600 max(var(--desktop-text-min, 0px), calc(15px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; text-transform:none; }
.mobile-attributes-button:focus-visible,.mobile-attributes-close:focus-visible { outline:3px solid #f4d27b; outline-offset:2px; }
@media(min-width:601px) and (min-height:551px) {
  .mobile-attributes-button { display:none; }
  #profilesDrawer.desktop-loadout [data-inventory-tab="player"] { display:none; }
  #profilesDrawer.desktop-loadout .preparation-loadout:not([hidden]) { display:flex; flex-direction:column; gap:0; }
  #profilesDrawer.desktop-loadout .preparation-loadout .defender-inventory-preview { display:block; min-height:380px; height:clamp(380px,48vh,520px); flex:none; padding:0; margin:0; }
  #profilesDrawer.desktop-loadout .preparation-loadout .inventory-character-copy { display:none; }
  #profilesDrawer.desktop-loadout .equipment-hero-frame { width:100%; height:100%; min-height:380px; }
  #profilesDrawer.desktop-loadout #equipmentHeroCanvas { inset:0 20%; width:60%; height:100%; object-fit:contain; }
  #profilesDrawer.desktop-loadout .equipment-familiar-plaque { display:none; }
  #profilesDrawer.desktop-loadout #preparationPetCanvas { display:block; position:absolute; inset:auto auto 12% 58%; width:120px; height:100px; pointer-events:auto; z-index:3; cursor:help; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll { position:absolute; inset:0; display:contents; pointer-events:auto; }
  #profilesDrawer.desktop-loadout .preparation-equipment-rail { display:contents; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-item,
  #profilesDrawer.desktop-loadout #equipmentWeaponButton,
  #profilesDrawer.desktop-loadout .desktop-ring-slot { position:absolute; display:grid; place-items:center; width:64px; height:64px; min-height:64px; padding:4px; margin:0; border:1px solid var(--rarity,var(--muted)); border-radius:6px; background:var(--blue-950); color:var(--gold-300); z-index:5; cursor:pointer; }
  #profilesDrawer.desktop-loadout .paper-doll-helm { inset:12% auto auto 12%; }
  #profilesDrawer.desktop-loadout .paper-doll-armor { inset:calc(50% - 32px) auto auto 12%; }
  #profilesDrawer.desktop-loadout .paper-doll-pants { inset:auto auto 12% 12%; }
  #profilesDrawer.desktop-loadout .paper-doll-charm { inset:12% 12% auto auto; }
  #profilesDrawer.desktop-loadout .desktop-ring-slot { inset:calc(50% - 32px) 12% auto auto; }
  #profilesDrawer.desktop-loadout #equipmentWeaponButton { inset:auto 12% 12% auto; }
  #profilesDrawer.desktop-loadout #equipmentWeaponButton::after,
  #profilesDrawer.desktop-loadout #equipmentWeaponButton > :not(.preparation-weapon-icon),
  #profilesDrawer.desktop-loadout #equipmentPaperDoll b { display:none; }
  #profilesDrawer.desktop-loadout #equipmentWeaponButton .preparation-weapon-icon { display:grid; width:52px; height:52px; }
  #profilesDrawer.desktop-loadout #equipmentWeaponButton .gear-art { width:52px; height:52px; }
  #profilesDrawer.desktop-loadout .desktop-ring-slot svg { width:44px; height:44px; }
  #profilesDrawer.desktop-loadout #battlePreparation { position:static; display:block; width:100%; overflow:visible; margin:20px 0 0; padding:0; }
  #profilesDrawer.desktop-loadout .spell-socket-bar { display:flex; justify-content:center; flex-wrap:wrap; gap:12px; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket { width:72px; min-height:72px; padding:0; margin:0; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket-well { width:72px; height:72px; min-height:72px; padding:4px; }
  #profilesDrawer.desktop-loadout .spell-socket strong { display:none; }
  #profilesDrawer.desktop-loadout .prepare-skill-upgrade { margin:16px auto 0; }
  #profilesDrawer.desktop-loadout .wr-inspect-skills { order:5; align-self:center; margin-top:16px; }
  #profilesDrawer.desktop-loadout .equipment-picker-items { grid-template-columns:repeat(4,64px); gap:12px; }
  #profilesDrawer.desktop-loadout .equipment-picker-item { width:64px; height:64px; min-height:64px; padding:4px; display:grid; place-items:center; }
  #profilesDrawer.desktop-loadout .equipment-picker-item > span + span,
  #profilesDrawer.desktop-loadout #equipmentPickerDetail { display:none; }
  #profilesDrawer.desktop-loadout button:focus-visible, #preparationPetCanvas:focus-visible { outline:3px solid var(--gold-300); outline-offset:3px; }
}
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-helm { inset:12% auto auto 12%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-armor { inset:calc(50% - 32px) auto auto 12%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-pants { inset:auto auto 12% 12%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-charm { inset:12% 12% auto auto; }
  #profilesDrawer.desktop-loadout #equipmentWeaponButton #equipmentWeaponRarity { display:none; }
  #profilesDrawer.desktop-loadout .preparation-loadout .equipment-hero-frame { height:100%; min-height:320px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .defender-inventory-preview { height:320px; min-height:320px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:8px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button { flex:1; min-width:80px; min-height:56px; padding:4px 8px; font-size:max(var(--desktop-text-min, 0px), .875rem); }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs .inventory-tab-icon { width:24px; height:24px; flex-basis:24px; }
  #profilesDrawer.desktop-loadout .prepare-equipped { display:flex; flex-direction:column; align-items:center; }
}
.loadout-hover:has(.familiar-stage) article { width:380px; }
.loadout-hover details { margin-top:16px; }
.loadout-hover:has(.familiar-evolution-track) article { width:400px; }
.loadout-hover .familiar-evolution-track { display:flex; flex-direction:column; gap:12px; padding:0; list-style:none; }
.loadout-hover .familiar-evolution-track li { display:block; padding:8px 0; opacity:1; }
.loadout-hover .familiar-evolution-track canvas { float:left; width:72px; height:60px; margin-right:12px; }
.loadout-hover .familiar-evolution-track h4 { margin:4px 0; }
.loadout-hover .familiar-set-forms canvas { width:72px; height:60px; }
.loadout-hover .familiar-set-forms figure { margin:12px 0; }
/* Compact desktop workspace: captain and sockets beside the permanent inventory. */
#profilesDrawer:not(.preparation-war-room) .prepare-skill-upgrade { display:none; }
#profilesDrawer:not(.preparation-war-room) .spell-socket.is-vacant .spell-socket-well::after { content:none; }
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout .desktop-loadout-columns { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(260px,1fr); gap:24px; align-items:start; }
  .desktop-captain-column,.desktop-inventory-column { min-width:0; }
  #profilesDrawer.desktop-loadout .preparation-loadout .defender-inventory-preview { height:380px; min-height:380px; }
  #profilesDrawer.desktop-loadout .desktop-captain-column .equipment-hero-frame { height:380px; min-height:380px; }
  #profilesDrawer.desktop-loadout #equipmentHeroCanvas { inset:0 10%; width:80%; height:100%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-helm { inset:8% auto auto 4%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-armor { inset:calc(50% - 28px) auto auto 4%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-pants { inset:auto auto 8% 4%; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-charm { inset:8% 4% auto auto; }
  #profilesDrawer.desktop-loadout .desktop-ring-slot { inset:calc(50% - 28px) 4% auto auto; }
  #profilesDrawer.desktop-loadout #equipmentWeaponButton { inset:auto 4% 8% auto; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-item,
  #profilesDrawer.desktop-loadout #equipmentWeaponButton,
  #profilesDrawer.desktop-loadout .desktop-ring-slot { width:56px; height:56px; min-height:56px; }
  #profilesDrawer.desktop-loadout .desktop-ring-slot img { width:48px; height:48px; object-fit:contain; }
  #profilesDrawer.desktop-loadout #preparationPetCanvas { width:88px; height:74px; inset:auto auto 7% 57%; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column > header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column h3 { margin:0; color:#f4d27b; font:700 max(var(--desktop-text-min, 0px), calc(24px * var(--desktop-text-scale, 1)))/1.2 'Barlow Condensed',sans-serif; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column #inventoryCount { color:#b9cbd9; font:500 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; }
  #profilesDrawer.desktop-loadout .desktop-loadout-actions { margin:12px 0; font:500 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.5 'Barlow',sans-serif; }
  #profilesDrawer.desktop-loadout .desktop-loadout-actions span { color:#bed0df; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0 16px; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button { min-height:36px; padding:6px 10px; font:500 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.3 'Barlow',sans-serif; }
  #profilesDrawer.desktop-loadout #equipmentInventory { display:grid; grid-template-columns:repeat(auto-fill, minmax(56px,1fr)); gap:8px; max-height:340px; overflow-y:auto; align-content:start; padding:4px; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item { display:grid; place-items:center; aspect-ratio:1; width:100%; min-width:0; min-height:56px; padding:4px; border:2px solid var(--rarity); border-radius:4px; background:color-mix(in srgb,var(--rarity) 18%,#0b1625); box-shadow:inset 0 0 0 2px #09111a; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item:hover { background:color-mix(in srgb,var(--rarity) 35%,#0b1625); }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item[aria-pressed=true] { outline:2px solid #f8e7ae; outline-offset:1px; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item-copy,
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item-action { display:none; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item-icon { display:grid; place-items:center; width:100%; height:100%; }
  #profilesDrawer.desktop-loadout #equipmentInventory .gear-art { width:48px; height:48px; }
  #profilesDrawer.desktop-loadout #equipmentInventory .inventory-empty { grid-column:1 / -1; color:#bed0df; }
  #profilesDrawer.desktop-loadout:not(.preparation-war-room) .desktop-inventory-column .gear-gun-upgrade { display:none; }
  #profilesDrawer.desktop-loadout #battlePreparation { margin:12px 0 0; }
  #profilesDrawer.desktop-loadout .spell-socket-bar { gap:8px; padding:4px; margin:0; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket { width:52px; min-height:52px; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket-well { box-sizing:border-box; width:52px; height:52px; min-height:52px; padding:4px; border:2px solid #85704c; border-radius:3px; background:linear-gradient(145deg,#23303b,#090f19); box-shadow:inset 0 0 0 2px #080e17,inset 0 4px 7px #0008; outline:1px solid #252d35; outline-offset:2px; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket.is-vacant .spell-socket-well { border:2px solid #665b46; background:linear-gradient(145deg,#172433,#080e17); }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket-well::after,
  #profilesDrawer.desktop-loadout .spell-socket .socket-etch,
  #profilesDrawer.desktop-loadout .spell-socket.is-locked .socket-rank { display:none; }
  #profilesDrawer.desktop-loadout .spell-socket-well > :is(.spell-art,.command-art,svg,img) { width:40px; height:40px; flex-basis:40px; }
  #profilesDrawer.desktop-loadout .spell-socket.is-locked { opacity:.45; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes { margin-top:24px; padding-top:20px; border-top:1px solid #465b6b; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .player-attribute-heading { margin:0 0 12px; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes #playerAttributesTitle { margin:0; color:#f4d27b; font:700 max(var(--desktop-text-min, 0px), calc(24px * var(--desktop-text-scale, 1)))/1.2 'Barlow Condensed',sans-serif; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes #playerAttributeContext { color:#bed0df; font:400 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.5 'Barlow',sans-serif; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .player-attribute-heading > strong { display:none; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:1px; padding:1px; margin:0; background:#344959; border-radius:6px; overflow:hidden; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet > div { background:#142536; padding:12px; min-width:0; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet dt { color:#c5d5e2; font:600 max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; text-transform:none; letter-spacing:0; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet dd { margin:4px 0; color:#fff0c4; font:700 max(var(--desktop-text-min, 0px), calc(22px * var(--desktop-text-scale, 1)))/1.2 'Barlow Condensed',sans-serif; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet small,
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes #playerCombatTraits { color:#bed0df; font:400 max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1)))/1.5 'Barlow',sans-serif; }
}
.loadout-hover { color:#e7eef5; background:#0c1929; font:400 max(var(--desktop-text-min, 0px), calc(15px * var(--desktop-text-scale, 1)))/1.5 'Barlow',sans-serif; text-shadow:none; }
.loadout-hover :is(p,span,small,figcaption,summary) { color:#c8d8e6; font-size:max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1))); line-height:1.5; }
.loadout-hover :is(h3,h4,strong) { color:#f6d78d; text-shadow:none; }
.loadout-hover h3 { font:700 max(var(--desktop-text-min, 0px), calc(24px * var(--desktop-text-scale, 1)))/1.2 'Barlow Condensed',sans-serif; }
.loadout-hover h4 { font:700 max(var(--desktop-text-min, 0px), calc(19px * var(--desktop-text-scale, 1)))/1.3 'Barlow Condensed',sans-serif; }
.loadout-hover .familiar-evolution-track :is(li,li.locked) { opacity:1; background:#142536; border:0; border-radius:4px; padding:12px; }
.loadout-hover .familiar-evolution-track li > span { color:#cad8e4; }
.loadout-hover .familiar-form-label { color:#f6d78d; background:#203248; border:1px solid #596a79; }
.loadout-hover .familiar-set-forms { color:#cad8e4; background:transparent; }
.loadout-hover .familiar-set-forms figcaption :is(strong,span,small) { display:block; }
@media(min-width:601px) and (max-width:1150px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout .desktop-loadout-columns { grid-template-columns:minmax(0,1.1fr) minmax(220px,1fr); gap:16px; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
/* Tablets keep the desktop paper doll and bottom sockets in one column. */
@media(min-width:601px) and (max-width:960px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout .desktop-loadout-columns { grid-template-columns:minmax(0,1fr); }
  #profilesDrawer.desktop-loadout .desktop-inventory-column { display:none; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #levelCamp .camp-panel { box-sizing:border-box; width:100%; min-width:0; max-width:100%; }
  #levelCamp .camp-actions > div { display:flex; flex-wrap:wrap; min-width:0; max-width:100%; }
  #levelCamp .camp-actions .primary-action { min-width:0; flex:1; white-space:normal; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs { flex-wrap:wrap; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button { flex:1 1 100px; }
}
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .defender-inventory-preview { height:380px; min-height:380px; }
}
/* Preparation's skill action belongs to the socket heading, not below the build. */
.prepare-spells-heading,.prepare-upgrade-label { display:none; }
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout .prepare-equipped { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; width:100%; }
  #profilesDrawer.desktop-loadout .prepare-spells-heading { display:block; grid-column:1; grid-row:1; margin:0; color:#c8d8e6; font:600 max(var(--desktop-text-min, 0px), calc(16px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; text-transform:none; }
  #profilesDrawer.desktop-loadout .prepare-equipped .spell-socket-bar { grid-column:1 / -1; grid-row:2; width:100%; box-sizing:border-box; }
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .prepare-skill-upgrade { grid-column:2; grid-row:1; width:auto; height:auto; min-height:40px; margin:0; padding:8px 12px; gap:8px; font:600 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.3 'Barlow',sans-serif; }
  #profilesDrawer.desktop-loadout .prepare-upgrade-label { display:inline; }
  #profilesDrawer.desktop-loadout .prepare-skill-upgrade > svg { display:none; }
  #profilesDrawer.desktop-loadout .prepare-skill-upgrade .prepare-point-count { position:static; min-width:20px; height:20px; line-height:18px; font-size:max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1))); }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button { background:#203448; color:#e0eaf2; border:1px solid #5c7285; text-shadow:none; box-shadow:none; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button:hover { background:#304b62; color:#fff; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button[aria-pressed=true] { background:#f4d27b; color:#14202d; border-color:#f4d27b; }
}
#loadoutHover .familiar-set-forms figcaption :is(span,small) { color:#c8d8e6; font:400 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.5 'Barlow',sans-serif; opacity:1; }
#loadoutHover .familiar-set-forms figcaption strong { color:#f6d78d; font:700 max(var(--desktop-text-min, 0px), calc(17px * var(--desktop-text-scale, 1)))/1.4 'Barlow Condensed',sans-serif; }
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .prepare-skill-upgrade { flex-direction:row; white-space:nowrap; }
}
/* Loadout polish: the captain leads, utility controls remain quiet. */
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout { --loadout-line:#405568; --loadout-text:#c8d8e6; --loadout-accent:#f4d27b; }
  #profilesDrawer.desktop-loadout .desktop-loadout-columns { gap:24px; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column > header { padding:0 0 12px; border-bottom:1px solid var(--loadout-line); }
  #profilesDrawer.desktop-loadout .desktop-loadout-actions { margin:12px 0 16px; }
  #profilesDrawer.desktop-loadout .desktop-loadout-actions span { font-size:max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1))); }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters { gap:4px; margin:0 0 16px; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button { min-height:36px; padding:6px 8px; color:var(--loadout-text); background:transparent; border:1px solid transparent; border-radius:4px; text-transform:none; font-size:max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1))); }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button:hover { background:#203448; color:#fff; }
  #profilesDrawer.desktop-loadout .desktop-inventory-column .equipment-filters button[aria-pressed=true] { color:var(--loadout-accent); background:#243344; border-color:#8b794f; }
  #profilesDrawer.desktop-loadout #equipmentInventory { grid-template-columns:repeat(auto-fill,56px); gap:10px; padding:3px; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item { position:relative; border-width:1px; box-shadow:none; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item[aria-pressed=true] { outline:none; }
  #profilesDrawer.desktop-loadout #equipmentInventory .equipment-item[aria-pressed=true]::after { content:''; position:absolute; right:4px; bottom:5px; width:8px; height:4px; border-left:2px solid #fff0c4; border-bottom:2px solid #fff0c4; transform:rotate(-45deg); }
  #profilesDrawer.desktop-loadout #equipmentInventory .gear-art { background:transparent; border:0; box-shadow:none; }
  #profilesDrawer.desktop-loadout #battlePreparation { margin-top:16px; }
  #profilesDrawer.desktop-loadout .prepare-equipped { gap:12px 8px; }
  #profilesDrawer.desktop-loadout .prepare-spells-heading { color:var(--loadout-text); font-size:max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1))); font-weight:500; }
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .prepare-skill-upgrade { display:flex; align-items:center; flex-direction:row; gap:8px; min-height:44px; padding:6px 10px; border:1px solid #8b794f; border-radius:4px; background:#243344; color:var(--loadout-accent); box-shadow:none; text-shadow:none; }
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .prepare-skill-upgrade:hover { background:#324459; border-color:var(--loadout-accent); }
  #profilesDrawer.desktop-loadout .prepare-skill-upgrade .prepare-point-count { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 4px; box-sizing:border-box; font:600 max(var(--desktop-text-min, 0px), calc(12px * var(--desktop-text-scale, 1)))/1 'Barlow',sans-serif; color:#14202d; background:var(--loadout-accent); border:0; border-radius:3px; }
  #profilesDrawer.desktop-loadout .prepare-equipped .spell-socket-bar { justify-content:flex-start; padding:3px; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket-well { outline:none; box-shadow:inset 0 0 0 1px #080e17; border-width:1px; }
  #profilesDrawer.desktop-loadout .spell-socket-bar .spell-socket.is-vacant .spell-socket-well { border-width:1px; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes { margin-top:20px; padding-top:16px; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet { gap:12px 20px; padding:0; background:transparent; border:0; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet > div { padding:10px 0; background:transparent; border-bottom:1px solid var(--loadout-line); }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet dt { font-weight:500; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes .equipment-stat-sheet small { font-size:max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1))); }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs { gap:4px; padding-bottom:12px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button { display:flex; flex-direction:row; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:8px; font-size:max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1))); text-transform:none; background:transparent; box-shadow:none; border-color:transparent; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button[aria-selected=true] { background:#243344; border-color:#8b794f; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button::after { display:none; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs .inventory-tab-icon { width:20px; height:20px; flex-basis:20px; }
}
#profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button[hidden] { display:none; }
#profilesDrawer.desktop-loadout #equipmentInventory .equipment-item:focus-visible { outline:3px solid var(--gold-300); outline-offset:2px; }

/* Shared loot artwork: square cells retain their transparent silhouettes. */
.loot-sprite { display:inline-block; flex-shrink:0; width:48px; height:48px; background-repeat:no-repeat; background-position:var(--sprite-x) var(--sprite-y); }
.ring-sprite { background-image:url('assets/ring-items-atlas.png'); background-size:200% 200%; }
.set-sprite { background-image:url('assets/item-set-gallery-v2.png'); background-size:600% 600%; }
.set-showcase .set-collection-art { display:block; width:180px; height:180px; max-width:100%; margin:12px auto 40px; }
.legendary-weapon-icon .loot-sprite { width:72px; height:72px; }
.boss-gift-reward { grid-column:1 / -1; display:flex; align-items:center; gap:16px; border-top:1px solid #766443; padding-top:16px; margin-top:12px; }
.boss-gift-reward > span:last-child { min-width:0; }
.equipment-picker-icon .loot-sprite, .paper-doll-item .loot-sprite { width:100%; height:100%; max-width:48px; max-height:48px; }
.set-piece-icon .loot-sprite { display:block; width:100%; height:100%; }
.loadout-hover .attribute-hover-sheet { width:min(600px,calc(100vw - 64px)); }
.loadout-hover .attribute-hover-sheet .equipment-stat-sheet { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:16px 0; background:transparent; }
.loadout-hover .attribute-hover-sheet .equipment-stat-sheet > div { min-width:0; padding:0 0 12px; background:transparent; border:0; border-bottom:1px solid #405568; }
.loadout-hover .attribute-hover-sheet dt { color:#c8d8e6; font:500 max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; letter-spacing:0; text-transform:none; }
.loadout-hover .attribute-hover-sheet dd { margin:6px 0; color:#fff0c4; font:700 max(var(--desktop-text-min, 0px), calc(24px * var(--desktop-text-scale, 1)))/1.2 'Barlow Condensed',sans-serif; }
.loadout-hover .attribute-hover-sheet small { display:block; font:400 max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1)))/1.5 'Barlow',sans-serif; }
.loadout-hover .attribute-hover-sheet .player-attribute-heading > strong { display:none; }
.loadout-hover :is(article,p,span,small,figcaption) { overflow-wrap:break-word; white-space:normal; }
@media(min-width:601px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout .desktop-loadout-columns { row-gap:16px; }
  #profilesDrawer.desktop-loadout #battlePreparation { grid-column:1; grid-row:2; min-width:0; margin:0; }
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes { grid-column:2; grid-row:2; align-self:stretch; margin:0; padding:0; border:0; min-width:0; }
  .loadout-attribute-summary { display:flex; flex-direction:column; justify-content:space-between; gap:16px; width:100%; height:100%; min-height:108px; padding:10px 0; border:0; border-top:1px solid #405568; border-bottom:1px solid #405568; border-radius:0; background:transparent; color:#c8d8e6; text-align:left; text-transform:none; text-shadow:none; box-shadow:none; }
  .loadout-attribute-summary:hover { background:#1b2b3b; }
  .attribute-summary-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; font:500 max(var(--desktop-text-min, 0px), calc(14px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; }
  .attribute-summary-heading small { color:#f4d27b; font:500 max(var(--desktop-text-min, 0px), calc(12px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; }
  .attribute-summary-values { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  .attribute-summary-values > span { display:flex; flex-direction:column; gap:6px; min-width:0; }
  .attribute-summary-values span span { color:#c8d8e6; font:500 max(var(--desktop-text-min, 0px), calc(12px * var(--desktop-text-scale, 1)))/1.4 'Barlow',sans-serif; white-space:normal; }
  .attribute-summary-values strong { color:#fff0c4; font:700 max(var(--desktop-text-min, 0px), calc(23px * var(--desktop-text-scale, 1)))/1.2 'Barlow Condensed',sans-serif; white-space:nowrap; }
  #profilesDrawer.desktop-loadout #equipmentPaperDoll .paper-doll-ring { inset:calc(50% - 28px) 4% auto auto; }
  #profilesDrawer.desktop-loadout .spell-socket-bar { flex-wrap:wrap; }
  #levelCamp .camp-panel { position:relative; }
  #levelCamp .camp-actions { position:sticky; bottom:-1px; z-index:10; padding:12px 0; margin-bottom:0; background:#101e2b; border-top:1px solid #405568; }
  #levelCamp .camp-actions > p { display:none; }
  #levelCamp .camp-actions > div { display:flex; flex-wrap:wrap; gap:12px; }
  #levelCamp .camp-actions .primary-action { min-width:0; flex:1; white-space:normal; }
  #levelCamp .camp-panel:has(.preparation-war-room) { display:flex; flex-direction:column; overflow:hidden; }
  #levelCamp .camp-panel:has(.preparation-war-room) .camp-heading { flex-shrink:0; }
  #levelCamp .camp-panel:has(.preparation-war-room) #campWarRoom { min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; }
  #levelCamp .camp-panel:has(.preparation-war-room) .camp-actions { position:static; flex-shrink:0; }
  #levelCamp .camp-panel:has(.preparation-war-room) .camp-actions > div { width:100%; }
}
@media(min-width:601px) and (max-width:960px) and (min-height:551px) {
  #profilesDrawer.desktop-loadout .desktop-loadout-attributes { grid-column:1; grid-row:3; }
  .loadout-attribute-summary { min-height:100px; }
}
@media(min-width:961px) and (min-height:551px) and (max-height:850px) {
  #levelCamp .camp-panel:has(.preparation-war-room) { padding:16px 24px; max-height:calc(100dvh - 90px); }
  #levelCamp .camp-heading h2 { margin:0; font-size:max(var(--desktop-text-min, 0px), calc(28px * var(--desktop-text-scale, 1))); }
  #levelCamp .camp-heading p { margin:6px 0 12px; }
  #levelCamp .camp-panel:has(.preparation-war-room) .camp-heading { margin-bottom:8px; }
  #levelCamp .camp-panel:has(.preparation-war-room) .camp-actions { margin-top:4px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs { margin-bottom:8px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .preparation-loadout .defender-inventory-preview,
  #profilesDrawer.desktop-loadout.preparation-war-room .desktop-captain-column .equipment-hero-frame { height:240px; min-height:240px; }
  #profilesDrawer.desktop-loadout.preparation-war-room #equipmentInventory { max-height:140px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .desktop-loadout-columns { row-gap:12px; }
}

/* Mobile War Room shares the preparation avatar and equipment layout. */
#profilesDrawer.mobile-loadout:not(.preparation-war-room) { height:100dvh; }
#profilesDrawer.mobile-loadout:not(.preparation-war-room) .preparation-loadout > .wr-section-head,
#profilesDrawer.mobile-loadout:not(.preparation-war-room) .preparation-loadout > .wr-inspect-skills { display:none; }
#profilesDrawer.mobile-loadout:not(.preparation-war-room) .preparation-loadout .defender-inventory-preview { min-height:560px; flex:1 0 560px; }
#profilesDrawer.mobile-loadout .prepare-spells-heading,
#profilesDrawer.mobile-loadout .prepare-upgrade-label { display:none; }
#profilesDrawer.mobile-loadout #equipmentPaperDoll .mobile-attributes-button { position:relative; flex:none; width:56px; margin-top:-8px; }
#profilesDrawer.mobile-loadout [data-inventory-tab="player"] { display:none; }

/* Clear upgrades use the same small arrow on slots and their owned items. */
#profilesDrawer .equipment-item,
#profilesDrawer .equipment-picker-item,
#profilesDrawer .equipment-slot,
#profilesDrawer .inventory-section-toggle,
#profilesDrawer [data-inventory-tab="loadout"] { position:relative; }
#profilesDrawer .gear-upgrade-marker,
#profilesDrawer.desktop-loadout #equipmentWeaponButton > .gear-upgrade-marker,
#profilesDrawer.desktop-loadout .equipment-picker-item > .gear-upgrade-marker {
  position:absolute; top:2px; right:2px; z-index:7; display:grid; place-items:center;
  width:18px; height:18px; padding:0; border:1px solid #b1edac; border-radius:3px;
  background:#163d27; color:#c9ffc3; pointer-events:none;
}
#profilesDrawer .gear-upgrade-marker svg { width:14px; height:14px; }
#profilesDrawer #equipmentWeaponButton > .gear-upgrade-weapon,
#profilesDrawer.desktop-loadout #equipmentWeaponButton > .gear-upgrade-weapon {
  display:flex; align-items:center; justify-content:center; gap:3px;
  top:-12px; right:0; width:max-content; height:24px; padding:3px 6px;
  font:700 max(var(--desktop-text-min, 0px), calc(12px * var(--desktop-text-scale, 1)))/1.2 'Barlow',sans-serif; white-space:nowrap; text-transform:none;
}
#profilesDrawer #equipmentWeaponButton > .gear-upgrade-weapon svg { flex:none; }
#profilesDrawer .inventory-section-toggle .gear-upgrade-marker { top:calc(50% - 9px); right:40px; }

/* Captain identity doubles as the attributes control within the portrait. */
#profilesDrawer.mobile-loadout .mobile-attributes-button {
  position:absolute; z-index:6; inset:14px 68px auto; width:calc(100% - 136px);
  min-height:64px; margin:0; padding:4px 2px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:3px; border:0; border-radius:6px;
  background:transparent; color:var(--gold-300); text-align:center; white-space:normal;
}
#profilesDrawer.mobile-loadout .mobile-attributes-button strong { font:700 max(var(--desktop-text-min, 0px), calc(20px * var(--desktop-text-scale, 1)))/1.1 'Barlow Condensed',sans-serif; }
#profilesDrawer.mobile-loadout .mobile-captain-level { font:600 max(var(--desktop-text-min, 0px), calc(13px * var(--desktop-text-scale, 1)))/1.25 'Barlow',sans-serif; color:var(--ink); }
#profilesDrawer.mobile-loadout .mobile-attributes-button small { font:500 max(var(--desktop-text-min, 0px), calc(12px * var(--desktop-text-scale, 1)))/1.3 'Barlow',sans-serif; color:var(--ink); }
#profilesDrawer.mobile-loadout .mobile-attributes-button:active { background:#14243a; }

/* Navigation uses one quiet frame around each distinct section silhouette. */
#profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs .inventory-tab-icon { filter:none; }
#profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs .tab-icon-mark { stroke:currentColor; stroke-width:1.8; }
#profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs button:hover .inventory-tab-icon { transform:none; }
@media(max-width:960px), (max-height:550px) {
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs { gap:6px; padding:8px; box-sizing:border-box; }
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs > button:not([hidden]) { position:relative; min-height:48px; height:48px; border:1px solid #34495b; border-radius:8px; background:#172839; color:#cbd5d9; box-shadow:none; }
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs > button[aria-selected="true"] { border-color:#f2cd6c; background:#2b3b49; color:#f2cd6c; }
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs > button:hover { border-color:#a08c61; color:#fff0ce; }
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs > button::after { display:none; }
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs .inventory-tab-icon { width:28px; height:28px; flex:0 0 28px; }
}
@media(max-width:600px) {
  #profilesDrawer:is(.preparation-war-room,:not(.preparation-war-room)) #inventoryTabs { grid-template-columns:repeat(5,minmax(44px,1fr)); }
}

/* Mobile War Room keeps navigation in a single swipeable strip. */
@media(max-width:960px) {
  #profilesDrawer:not(.preparation-war-room) > .drawer-head {
    grid-template-columns:minmax(0,1fr) 44px; grid-template-rows:auto auto;
    gap:0 8px; padding:8px 12px;
  }
  #profilesDrawer:not(.preparation-war-room) .drawer-head > div:first-child { min-width:0; grid-column:1; grid-row:1; }
  #profilesDrawer:not(.preparation-war-room) .drawer-head h2 { font-size:max(var(--desktop-text-min, 0px), calc(22px * var(--desktop-text-scale, 1))); line-height:1.2; gap:8px; }
  #profilesDrawer:not(.preparation-war-room) .wr-build { font-size:max(var(--desktop-text-min, 0px), calc(10px * var(--desktop-text-scale, 1))); padding:2px 4px; }
  #profilesDrawer:not(.preparation-war-room) .wr-context { display:none; }
  #profilesDrawer:not(.preparation-war-room) #closeProfilesButton { grid-column:2; grid-row:1/3; align-self:center; width:44px; height:44px; min-height:44px; }
  #profilesDrawer:not(.preparation-war-room) #warRoomCrowns { grid-column:1; grid-row:2; margin:3px 0 0; gap:4px 12px; }
  #profilesDrawer:not(.preparation-war-room) :is(.war-room-balance,.wr-shards) {
    min-height:24px; padding:0; gap:5px; border:0; border-radius:0; background:transparent;
    font-size:max(var(--desktop-text-min, 0px), calc(16px * var(--desktop-text-scale, 1))); line-height:1.25;
  }
  #profilesDrawer:not(.preparation-war-room) :is(.war-room-balance,.wr-shards)::before { width:20px; height:20px; flex-basis:20px; }
  #profilesDrawer:not(.preparation-war-room) > .wr-utility { display:none; }
  #profilesDrawer:not(.preparation-war-room) #inventoryTabs {
    display:flex; flex-direction:row; flex-wrap:nowrap; flex:0 0 auto;
    width:100%; min-width:0; min-height:60px; height:auto; max-height:none;
    margin:0; padding:6px 10px; gap:6px; overflow-x:auto; overflow-y:hidden;
    overscroll-behavior-x:contain; scrollbar-width:thin; scrollbar-color:#647586 #142334;
    scroll-padding-inline:10px;
  }
  #profilesDrawer:not(.preparation-war-room) #inventoryTabs > button:not([hidden]) {
    flex:0 0 52px; width:52px; min-width:52px; height:44px; min-height:44px; padding:6px;
  }
  #profilesDrawer:not(.preparation-war-room) #inventoryTabs::-webkit-scrollbar { display:block; height:3px; }
  #profilesDrawer:not(.preparation-war-room) #inventoryTabs::-webkit-scrollbar-thumb { background:#647586; border-radius:3px; }
  #profilesDrawer [data-inventory-pane="account"] > #resetProgressButton { display:block; width:auto; min-height:44px; margin:24px 0 0; padding:10px 14px; }
  #profilesDrawer:not(.preparation-war-room) > .inventory-pane[data-inventory-pane] { flex:1 1 0; min-height:0; overflow-y:auto; }
}
