/* ============================================================================
   ATLAS REDESIGN — Settings screen (W-F5S4 · bespoke). Tokens only; both
   themes swap automatically. Namespace .rd-settings / .rd-set-*.
   ========================================================================== */

.rd-settings { max-width: var(--r-page-max); }

.rd-set-head { margin-bottom: 18px; }
.rd-set-eyebrow {
  font-family: var(--r-font-mono); font-size: var(--r-fs-eyebrow);
  letter-spacing: 0.1em; color: var(--r-muted); margin-bottom: 6px;
}
.rd-set-h1 {
  margin: 0 0 6px; font-family: var(--r-font-display);
  font-size: var(--r-fs-h1); line-height: 1.1; color: var(--r-ink);
}
.rd-set-sub { margin: 0; font-size: var(--r-fs-body); color: var(--r-muted); max-width: 62ch; }

.rd-set-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .rd-set-grid { grid-template-columns: 1fr; } }
.rd-set-col { display: flex; flex-direction: column; gap: 16px; }

.rd-set-tile {
  background: var(--r-canvas-raised); border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card); padding: 18px 22px;
  box-shadow: var(--r-shadow-card);
  transition: box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-set-tile:hover {
  box-shadow: var(--r-shadow-hover);
  transform: translateY(-2px);
}
.rd-set-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.rd-set-card-title {
  margin: 0; font-family: var(--r-font-display);
  font-size: var(--r-fs-card-title); color: var(--r-ink);
}
.rd-set-card-note {
  font-family: var(--r-font-mono); font-size: 12px;
  letter-spacing: 0.05em; color: var(--r-muted);
}

/* appearance */
.rd-set-themes { display: flex; gap: 12px; }
.rd-set-theme {
  flex: 1 1 0; text-align: left; cursor: pointer;
  border: 1px solid var(--r-border); border-radius: var(--r-radius-card);
  background: var(--r-canvas); color: var(--r-ink); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color var(--r-dur) var(--r-ease);
}
.rd-set-theme:hover { border-color: var(--r-primary); }
.rd-set-theme.is-active {
  border-color: var(--r-primary);
  box-shadow: 0 0 0 1px var(--r-primary);
}
.rd-set-theme:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-set-theme-name { font-weight: 600; font-size: 14.5px; }
.rd-set-theme-sub { font-size: 12px; color: var(--r-muted); }

/* rows (identity + prefs) */
.rd-set-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 8px; border-bottom: 1px solid var(--r-hairline-2);
  border-radius: 8px;
  transition: background var(--r-dur) var(--r-ease);
}
.rd-set-row:hover { background: var(--r-well); }
.rd-set-row:last-of-type { border-bottom: 0; }
.rd-set-lab { flex: 1 1 auto; font-size: 13px; color: var(--r-body); }
.rd-set-what { display: block; font-size: 12px; color: var(--r-muted); }
.rd-set-val { font-family: var(--r-font-mono); font-size: 12.5px; color: var(--r-ink); }

.rd-set-reset {
  border: 1px solid var(--r-border); background: transparent; color: var(--r-muted);
  border-radius: var(--r-radius-badge); font-size: 12px; padding: 3px 10px;
  cursor: pointer; min-width: 84px;
}
.rd-set-reset:hover { border-color: var(--r-alert); color: var(--r-alert); }
.rd-set-reset[data-armed="1"] { border-color: var(--r-alert); color: var(--r-alert); }
.rd-set-reset:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-set-reset-spacer { min-width: 84px; display: inline-block; }

/* integrations */
.rd-set-svc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rd-set-overall {
  font-family: var(--r-font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 2px 9px; border-radius: var(--r-radius-badge);
  border: 1px solid var(--r-border);
}
.rd-set-overall[data-tone="good"] {
  color: var(--r-good);
  border-color: color-mix(in srgb, var(--r-good) 35%, var(--r-border));
  background: color-mix(in srgb, var(--r-good) 10%, transparent);
}
.rd-set-overall[data-tone="warn"] {
  color: var(--r-amber);
  border-color: color-mix(in srgb, var(--r-amber) 35%, var(--r-border));
  background: color-mix(in srgb, var(--r-amber) 10%, transparent);
}
.rd-set-overall[data-tone="alert"] {
  color: var(--r-alert);
  border-color: color-mix(in srgb, var(--r-alert) 35%, var(--r-border));
  background: color-mix(in srgb, var(--r-alert) 10%, transparent);
}
.rd-set-freshness { font-family: var(--r-font-mono); font-size: 12px; color: var(--r-muted); }

.rd-set-svc {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-bottom: 1px solid var(--r-hairline-2);
  border-radius: 8px;
  transition: background var(--r-dur) var(--r-ease);
}
.rd-set-svc:hover { background: var(--r-well); }
.rd-set-svc:last-child { border-bottom: 0; }
.rd-set-svc-dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--r-faint);
}
.rd-set-svc-dot[data-tone="good"] {
  background: var(--r-good);
  animation: rdSetPulse 2.4s infinite;
}
.rd-set-svc-dot[data-tone="warn"]  { background: var(--r-amber); }
.rd-set-svc-dot[data-tone="alert"] { background: var(--r-alert); }
@keyframes rdSetPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--r-good) 45%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--r-good) 0%, transparent); }
}
.rd-set-svc-name { flex: 0 0 auto; font-size: 13px; color: var(--r-ink); min-width: 110px; }
.rd-set-svc-detail { font-size: 12px; color: var(--r-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rd-set-hint { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--r-muted); }
.rd-set-empty { margin: 0; font-size: 13px; color: var(--r-muted); }

/* ---- entrance motion (one-shot; off under reduced motion) ---------------- */
.rd-set-tile { animation: rdSetIn .38s var(--r-ease) both; }
.rd-set-col:nth-child(2) .rd-set-tile:nth-child(2) { animation-delay: .05s; }
@keyframes rdSetIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-set-tile { animation: none; }
  .rd-set-tile:hover { transform: none; }
  .rd-set-svc-dot[data-tone="good"] { animation: none; }
}

/* ---- focus visibility ------------------------------------------------------ */
.rd-settings :focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- responsive ------------------------------------------------------------ */
@media (max-width: 480px) {
  .rd-set-themes { flex-direction: column; }
  .rd-set-row { flex-wrap: wrap; row-gap: 6px; }
  .rd-set-row .rd-set-lab { flex: 1 1 100%; }
  .rd-set-svc-name { min-width: 84px; }
}

/* ── Brand logos card (S8 2026-07-04) ─────────────────────────────────── */
.rd-set-brandslot {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--r-line);
}
.rd-set-brandslot:last-of-type { border-bottom: 0; }
.rd-set-brandprev {
  height: 52px;
  border-radius: 8px;
  border: 1px solid var(--r-line);
  display: grid;
  place-items: center;
  padding: 8px;
}
.rd-set-brandprev[data-tone="light"] { background: var(--r-surface); }
.rd-set-brandprev[data-tone="dark"] { background: var(--r-ink); }
.rd-set-brandprev img { max-height: 34px; max-width: 112px; display: block; }
.rd-set-brandacts { display: flex; gap: 8px; align-items: center; }
.rd-set-upl {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--r-line);
  background: var(--r-surface-2);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.rd-set-upl:hover { border-color: var(--r-primary); color: var(--r-primary); }
@media (max-width: 640px) {
  .rd-set-brandslot { grid-template-columns: 1fr; }
}

/* ── S11: Navigation card — accordion switch ──────────────────────────────── */
.rd-set-switch {
  width: 40px; height: 22px; border-radius: 999px; flex: none;
  border: 1px solid var(--r-border); background: var(--r-faint);
  position: relative; cursor: pointer; padding: 0; margin-left: auto;
  transition: background var(--r-dur) var(--r-ease), border-color var(--r-dur) var(--r-ease);
  align-self: center;
}
.rd-set-switch .rd-set-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--r-surface);
  border: 1px solid var(--r-border);
  transition: left var(--r-dur) var(--r-ease);
}
.rd-set-switch.is-on { background: var(--r-primary); border-color: var(--r-primary); }
.rd-set-switch.is-on .rd-set-knob { left: 20px; border-color: var(--r-primary); }
.rd-set-switch:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
