@media (max-width: 1280px) and (min-width: 701px) {
  .planner-shell-right-panel {
    right: 0;
    left: auto;
    border-radius: var(--planner-radius-panel) 0 var(--planner-radius-panel) var(--planner-radius-panel);
  }

  .planner-shell-right-panel[data-panel="arsenal"] {
    width: min(35rem, calc(100vw - 3rem));
    min-width: min(30rem, calc(100vw - 3rem));
  }
}

@media (max-width: 900px) {
  .planner-shell .planner-primary-header {
    grid-template-columns: 1fr;
  }

  .planner-shell .quick-build-controls,
  .planner-shell .planner-primary-header .starting-class-panel {
    width: min(20rem, 100%);
  }

}

@media (max-width: 700px) {
  body.has-planner-sheet {
    overflow: hidden;
  }

  .planner.planner-shell,
  .planner-shell .planner-workspace,
  .planner-shell-bottom {
    width: 100%;
    margin-right: 0;
  }

  .planner-shell-right-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-top: -1px;
  }

  .planner-shell-right-tabs .planner-shell-tab {
    width: 100%;
    min-height: var(--planner-control-height);
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 0.4rem 0.4rem;
    writing-mode: horizontal-tb;
  }

  .planner-shell-right-tabs .planner-shell-tab + .planner-shell-tab {
    border-top: 0;
    border-left: 0;
  }

  .planner-shell-right-stage {
    position: static;
  }

  .planner-shell-bottom-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planner-shell-bottom-tabs .planner-shell-tab {
    width: 100%;
  }

  .planner-shell-panel,
  .planner-shell-right-panel,
  .planner-shell-bottom-panel,
  .planner-shell-right-panel[data-panel="arsenal"] {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--planner-layer-sheet);
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: min(82dvh, 46rem);
    margin: 0;
    overflow: auto;
    padding: 3rem 1rem 1rem;
    border-radius: var(--planner-radius-panel) var(--planner-radius-panel) 0 0;
    pointer-events: auto;
  }

  .planner-shell-mobile-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .planner-shell-mobile-header h2 {
    margin: 0;
    font-size: 0.95rem;
  }

  .planner-shell-mobile-header button {
    padding: 0.25rem 0.5rem;
  }

  .planner-shell-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--planner-layer-sheet) - 1);
    display: block;
    width: 100%;
    max-width: none;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
  }

  .planner-shell-backdrop[hidden] {
    display: none;
  }
}
