/* Stable settings frame: retain the existing sidebar, colors, type, and page-specific widths. */
#appShell .content:has(.settings-workspace) {
  display: block;
  padding: 22px clamp(20px, 2vw, 32px) 28px;
}

#appShell .content:has(.settings-workspace) > #subpage {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

#appShell .settings-workspace {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

#appShell .settings-layout {
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  gap: clamp(20px, 2vw, 32px);
}

#appShell .settings-content,
#appShell .settings-content > section,
#appShell .settings-content table {
  min-width: 0;
}

@media (max-width: 980px) {
  #appShell .content:has(.settings-workspace) {
    padding: 16px clamp(16px, 3vw, 24px) 24px;
  }

  #appShell .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  #appShell .settings-section-picker > summary {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface);
  }
}

@media (max-width: 640px) {
  #appShell .content:has(.settings-workspace) {
    padding: 12px 14px 20px;
  }

  #appShell .settings-layout {
    gap: 14px;
  }

  #appShell .settings-navigation button {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  #appShell .settings-workspace,
  #appShell .settings-navigation,
  #appShell .settings-content {
    scroll-behavior: auto;
  }
}
