/* Desktop decisions stay compact; supporting detail lives in the inspectors. */
.desktop-spell-summary, .spell-replace-icon, .desktop-short-label { display: none; }
.desktop-skill-action { display: none; }
.start-save-details { margin-top: 12px; color: var(--muted); font-size: max(var(--desktop-text-min, 0px), .875rem); line-height: 1.5; }
.start-save-details > summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.start-save-details > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.start-save-details p { margin: 4px 0 0; }
.start-save-details strong, .start-save-details span { display: block; }
.campaign-picker > .start-captain { display: block; margin: 12px 0 0; color: var(--ink); font-size: max(var(--desktop-text-min, 0px), .875rem); }
.campaign-picker > .start-captain[hidden] { display: none; }
@media (min-width: 1025px) {
  small, sub, sup { font-size: max(var(--desktop-text-min), .83333em); }
  .app-shell { grid-template-rows: auto minmax(0, 1fr); }
  .topbar { min-height: 72px; }
  .brand-lockup p, #heroSummary > div > span, .desktop-full-label { display: none; }
  .desktop-short-label { display: inline; }
  .brand-lockup h1 { white-space: nowrap; }
  .hero-summary > div { min-width: 0; }
  #heroName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero-level, .xp-row > strong { flex-shrink: 0; white-space: nowrap; }
  .hero-combat-strip dt { white-space: normal; overflow: visible; letter-spacing: 0; line-height: 1.3; }
  .hero-combat-strip dd { font-variant-numeric: tabular-nums; }
  .spell-progress-summary #spoilCount { display: none; }
  .spell-progress-slot { grid-template-columns: minmax(0, 1fr); padding: 8px 4px; }
  #spoilSlots .spell-progress-slot > :first-child { display: none; }
  .spell-progress-slot > span:last-child { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .spell-progress-slot strong { font-size: max(var(--desktop-text-min), 1rem); }
  .spell-progress-slot small { margin: 0; line-height: 1.3; }
  .section-heading > div { min-width: 0; }
  .section-heading h2 { letter-spacing: .02em; font-size: max(var(--desktop-text-min), 1rem); }
  .arsenal-command .section-heading p, .tower-command .section-heading p, .keep-actions > small { display: none; }
  .arsenal-count { flex: none; white-space: nowrap; }
  .arsenal-slot.empty:not(.spellbook-remainder) { display: none; }
  .tower-slot.empty + .tower-slot.empty { display: none; }
  .arsenal-slots { max-height: none; overflow: visible; padding: 0; }
  .arsenal-slot, .tower-slot { min-height: 64px; gap: 8px; padding: 8px; }
  .arsenal-slot:where([data-replace-spell]) { grid-template-columns: 44px minmax(0, 1fr) 20px; }
  .arsenal-slot > .slot-icon { width: 44px; height: 44px; }
  .slot-copy { min-width: 0; }
  .arsenal-slot .slot-copy strong, .tower-slot .slot-copy strong { font-size: max(var(--desktop-text-min), .875rem); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .arsenal-slot .slot-copy small, .tower-slot .slot-copy small { line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
  .arsenal-slot .slot-full-details, .tower-slot .slot-full-details, .spell-replace-label { display: none; }
  .arsenal-slot .desktop-spell-summary, .tower-slot .desktop-spell-summary { display: block; }
  .spell-replace-icon { display: block; width: 20px; height: 20px; fill: none; stroke: var(--gold-300); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .arsenal-slot .slot-cooldown-number { display: none; }
  .arsenal-slot .desktop-spell-summary[data-cooldown]::after { content: ' · ' attr(data-cooldown); }
  .arsenal-slot.boss-silenced .desktop-spell-summary { color: #dfc2ff; }
  .tower-doctrine { letter-spacing: 0; line-height: 1.3; white-space: normal; }
  .keep-actions button { min-height: 48px; height: auto; }
  .keep-actions .repair-label { white-space: normal; line-height: 1.4; }
  .next-front-copy { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .next-front-copy > * { min-width: 0; white-space: normal; line-height: 1.3; }
  .call-wave-button { min-height: 48px; height: auto; }
  #callWaveText { line-height: 1.2; overflow-wrap: anywhere; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs { flex-wrap: wrap; overflow: visible; gap: 4px; }
  #profilesDrawer.desktop-loadout.preparation-war-room .inventory-tabs button { flex: 1 1 7rem; min-width: 0; min-height: 48px; white-space: normal; line-height: 1.25; }
  #profilesDrawer .inventory-tabs button > span { min-width: 0; overflow-wrap: anywhere; }
  #profilesDrawer .inventory-section-heading, #profilesDrawer .equipment-picker-head { flex-wrap: wrap; gap: 8px 16px; }
  #profilesDrawer .inventory-section-heading > div, #profilesDrawer .equipment-picker-head > div { min-width: 0; }
  #profilesDrawer .inventory-section-heading p, #profilesDrawer .equipment-picker-head p { max-width: 65ch; white-space: normal; overflow-wrap: anywhere; }
  .loadout-hover article { min-width: 0; }
  .loadout-hover h3, .loadout-hover p, .loadout-hover li { overflow-wrap: anywhere; }
  #levelCamp .camp-heading { flex-wrap: wrap; }
  #levelCamp .camp-heading > div:first-child { flex: 1 1 200px; min-width: 0; }
  #levelCamp .camp-heading p { max-width: 60ch; }
  #levelCamp .camp-heading .camp-treasury { margin-left: auto; }
  #profilesDrawer:not(.preparation-war-room) { grid-template-columns: minmax(192px, 11rem) minmax(0, 1fr); }
  #profilesDrawer:not(.preparation-war-room) .wr-nav button { min-width: 0; }
  #profilesDrawer .ally-icon-grid .formation-empty { display: none; }
  /* Home presents the next journey; combat controls return in preparation. */
  .app-shell:has(#startScreen:not([hidden])) .game-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .app-shell:has(#startScreen:not([hidden])) .command-rail,
  .app-shell:has(#startScreen:not([hidden])) .battle-status,
  .app-shell:has(#startScreen:not([hidden])) .wall-health { display: none; }
  .app-shell:has(#startScreen:not([hidden])) .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  #startScreen { padding: 32px; }
  #startScreen .start-copy { width: min(560px, 100%); max-width: none; }
  #startScreen .royal-seal { display: none; }
  #startScreen h2 { max-width: 16ch; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1; }
  #startScreen .start-copy > p { max-width: 42ch; }
  #startScreen .campaign-picker { width: 100%; margin-top: 28px; }
  #startScreen .campaign-picker label { color: var(--muted); letter-spacing: 0; text-transform: none; font-size: max(var(--desktop-text-min), .875rem); }
  #startScreen select { border-color: #617384; box-shadow: none; }
  #startScreen .start-actions { margin-top: 20px; }
  #startScreen .start-actions .primary-action { width: 100%; min-height: 52px; }
  #startScreen .start-copy > .audio-hint { display: none; }
  .command-rail .hero-combat-strip, .command-rail .spell-progress-summary, .command-rail #heroTitle { display: none; }
  .command-rail .xp-row > strong { display: none; }
  .desktop-skill-action:not([hidden]) { display: block; width: 100%; min-height: 48px; margin-top: 16px; padding: 10px 12px; border: 1px solid #c8a85c; border-radius: 6px; background: #1b3151; color: var(--ink); font: 700 max(var(--desktop-text-min), 1rem)/1.3 'Barlow Condensed', sans-serif; cursor: pointer; }
  .desktop-skill-action:hover:not(:disabled) { background: #244b7c; }
  .desktop-skill-action:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
  .desktop-skill-action:disabled { opacity: .6; cursor: default; }
  .command-rail .call-wave-button:disabled { display: none; }
  #pauseContext, #desktopTextHint { display: none; }
  dialog.pause-screen .battle-speed-options button[aria-pressed="true"],
  dialog.pause-screen .desktop-text-options button[aria-pressed="true"] { background: #244b7c; color: var(--ink); border-color: var(--gold-300); }
}
@media (min-width: 1025px) and (max-width: 1200px) {
  .topbar .header-action-label { display: none; }
  .topbar .top-actions .icon-button { width: 48px; padding: 0; }
}
/* A draft owns its scroll regions; the shared sticky inspector must not cross
   the action row when the dialog is shorter than the selected spell's details. */
@media (min-width: 1025px) and (min-height: 551px) {
  #spellDraft .draft-panel {
    display: flex;
    flex-direction: column;
    height: min(900px, 100%);
    min-height: 0;
    overflow: hidden;
  }
  #spellDraft .draft-heading { flex: none; flex-wrap: wrap; gap: 12px 24px; }
  #spellDraft .draft-heading > div:first-child { flex: 1 1 300px; min-width: 0; }
  #spellDraft #runSeedLabel, #spellDraft #draftCapacity, #draftOptions .spell-map-hint { display: none; }
  #draftOptions { display: flex; flex: 1; flex-direction: column; min-height: 0; }
  #draftOptions > .spell-path-workspace {
    flex: 1;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) clamp(276px, 28%, 360px);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 16px;
  }
  #draftOptions .spell-map-column {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
  }
  #draftOptions .spell-tree-viewport { min-height: 0; max-height: none; }
  :is(#draftOptions, #skillTreeGrid, #availableSpellGrid) .spell-tree-board { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); }
  :is(#draftOptions, #skillTreeGrid, #availableSpellGrid) .branch-node { min-height: 136px; padding: 8px 5px; }
  :is(#draftOptions, #skillTreeGrid, #availableSpellGrid) .branch-node > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
  :is(#draftOptions, #skillTreeGrid, #availableSpellGrid) .branch-node > small,
  :is(#skillTreeGrid, #availableSpellGrid) .spell-map-hint,
  .preparation-skills-dialog .run-upgrade-heading h3,
  .tree-respec[data-spent-points="0"] { display: none; }
  #draftOptions .spell-tree-detail {
    position: static;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  #draftOptions .tree-compact-action {
    padding-top: 12px;
    border-top: 1px solid #3d4b5d;
  }
}
@media (min-width: 1081px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 380px); }
  .command-rail { overflow-y: auto; overflow-x: hidden; }
}
@media (min-width: 1025px) and (max-width: 1080px) {
  .command-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* A first defense asks only for equipment and skills. Training follows at level 2. */
html[data-gun-training-available="false"] .gear-gun-upgrade,
html[data-batteries-available="false"] .tower-command,
html[data-campaign-menu-level="1"] .run-spoils-workbench { display:none !important; }
