/* Last Keep's war room shares the authored navy, ivory, gold and painted art. */
.reset-progress-button { flex-shrink:0; margin-left:auto; min-height:44px; padding:8px 12px; border:1px solid #9d7172; border-radius:8px; background:#1b2e43; color:#ffd7d2; font-weight:700; cursor:pointer; }
.reset-progress-button:hover { background:#3d2932; }
.reset-progress-dialog { width:min(520px,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow:auto; margin:auto; padding:24px; border:0; border-radius:16px; background:var(--blue-950); color:var(--ink); box-shadow:0 24px 80px #0009; }
.reset-progress-dialog::backdrop { background:#040a12d9; }
.reset-progress-dialog h2 { margin:0 0 16px; font:800 32px/1.1 'Barlow Condensed',sans-serif; color:#ffedb6; }
.reset-progress-dialog p { line-height:1.6; color:#cbd7df; }
.reset-progress-dialog .reset-progress-warning, #resetProgressError { color:#ffd7d2; }
#resetProgressError:empty { display:none; }
.reset-progress-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }
.reset-progress-actions button { flex:1 1 180px; min-height:44px; padding:12px; border:1px solid #667d93; border-radius:8px; background:#1b2e43; color:var(--ink); font-weight:700; cursor:pointer; }
.reset-progress-actions button:hover { background:#29445f; }
#confirmResetProgress { background:#8c3034; border-color:#c57978; color:#fff4ed; }
#confirmResetProgress:hover { background:#a53a3f; }
#confirmResetProgress:disabled { opacity:.6; cursor:wait; }
.reset-progress-button:focus-visible, .reset-progress-actions button:focus-visible { outline:3px solid #ffedb6; outline-offset:3px; }
@media(max-width:480px) { .drawer-head { flex-wrap:wrap; } .reset-progress-button { margin-left:0; } .reset-progress-dialog { padding:20px; } }
.spell-loot-pane { background:#142334;color:#f7efda;padding:20px; }
.spell-loot-pane h3 { color:#f7e6bb;font-size:1.5rem;margin:0 0 16px; }
.spell-loot-pane > p { max-width:72ch; }
#spellLootCollection { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:24px; }
.spell-loot-entry { display:flex;flex-direction:column;align-items:stretch;gap:16px;padding:16px;background:#101b2a;border:1px solid #425467;border-radius:12px;min-width:0; }
.spell-loot-entry[data-rarity="Legendary"] { border-color:#c8902d; }
.spell-loot-entry > div { display:flex;flex-direction:column;flex:1;min-width:0; }
.spell-loot-icon { display:block;width:100%;height:100%;object-fit:contain;border-radius:8px; }
.spell-loot-entry > .spell-loot-icon { align-self:center;width:112px;height:112px; }
.spell-loot-stats { display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;margin:16px 0; }
.spell-loot-stats dt { font-size:.8rem;color:#cbd7df; }
.spell-loot-stats dd { margin:4px 0 0;font-weight:800;font-size:1.25rem;color:#f7efda; }
.spell-loot-entry h4 { margin:0 0 8px;font:800 1.25rem 'Barlow Condensed',sans-serif;color:#f7e6bb; }
.spell-loot-entry p { margin:6px 0;color:#cbd7df;line-height:1.5;max-width:72ch; }
.spell-loot-entry .spell-loot-state { color:#f2cd6c; }
.spell-loot-actions { display:flex;flex-direction:column;gap:8px;margin-top:auto;padding-top:16px; }
.spell-loot-actions button { min-height:44px;padding:10px 16px;border:0;border-radius:6px;background:#f2cd6c;color:#231f17;font-weight:700;cursor:pointer; }
.spell-loot-actions button:disabled { background:#344658;color:#cbd7df;cursor:not-allowed; }
.spell-loot-actions button:hover:not(:disabled) { background:#ffe08d; }
.spell-loot-actions button:focus-visible { outline:3px solid #fff0c3;outline-offset:3px; }
#spellLootStatus { color:#f2cd6c; }
#campSpellLootResult { display:flex;gap:18px;padding:20px;border:1px solid #c8902d;margin-top:16px; }
#campSpellLootResult[hidden] { display:none; }
#campSpellLootResult strong,#campSpellLootResult em { display:block;line-height:1.5; }
@media(max-width:800px) { #spellLootCollection { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:480px) {
  .spell-loot-pane { padding:12px; }
  #spellLootCollection { gap:12px; }
  .spell-loot-entry { gap:12px;padding:12px; }
  .spell-loot-entry > .spell-loot-icon { width:80px;height:80px; }
  .spell-loot-entry h4 { font-size:1rem;overflow-wrap:anywhere; }
  .spell-loot-entry p { font-size:.8rem; }
  .spell-loot-actions button { width:100%;padding:10px 8px;font-size:.8rem;overflow-wrap:anywhere; }
}
@media(max-width:359px) { #spellLootCollection { grid-template-columns:minmax(0,1fr); } }
#profilesDrawer { width:min(1100px,100vw); max-width:100vw; }
.inventory-tabs { display:flex; flex-wrap:nowrap; gap:6px; overflow-x:auto; }
@media (min-width:801px) {
  .inventory-tabs { scrollbar-width:none; }
  .inventory-tabs::-webkit-scrollbar { display:none; }
}
.inventory-section-toggle { display:none; }
.inventory-tabs button { flex:1 0 auto; min-width:max-content; min-height:50px; padding:5px 7px 5px 4px; gap:6px; font-size:.64rem; }
.inventory-tabs .inventory-tab-icon { width:34px; height:34px; }
@media(max-width:800px) {
  .inventory-tabs button { flex:0 0 auto; min-width:max-content; min-height:46px; padding:4px 10px 4px 5px; }
}
.inventory-pane > p { color:#cbd7df; line-height:1.5; }
.inventory-pane .camp-pane { padding:0; }
#campTabs { display:none; }
.level-camp .camp-panel { max-width:850px; }
.level-camp .camp-actions { position:static; }
.mercenary-entry { display:flex; gap:20px; padding:24px 0; border-bottom:1px solid #425467; }
.mercenary-entry h3,.set-entry h3 { margin:0 0 10px; font:800 1.4rem 'Barlow Condensed',sans-serif; color:#f7e6bb; }
.mercenary-entry p,.set-entry p,.set-entry li { color:#cbd7df; font-size:.9rem; line-height:1.5; }
.mercenary-entry button { min-height:44px; padding:10px 18px; background:#f2cd6c; color:#231f17; border:0; border-radius:6px; font-weight:700; cursor:pointer; }
.mercenary-entry button:disabled { background:#344658; color:#cbd7df; cursor:not-allowed; }
.mercenary-entry button:focus-visible { outline:3px solid #fff0c3;outline-offset:3px; }
.mercenary-portrait { flex:none; width:88px; height:110px; background-size:cover;background-position:center top; }
.company-details { flex:1; min-width:0; }
.company-details blockquote { margin:12px 0 20px; color:#f2cd6c; font-style:italic; }
.company-xp { display:flex; flex-direction:column; gap:8px; color:#cbd7df; font-size:.85rem; }
.company-xp progress { width:100%; height:10px; accent-color:#f2cd6c; }
.company-tree { margin-top:24px; }
.company-tree summary { padding:12px 0; cursor:pointer; color:#f7e6bb; font-weight:700; }
.company-tree summary:focus-visible { outline:3px solid #fff0c3; outline-offset:3px; }
.company-branches { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-bottom:16px; }
.company-branches h4 { color:#f7e6bb; margin:12px 0; }
.mercenary-entry .company-skill { display:flex; flex-direction:column; gap:6px; text-align:left; width:100%; margin:0 0 12px; padding:12px; }
.company-skill span { font-weight:400; line-height:1.4; }
.company-skill small { line-height:1.4; }
.mercenary-entry .company-skill { text-transform:none; }
.mercenary-entry .company-skill:disabled { opacity:1; color:#cbd7df; }
.mercenary-entry button:not(:disabled):hover { background:#ffe08d; }
@media(max-width:550px) { .company-branches { grid-template-columns:1fr; gap:8px; } .mercenary-entry:has(.company-tree) { flex-wrap:wrap; } .company-details { flex-basis:100%; } }
#profilesDrawer { display:flex;flex-direction:column;overflow:hidden; }
#profilesDrawer[hidden] { display:none; }
#profilesDrawer .drawer-head { flex:none; }
#profilesDrawer .inventory-tabs { position:static;flex:none; }
#profilesDrawer .inventory-pane { overflow:auto;min-height:0;flex:1; }
#profilesDrawer .inventory-pane[data-inventory-pane=skills],
#profilesDrawer .inventory-pane[data-inventory-pane=market],
#profilesDrawer .inventory-pane[data-inventory-pane=mercenaries],
#profilesDrawer .inventory-pane[data-inventory-pane=sets] { background:#142334;color:#f7efda;padding:20px;border-radius:8px; }
#profilesDrawer [data-inventory-pane=wall] .camp-pane { background:#142334;color:#f7efda;padding:20px;border-radius:8px;margin-bottom:24px; }
#profilesDrawer [data-inventory-pane=mercenaries] > h3,#profilesDrawer [data-inventory-pane=sets] > h3 {color:#f7e6bb;}
.camp-heading { flex-wrap:wrap; }
.camp-treasury { min-width:0;max-width:100%; }
.camp-treasury strong { overflow-wrap:anywhere; }
.set-entry { padding:24px 0; border-bottom:1px solid #425467; }
.set-entry h3 span { font:600 .85rem Barlow,sans-serif; color:#cbd7df; }
.set-entry ul { display:grid;grid-template-columns:1fr 1fr;gap:6px 24px;padding-left:20px; }
.set-entry .set-active { color:#d8efb7; }
.tree-compact-action { display:none; }
.tree-info-close { display:none; }
@media (max-width:700px), (max-height:550px) {
  #spellDraft { position:fixed;inset:0;z-index:80;padding:0;background:#101b2a; }
  #spellDraft .draft-panel { width:100%;max-width:none;height:100dvh;max-height:100dvh;overflow:hidden;padding:12px;display:flex;flex-direction:column;border:0;border-radius:0; }
  #spellDraft .draft-heading { flex:none;gap:8px;margin-bottom:8px; }
  #spellDraft .draft-heading h2 { font-size:1.4rem; }
  #draftCopy,#runSeedLabel,#draftCapacity { display:none; }
  #draftOptions { flex:1;min-height:0;container-type:normal; }
  .spell-path-workspace { display:flex;flex-direction:column;gap:6px;height:100%;min-height:0; }
  .spell-map-column { display:flex;flex:1;flex-direction:column;min-height:0; }
  .spell-map-legend { padding:0 0 5px;gap:16px;font-size:.65rem; }
  .spell-tree-viewport { flex:1;min-height:0;max-height:none;overflow:visible;border:0;background:none; }
  .spell-tree-board { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(44px,1fr));gap:4px;min-width:0;height:100%!important; }
  .spell-branches { display:none; }
  .branch-node { position:relative;top:auto;left:auto;width:100%;min-height:44px;height:100%;padding:3px 2px;gap:3px;justify-content:center;touch-action:manipulation;user-select:none;-webkit-touch-callout:none; }
  .branch-icon { width:clamp(32px,7dvh,56px);height:clamp(32px,7dvh,56px);margin:0 0 5px;border-width:1px; }
  .branch-node > strong { font-size:clamp(.66rem,1.7dvh,.85rem);line-height:1.05; }
  .branch-node > small { display:none; }
  .branch-status { font-size:.6rem; }
  .branch-rank { font-size:.6rem;min-width:18px;bottom:-5px; }
  .spell-map-hint { margin:5px 0;font-size:.65rem; }
  .tree-weapon-choice { padding:5px 8px;min-height:44px;gap:8px; }
  .tree-weapon-icon { width:28px;height:28px; }
  .tree-weapon-choice strong { font-size:.85rem; }
  .tree-weapon-choice small { font-size:.65rem;margin:2px 0 0; }
  .spell-tree-detail { display:none; }
  .tree-compact-action { display:flex;gap:8px;align-items:center;padding-bottom:env(safe-area-inset-bottom);flex:none; }
  .tree-compact-action .tree-spend-point { flex:1;min-height:44px;margin:0;padding:7px;font-size:.95rem; }
  #draftOptions .tree-compact-action,#skillTreeGrid .tree-compact-action { width:100%; }
  #draftOptions .tree-compact-action .tree-spend-point,#skillTreeGrid .tree-compact-action .tree-spend-point { flex:1;width:auto;max-width:none; }
  .tree-compact-action .tree-spend-point small { margin-top:2px; }
  .tree-info-button { min-width:52px;min-height:44px;color:#f7e6bb;background:#263c50;border:1px solid #738394;border-radius:6px; }
  .spell-path-workspace.info-open .spell-tree-detail { display:block;position:fixed;inset:12px;z-index:130;max-height:calc(100dvh - 24px);padding:16px;overflow:auto;box-shadow:0 16px 48px #000a; }
  .tree-info-close { display:block;margin:0 0 14px auto;min-height:44px;padding:8px 16px;background:#f2cd6c;color:#231f17;border:0;border-radius:6px; }
  #profilesDrawer { padding:16px; }
  .inventory-tabs button { padding:7px 10px;font-size:.8rem; }
  [data-inventory-pane=skills] .run-upgrade-heading { margin:8px 0; }
  [data-inventory-pane=skills] #skillTreeIntro,[data-inventory-pane=skills] .run-spoils-workbench { display:none; }
  [data-inventory-pane=skills] #skillTreeGrid { height:calc(100dvh - 265px);min-height:335px;container-type:normal; }
  .mercenary-entry { gap:12px; }
  .mercenary-portrait { width:58px;height:80px; }
  .set-entry ul { grid-template-columns:1fr; }
  .level-camp { position:fixed;inset:0;z-index:75;padding:12px; }
  .level-camp .camp-panel { max-height:calc(100dvh - 24px);overflow:auto; }
  .camp-actions > div { display:flex;flex-wrap:wrap;gap:8px; }
  .camp-actions button { min-height:44px; }
  #profilesDrawer .inventory-pane[data-inventory-pane=skills] { padding:8px;overflow:hidden;display:flex;flex-direction:column; }
  #profilesDrawer .inventory-pane[data-inventory-pane=skills][hidden] {display:none;}
  [data-inventory-pane=skills] .camp-pane {display:flex;flex:1;flex-direction:column;min-height:0;}
  [data-inventory-pane=skills] #skillTreeGrid { height:auto;min-height:0;flex:1; }
  [data-inventory-pane=skills] .run-upgrade-heading {flex:none;}
  [data-inventory-pane=skills] .run-upgrade-heading h3 {font-size:1rem;}
  [data-inventory-pane=skills] #skillChoiceStatus {font-size:.65rem;}
  .spell-map-hint {font-size:0;line-height:1;margin:5px 0;}
  .spell-map-hint::after {content:'Tap a skill. Hold or use Info for details.';font-size:.65rem;}
  #spellDraft .draft-heading {display:flex;align-items:center;}
  #spellDraft .draft-heading h2 {font-size:1.1rem;}
  #spellDraft .draft-heading-actions {margin:0;}
  #spellDraft .draft-heading-actions > span {padding:6px;font-size:.7rem;white-space:nowrap;}
}
@media (max-height:650px) and (max-width:599px) {
 .branch-icon {width:28px;height:28px;margin-bottom:3px;padding:2px;}
 .branch-node {gap:2px;padding:2px 1px;}
 .branch-node > strong {font-size:.63rem;}
 .branch-status {font-size:.55rem;}
 .tree-weapon-choice {padding:4px 6px;}
 .tree-weapon-choice small {font-size:.58rem;}
 #profilesDrawer .drawer-head p {display:none;}
 #profilesDrawer .drawer-head h2 {font-size:1.5rem;}
 #profilesDrawer .inventory-tabs {gap:3px;padding:4px 12px;margin-bottom:4px;}
 #profilesDrawer .inventory-tabs button {font-size:.65rem;padding:4px 6px;}
 #profilesDrawer .inventory-tabs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));}
 #profilesDrawer .inventory-tabs button {width:100%;font-size:.6rem;padding:4px 2px;}
 [data-inventory-pane=skills] .run-upgrade-heading {display:none;}
 [data-inventory-pane=skills] .branch-status {display:none;}
 [data-inventory-pane=skills] .branch-icon {width:24px;height:24px;}
 [data-inventory-pane=skills] .branch-node > strong {font-size:.58rem;}
}
@media (max-height:550px) and (min-width:600px) {
  .spell-tree-board { grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(2,minmax(44px,1fr)); }
  .branch-icon { width:32px;height:32px; }
  #profilesDrawer {padding:8px 12px;}
  #profilesDrawer .drawer-head {padding-bottom:5px;}
  #profilesDrawer .drawer-head h2 {font-size:1.2rem;}
  #profilesDrawer .drawer-head p {display:none;}
  #profilesDrawer .inventory-tabs {flex-wrap:nowrap;gap:4px;padding:5px 12px;margin:0 -12px;}
  #profilesDrawer .inventory-tabs button {flex:1 0 0;min-width:0;min-height:44px;padding:4px;font-size:.64rem;}
  [data-inventory-pane=skills] .run-upgrade-heading {display:none;}
  [data-inventory-pane=skills] .spell-map-legend {display:none;}
  [data-inventory-pane=skills] .branch-icon {width:26px;height:26px;}
  [data-inventory-pane=skills] .branch-node > strong {font-size:.6rem;}
  [data-inventory-pane=skills] .branch-status {font-size:.55rem;}
  [data-inventory-pane=skills] .tree-weapon-choice {min-height:44px;}
  [data-inventory-pane=skills] .spell-map-hint {display:none;}
}
.enemy-guide { line-height: 1.55; }
.enemy-guide dt { margin-top: 20px; font-weight: 700; color: #edcf91; }
.enemy-guide dd { margin: 5px 0 0; color: #c4cbd0; }
.spell-swap-dialog { width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;margin:auto;padding:24px;border:1px solid #82909a;border-radius:12px;background:#142334;color:#fff0ce; }
.spell-swap-dialog::backdrop { background:#07101be6; }
.spell-swap-dialog h2 { margin:0 0 12px;font:800 28px/1.1 'Barlow Condensed',sans-serif; }
.spell-swap-dialog p { color:#cbd7df;line-height:1.5; }
#spellSwapOptions { display:grid;gap:8px;margin-block:20px; }
.spell-swap-dialog button { display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:12px;border:1px solid #82909a;border-radius:8px;background:#203244;color:#fff0ce;text-align:left;font:inherit;cursor:pointer; }
.spell-swap-dialog button:hover { background:#31495d; }
.spell-swap-dialog button:focus-visible { outline:3px solid #f2cd6c;outline-offset:3px; }
#spellSwapOptions button > :first-child { width:44px;height:44px;flex:none; }
#spellSwapOptions small { display:block;margin-top:4px;font-size:13px;color:#cbd7df; }
#spellSwapReserve { justify-content:center;border-color:#f2cd6c;color:#f2cd6c; }
#spellSwapError:empty { display:none; }
.enemy-status-guide { padding:12px 16px 20px;border:1px solid #647586;border-radius:12px;background:#142334;color:#fff0ce;margin-bottom:16px; }
.enemy-status-guide > p { color:#cbd7df; }
.enemy-status-guide summary { min-height:44px;padding-block:12px;cursor:pointer;color:#f2cd6c;font-weight:700; }
.enemy-status-guide summary:focus-visible { outline:3px solid #f2cd6c;outline-offset:3px; }
#enemyStatusLegend { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px; }
#enemyStatusLegend > div { display:flex;align-items:baseline;gap:12px; }
#enemyStatusLegend i { flex:none;width:10px;height:10px;border-radius:50%;background:var(--status-color); }
#enemyStatusLegend strong { display:block;color:#fff0ce; }
#enemyStatusLegend small { display:block;color:#cbd7df;font-size:14px;line-height:1.5;margin-top:4px; }
@media(max-width:600px) { #enemyStatusLegend { grid-template-columns:1fr; } .spell-swap-dialog { padding:18px; } }
#campWarRoom { min-width:0; }
#profilesDrawer.preparation-war-room { position:static;inset:auto;transform:none;width:100%;max-width:none;height: min(650px,70dvh);max-height:none;padding:0;box-shadow:none;border:0;border-radius:0;background:transparent; }
#profilesDrawer.preparation-war-room > .drawer-head,
#profilesDrawer.preparation-war-room > .war-room-relic-link { display:none; }
#profilesDrawer.preparation-war-room .inventory-tabs { margin:0 0 12px;padding:4px 0 10px;flex-wrap:nowrap;display:flex; }
#profilesDrawer.preparation-war-room .inventory-tabs button { flex:0 0 auto;min-width:max-content; }
@media (min-width:801px) {
  #profilesDrawer.preparation-war-room .inventory-tabs {
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;
    margin:0 0 16px;padding:4px 0 16px;
    background:transparent;border-bottom:1px solid #34475a;backdrop-filter:none;
    overflow:visible;
  }
  #profilesDrawer.preparation-war-room .inventory-tabs button {
    flex-direction:column;min-width:0;width:100%;min-height:80px;padding:10px 6px;gap:6px;
    font-size:.9rem;line-height:1.2;letter-spacing:.025em;
    border-color:#526174;box-shadow:none;
  }
  #profilesDrawer.preparation-war-room .inventory-tabs button > span { white-space:normal; }
  #profilesDrawer.preparation-war-room .inventory-tabs .inventory-tab-icon { width:32px;height:32px;flex:0 0 32px; }
  #profilesDrawer.preparation-war-room .inventory-tabs button::after { opacity:0; }
  #profilesDrawer.preparation-war-room .inventory-tabs button:hover { border-color:#c8902d; }
  #profilesDrawer.preparation-war-room .inventory-tabs button[aria-selected="true"] { border-color:#f2cd6c; }
  #profilesDrawer.preparation-war-room .inventory-tabs button[aria-selected="true"]::after { opacity:1;height:3px; }
  #profilesDrawer.preparation-war-room .inventory-tabs button:focus-visible { outline:3px solid #ffe69a;outline-offset:3px; }
}
#profilesDrawer.preparation-war-room .inventory-pane[data-inventory-pane],
#profilesDrawer.preparation-war-room .inventory-pane.defense-surface[data-inventory-pane] { margin:0;padding:0; }
#profilesDrawer.preparation-war-room [data-inventory-pane=bestiary],
#profilesDrawer.preparation-war-room [data-inventory-pane=wall],
#profilesDrawer.preparation-war-room [data-inventory-pane=relics] { padding:0;background:#ded1af url('assets/parchment-texture-v1.png') center / 640px auto;color:var(--paper-ink); }
#profilesDrawer.preparation-war-room .preparation-loadout { padding:0;background:#142334;color:#fff0ce; }
#profilesDrawer.preparation-war-room .inventory-pane .camp-pane { padding:0; }
#profilesDrawer.preparation-war-room .battle-preparation { margin:0; }
#profilesDrawer.preparation-war-room [data-inventory-pane=skills] #skillTreeGrid { min-height:340px; }
.level-camp .camp-actions { position:static;bottom:0;z-index:3;background:#101e2b;padding:12px 0 0;margin-top:16px; }
@media(max-width:700px), (max-height:550px) {
  #profilesDrawer.preparation-war-room { height:calc(100dvh - 235px);min-height:320px; }
  #profilesDrawer.preparation-war-room [data-inventory-pane=skills] #skillTreeGrid { min-height:0; }
  .level-camp .camp-actions > div { flex-direction:row; }
  .level-camp .camp-actions > p { display:none; }
  .level-camp .camp-actions .primary-action { flex:1; }
}

/* Mobile inventory section disclosure retains the desktop tab controls. */
@media (max-width:800px) {
  #profilesDrawer .inventory-section-toggle {
    display:flex;align-items:center;gap:10px;flex:none;width:100%;min-height:52px;
    margin:4px 0 10px;padding:7px 12px;color:#f7efda;
    background:linear-gradient(180deg,#323a43,#14243a 58%,#0d1726);
    border:1px solid #c8902d;border-radius:7px;
    font:800 .9rem 'Barlow Condensed',sans-serif;text-transform:uppercase;text-align:left;
  }
  .inventory-section-toggle .inventory-tab-icon {width:34px;height:34px;}
  .inventory-section-toggle .section-chevron {width:20px;height:20px;margin-left:auto;fill:none;stroke:#f2cd6c;stroke-width:2;}
  .inventory-section-toggle[aria-expanded="true"] .section-chevron {transform:rotate(180deg);}
  #profilesDrawer .inventory-tabs {display:none;}
  #profilesDrawer .inventory-tabs.sections-open {
    display:flex;flex-direction:column;flex:none;gap:4px;position:static;
    margin:0 0 12px;padding:6px;background:#101e30;border:0;border-radius:7px;
    max-height: min(340px, 50dvh);overflow-x:hidden;overflow-y:auto;backdrop-filter:none;
  }
  #profilesDrawer .inventory-tabs.sections-open button:not([hidden]) {
    width:100%;min-width:0;min-height:48px;flex:none;justify-content:flex-start;
    padding:6px 10px;gap:10px;font-size:.85rem;
  }
  #profilesDrawer .inventory-section-toggle:focus-visible,
  #profilesDrawer .inventory-tabs button:focus-visible {outline:3px solid #fff0c3;outline-offset:2px;}
}

/* Preparation scrolls naturally on desktop; the skill tree owns a focused dialog. */
@media(min-width:801px) {
  #profilesDrawer.preparation-war-room { height:auto;overflow:visible; }
}
.prepare-empty { display:flex;flex-direction:column;align-items:center;text-align:center;padding:24px 16px 32px; }
.prepare-empty-art { display:block;width:112px;height:112px;margin-bottom:16px; }
.battle-preparation .prepare-empty h3 { margin:0 0 8px;font-size:1.65rem;color:#fff0ce; }
.battle-preparation .prepare-empty p { max-width:38ch;margin:0 0 20px;color:#cbd7df;line-height:1.5; }
.battle-preparation [data-prepare-open] { min-height:52px; }
.battle-preparation [data-prepare-open] small { display:block;margin-top:4px;font-size:.8rem;font-weight:500; }
.preparation-skills-dialog { width:min(1060px,calc(100% - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:24px;border:0;border-radius:16px;background:#101e2b;color:#fff0ce;box-shadow:0 20px 60px #0009;overflow:auto; }
.preparation-skills-dialog::backdrop { background:#050c16cc; }
.preparation-skills-dialog > header { display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px; }
.preparation-skills-dialog h2 { margin:0;font-size:2rem; }
.preparation-skills-dialog .camp-pane { display:block; }
.preparation-skills-dialog #skillTreeGrid { height:auto;min-height:0; }
.preparation-skills-dialog .run-upgrade-heading { margin-bottom:16px; }
.preparation-skills-dialog #skillTreeIntro { display:none; }
.preparation-skills-dialog button:focus-visible { outline:3px solid #ffe69a;outline-offset:3px; }
@media(max-width:800px) {
  .preparation-skills-dialog { width:calc(100% - 16px);max-height:calc(100dvh - 16px);padding:16px; }
  .prepare-empty { padding:20px 8px; }
  .prepare-empty-art { width:96px;height:96px; }
}

.battle-preparation [data-prepare-open] { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0; }
.preparation-skills-dialog > header button { min-height:44px;padding:10px 20px;border:1px solid #82909a;border-radius:6px;background:#1b2e43;color:#fff0ce;font:700 1rem 'Barlow',sans-serif;cursor:pointer; }
.preparation-skills-dialog > header button:hover { background:#344658; }
.preparation-skills-dialog .run-upgrade-heading { flex-wrap:wrap;min-width:0; }
.preparation-skills-dialog .skill-choice-status { white-space:normal;max-width:100%; }
@media(max-width:800px) {
  .preparation-skills-dialog .run-upgrade-heading { display:block; }
  .preparation-skills-dialog .run-upgrade-heading h3 { display:none; }
  .preparation-skills-dialog .skill-choice-status { display:block;text-align:left;font-size:.8rem; }
}
