/* Settings page (sandbox-style two-column layout, embedded inline). */

.settings-page {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem 2rem;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--fs-body, 14px);
  line-height: 1.55;
  color: var(--text);
}

.settings-page-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-page-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.settings-page-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow, 11px);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.settings-page-title {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.set-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-surface);
  min-height: 540px;
}
.set-side {
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg-sunken);
}
.set-tab {
  padding: 7px 10px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
}
.set-tab:hover { background: var(--bg-raised); color: var(--text); }
.set-tab.is-active {
  background: var(--bg-surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow);
}
.set-tab-icon {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  flex-shrink: 0;
}
.set-tab.is-active .set-tab-icon { color: var(--accent); }

.set-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  overflow-y: auto;
  background: var(--bg-surface);
}

/* sandbox-style section/row primitives — opt-in via .set-section / .set-row.
   We keep the existing `.settings-card`, `.settings-section`, `.settings-toggle`
   classes for the still-modal-styled tab content; new tabs can adopt these. */
.set-section { display: flex; flex-direction: column; gap: 0.625rem; }
.set-section-h {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.set-section-d {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.set-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.set-row:first-of-type { border-top: 0; padding-top: 0; }
.set-row-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.set-row-help {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.5;
}
.chip-row { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip {
  padding: 4px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.switch {
  width: 32px;
  height: 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.switch.is-on { background: var(--accent); border-color: var(--accent); }
.switch.is-on::after { transform: translateX(13px); background: #fff; }

.field-input,
.field-select {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 0.4375rem 0.625rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
.field-input.mono { font-family: var(--font-mono); }
.field-input:focus,
.field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-input::placeholder { color: var(--text-muted); }
.field-help { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.field-status { font-size: 11.5px; color: var(--text-muted); margin-left: 8px; min-height: 1em; }
.field-status.is-err { color: var(--err); }
.field-status.is-ok { color: var(--ok); }

.flash {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.flash-err {
  background: var(--tint-red);
  color: var(--tint-red-ink);
  border: 1px solid var(--tint-red-ink);
}
.flash-ok {
  background: var(--tint-green);
  color: var(--tint-green-ink);
  border: 1px solid var(--tint-green-ink);
}

/* When a Settings tab content lives inside .set-body, its inner cards no longer
   need their own border/padding (the .set-grid frame already provides them). */
.set-body .settings-tab-content { padding: 0; }
.set-body .settings-tab-content.active { display: flex; flex-direction: column; gap: 1.25rem; }

@media (max-width: 720px) {
  .set-grid { grid-template-columns: 1fr; }
  .set-side {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
  }
  .set-tab { white-space: nowrap; }
}
