.settings {
  height: 100%;
  overflow-y: auto;
  padding: 32px 24px 24px;
}

.settings__content {
  max-width: 480px;
  margin: 0 auto;
}

.settings__title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.settings__section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
}

.settings__section--compact {
  padding: 14px 20px;
}

/* Light mode: cards in light mode lose almost all visible
   separation from the bg because the surface↔bg contrast is
   subtle (#f8f7f5 on #f0eeeb). A soft elevation shadow restores
   the layered card feel from earlier iterations without making
   the surface itself darker. Dark mode leaves cards flat — dark
   surfaces don't need elevation. */
[data-theme="light"] .settings__section {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Section titles: sentence-case, no tracking, no uppercase. The
   previous uppercase-tracked treatment read as ornament. */
.settings__section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 14px;
}

.settings__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* "Configured" indicator now uses the shared <StatusDot> component
   (frontend/src/components/ui/StatusDot.jsx) — both this badge
   AND the provider-row "Connected" / "Not connected" status pull
   from the same source so the dot size + gap + typography never
   drift across surfaces. */

.settings__subtext {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.settings__subtext--tight {
  margin: 4px 0 0;
}

.settings__versions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings__version {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: var(--muted);
}

.settings__notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings__subtext a {
  color: var(--accent);
  text-decoration: underline;
}

.settings__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.settings__input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.settings__input:focus,
.settings__input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.settings__success {
  font-size: 13px;
  color: var(--accent);
}

.settings__error {
  font-size: 13px;
  color: var(--danger, #ef4444);
}

.settings__btn {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

/* Keyboard focus ring on primary + outline buttons. */
.settings__btn:focus-visible,
.settings__btn--outline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings__btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.settings__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.settings__btn--sm {
  padding: 5px 12px;
  font-size: 13px;
}

.settings__btn--outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  margin-top: 0;
}

.settings__btn--outline:hover {
  background: var(--surface2);
}

.settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Override the apps-sdk-ui Switch tokens so the dark-mode toggle
     reads at the same scale as our earlier bespoke 48x28 switch.
     The SDK ships smaller defaults tuned for the OpenAI design
     system; these locals scope the bump so it doesn't bleed into
     other future Switch usages. Accent palette wired in so the
     ON state uses the Möbius purple. */
  --switch-track-width: 48px;
  --switch-track-height: 28px;
  --switch-thumb-size: 22px;
  --switch-thumb-offset: 3px;
  --switch-track-color: var(--border);
  --switch-track-color-hover: var(--surface2);
  --switch-track-color-checked: var(--accent);
  --switch-track-color-disabled: var(--surface);
  --switch-track-color-checked-disabled: var(--accent-dim);
  --color-ring: var(--accent);
}

/* Tailwind v4's Preflight resets button backgrounds in the base
   layer, which fights the SDK Switch's component-layer
   `background: var(--switch-track-color-*)` rules and leaves the
   track transparent. Targeting the Switch button directly from
   our settings scope gives a higher-specificity wins-over-base
   override. Mirrors what the SDK does, just at a layer Tailwind's
   base can't reset. */
.settings__row button[role="switch"] {
  background: var(--switch-track-color);
  /* Tailwind v4 Preflight ALSO zeros border-radius on ALL
     buttons in an UNLAYERED rule that beats the SDK Switch's
     layered `.Track { border-radius: var(--radius-full) }`.
     The thumb (a <span>) is unaffected so it renders circular,
     but the track stayed a sharp rectangle — the toggle looked
     like a square on prod even though the thumb was round.
     Same fix pattern as the background override above. */
  border-radius: var(--radius-full, 9999px);
}
.settings__row button[role="switch"][data-state="checked"] {
  background: var(--switch-track-color-checked);
}
.settings__row button[role="switch"][data-disabled] {
  background: var(--switch-track-color-disabled);
}
.settings__row button[role="switch"][data-disabled][data-state="checked"] {
  background: var(--switch-track-color-checked-disabled);
}

/* The bespoke `.settings__toggle*` rules that used to live below
   here were deleted: SettingsView.jsx renders the SDK <Switch>
   from `@openai/apps-sdk-ui/components/Switch`, which carries its
   own track + knob markup, so the custom toggle classes were
   unreachable. Removed instead of left as dead weight. */

/* Provider rows + .settings__providers wrapper styles live in
   ../ProviderAuth/ProviderAuth.css since the component is shared
   between SettingsView and SetupWizard. */
