/* Settings (the console's Settings mockup): a 200 px list of sections at the left, one section at a time at the
   right, each a panel with a titled head and rows of label · plain line · control; a switch, a stepper with its
   unit, a segmented choice, a mono value box, and the sticky "N unsaved changes" bar. Tokens and the shared
   components (pill, btn, seg, input, savebar, banner) come from app.css; everything here is this page's own. */

.settings-page { max-width: 1040px; }
.sgrid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }

/* ── the sections list: 36 px rows, the active one on the raised tint, Danger zone in red ── */
.snav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--top-h) + 16px); }
.snav__item { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; white-space: nowrap; text-decoration: none; }
.snav__item:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.snav__item.is-active { background: var(--panel-2); color: var(--ink); }
.snav__item--danger, .snav__item--danger.is-active, .snav__item--danger:hover { color: var(--bad); }
.snav__lock { display: inline-grid; place-items: center; color: var(--ink-3); }

/* ── the section panel: a 16/20 head with the title and its plain line, then dashed rows ── */
.scol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sform { display: contents; }
.sset { background: var(--panel-grad); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.sset__head { display: flex; flex-direction: column; gap: 3px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sset__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.sset__desc { font-size: 12.5px; color: var(--ink-3); text-wrap: pretty; }
.sset__foot { padding: 12px 20px; font-size: 12.5px; color: var(--ink-3); background: var(--panel-2); }
.sset--danger { border-color: color-mix(in oklab, var(--bad) 35%, var(--line)); }
.sset--danger .sset__title { color: var(--bad); }

/* ── one row: an optional icon tile, the label with its line, the control at the right ── */
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 24px; align-items: center; padding: 16px 20px; border-bottom: 1px dashed var(--line-2); }
.srow:has(.srow__icon) { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px 14px; }
.srow:last-child { border-bottom: 0; }
.srow__icon { width: 34px; height: 34px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); display: grid; place-items: center; }
.srow__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.srow__label { font-weight: 500; color: var(--ink); }
.srow__desc { font-size: 12.5px; color: var(--ink-3); text-wrap: pretty; }
.srow__ctl { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.srow__ctl > .input { width: 320px; height: 36px; border-radius: 10px; }
.srow__ctl > .srow__json { width: 320px; height: auto; min-height: 48px; padding: 8px 10px; resize: vertical; }
.srow__reset { color: var(--ink-3); }
.srow__test { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.srow__test .input { width: auto; min-width: 120px; }
.srow__test input[type="email"] { min-width: 200px; }

/* a value that is read, not typed: the mono box of the mockup's secret rows */
.sval { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); font: 12.5px/1 var(--mono); letter-spacing: .03em; color: var(--ink-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sval--url { display: inline-block; line-height: 34px; max-width: 320px; }
.sbrand__icon { position: relative; width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; border: 1px solid var(--line-2); background: var(--panel-2); flex: none; }
.sbrand__icon::before { content: ""; position: absolute; inset: 0; background: var(--panel-2); border-radius: inherit; }  /* a picture that does not load leaves its tile, never the broken-image icon */

/* ── the switch: 42 × 24, the knob slides, blue when on ── */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch input:disabled { cursor: not-allowed; }
.switch__track { position: absolute; inset: 0; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); transition: background-color .15s, border-color .15s; pointer-events: none; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); transition: left .15s, background-color .15s; }
.switch input:checked + .switch__track { background: var(--btn); border-color: var(--btn); }
.switch input:checked + .switch__track::after { left: 20px; background: #fff; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; }

/* ── the stepper: − · value with its unit · + ── */
.stepper { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); overflow: hidden; flex: none; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.stepper__btn { width: 34px; height: 100%; border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.stepper__btn:first-child { border-right: 1px solid var(--line-2); }
.stepper__btn:last-child { border-left: 1px solid var(--line-2); }
.stepper__btn:hover { background: var(--panel-2); color: var(--ink); }
.stepper__btn:disabled { color: var(--ink-3); background: none; cursor: not-allowed; }
.stepper__field { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 84px; height: 100%; padding: 0 8px; font: 500 13px/1 var(--mono); color: var(--ink); }
.stepper__input { width: 5ch; height: 100%; border: 0; background: none; padding: 0; text-align: right; font: inherit; color: inherit; outline: none; -moz-appearance: textfield; appearance: textfield; }
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:disabled { color: var(--ink-3); }
.stepper__input:last-child { text-align: center; }
.stepper__unit { color: var(--ink-3); font-size: 12px; }
.stepper.is-off { opacity: .7; }

/* ── marketplaces inside the Integrations row: logo · name · status ── */
.smk { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; }
.smk__row { display: inline-flex; align-items: center; gap: 7px; }
.smk__name { font-weight: 500; }

/* ── the sticky unsaved-changes bar: the count, Discard, Save ── */
.settings-page .savebar .btn { margin-left: 0; }
.savebar__text { color: var(--ink); font-weight: 500; }
.savebar__meta { font-size: 12px; }
.savebar__btns { margin-left: auto; display: inline-flex; gap: 8px; }

/* ── a phone: the sections list becomes a row that scrolls sideways; a row's control goes under its label ── */
@media (max-width: 760px) {
  .sgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .snav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; margin: 0 -4px; padding-left: 4px; scrollbar-width: none; }
  .snav::-webkit-scrollbar { display: none; }
  .srow, .srow:has(.srow__icon) { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; }
  .srow__icon { display: none; }
  .srow__ctl { justify-content: flex-start; }
  .srow__ctl > .input, .srow__ctl > .srow__json { width: 100%; }
  .sval--url { max-width: 100%; }
  .sset__head { padding: 14px 16px; }
  .sset__foot { padding: 10px 16px; }
  .smk { justify-content: flex-start; }
  .savebar { flex-wrap: wrap; }
  .savebar__meta { display: none; }
  .savebar__btns { margin-left: auto; }
}
