/* Keep the editable character-sheet navigation discoverable on narrow screens. */
.mobile-section-jump { display: none; }
/* Choice controls must not inherit the editable sheet's full-width text fields. */
#guidedBuilder fieldset { min-inline-size: 0; }
#guidedBuilder .builder-option-list label,
#guidedBuilder .builder-spell-list label,
#guidedBuilder .builder-radio { min-width: 0; min-height: 44px; }
#guidedBuilder input[type="checkbox"],
#guidedBuilder input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex: 0 0 20px;
  padding: 0;
  margin: 2px 0 0;
}
#guidedBuilder .builder-option-list label > span,
#guidedBuilder .builder-spell-list label > span,
#guidedBuilder .builder-radio > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#guidedBuilder .builder-field { min-width: 0; }
#guidedBuilder .builder-field input,
#guidedBuilder .builder-field select { min-width: 0; max-width: 100%; }
@media (max-width: 920px) {
  .guided-builder-active .builder-actions { position: static; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .guided-builder-active .topbar { padding: 14px 18px 4px; }
  .guided-builder-active .topbar h1 { font-size: 18px; }
  .guided-builder-active .topbar p { display: none; }
  .builder-step-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .builder-step-head > span { white-space: nowrap; }
  .builder-step-head h2 { font-size: 26px; }
  .builder-option-list, .builder-spell-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  #editorApp nav#nav {
    display: block;
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    padding: 8px 12px;
    background: var(--paper);
  }

  #editorApp nav#nav button {
    display: none;
  }

  #editorApp nav#nav .mobile-section-jump {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 700;
  }

  #editorApp nav#nav .mobile-section-jump select {
    flex: 1;
    min-width: 0;
    min-height: 44px;
  }

  #editorApp main {
    padding-bottom: 28px;
  }

  #editorApp main section {
    scroll-margin-top: 76px;
  }
}

/* Keep the desktop action strip after the form so it never covers editable fields. */
@media (min-width: 721px) {
  #editorApp main {
    padding-bottom: 48px;
  }

  #editorApp footer {
    position: static;
    margin-top: 0;
    background: var(--paper);
  }
}
