/* Settings — API keys & deployment (Nexus-style) */

.page-content--settings {
  padding: 0 !important;
  overflow-y: auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(75, 142, 255, 0.08), transparent),
    var(--ds-bg);
}

.st-view {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--ds-page-pad);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Header ── */
.st-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.st-head__main h1 {
  margin: 0;
  font-size: var(--ds-text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ds-text);
}

.st-head__sub {
  margin: 0.5rem 0 0;
  max-width: 520px;
  font-size: var(--ds-text-base);
  line-height: 1.55;
  color: var(--ds-text-secondary);
}

.st-head__sub strong {
  color: var(--ds-text);
  font-weight: 600;
}

.st-head__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.st-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: var(--ds-text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--ds-border-subtle);
  background: rgba(28, 32, 40, 0.6);
  color: var(--ds-text-secondary);
}

.st-chip .material-symbols-outlined {
  font-size: 14px;
  color: var(--ds-primary);
}

.st-chip--live {
  border-color: rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.08);
  color: var(--ds-ok);
}

.st-chip--live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ds-ok);
  box-shadow: 0 0 8px var(--ds-ok);
}

/* ── Stats ── */
.st-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--ds-gutter);
}

.st-stat {
  padding: 1rem 1.15rem;
  border-radius: var(--ds-radius-lg);
  background: rgba(22, 27, 34, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid var(--ds-border-subtle);
  transition: border-color 0.2s;
}

.st-stat:hover {
  border-color: rgba(75, 142, 255, 0.25);
}

.st-stat__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: var(--ds-text-xs);
  font-weight: 500;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.st-stat__label .material-symbols-outlined {
  font-size: 16px;
  color: var(--ds-text-muted);
  opacity: 0.7;
}

.st-stat__value {
  font-size: var(--ds-text-md);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ds-text);
  font-variant-numeric: tabular-nums;
}

.st-stat__value--mono {
  font-family: var(--ds-mono);
  font-size: var(--ds-text-sm);
  font-weight: 500;
  color: var(--ds-primary);
  word-break: break-all;
}

/* ── Section nav ── */
.st-nav {
  display: flex;
  gap: 0.35rem;
  padding: 4px;
  background: var(--ds-surface-low);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.st-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: calc(var(--ds-radius-lg) - 4px);
  background: transparent;
  color: var(--ds-text-muted);
  font: inherit;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.st-nav__btn .material-symbols-outlined {
  font-size: 18px;
}

.st-nav__btn:hover {
  color: var(--ds-text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.st-nav__btn.active {
  background: var(--ds-primary-strong);
  color: #002e69;
  box-shadow: 0 2px 8px rgba(75, 142, 255, 0.25);
}

/* ── Panels ── */
.st-panels {
  display: flex;
  flex-direction: column;
  gap: var(--ds-gutter);
}

.st-panel {
  display: none;
  animation: st-fade-in 0.2s ease;
}

.st-panel.active {
  display: block;
}

@keyframes st-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.st-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-gutter);
  align-items: start;
}

.st-grid--single {
  grid-template-columns: 1fr;
  max-width: 720px;
}

/* ── Glass cards ── */
.st-card {
  background: rgba(22, 27, 34, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  overflow: hidden;
}

.st-card--accent {
  border-color: rgba(75, 142, 255, 0.3);
  box-shadow:
    0 0 0 1px rgba(75, 142, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

.st-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--ds-border-subtle);
  background: rgba(16, 19, 27, 0.5);
}

.st-card__title {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.st-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ds-radius);
  background: var(--ds-primary-muted);
  border: 1px solid rgba(75, 142, 255, 0.2);
  flex-shrink: 0;
}

.st-card__icon .material-symbols-outlined {
  font-size: 20px;
  color: var(--ds-primary);
}

.st-card__icon--agent {
  background: rgba(20, 209, 255, 0.1);
  border-color: rgba(20, 209, 255, 0.25);
}

.st-card__icon--agent .material-symbols-outlined {
  color: #4cd6ff;
}

.st-card__title h2 {
  margin: 0;
  font-size: var(--ds-text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.st-card__title p {
  margin: 0.3rem 0 0;
  font-size: var(--ds-text-sm);
  line-height: 1.45;
  color: var(--ds-text-muted);
  max-width: 420px;
}

.st-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(110, 231, 183, 0.12);
  color: var(--ds-ok);
  border: 1px solid rgba(110, 231, 183, 0.25);
  flex-shrink: 0;
}

.st-card__body {
  padding: 1.35rem;
}

/* ── Key field ── */
.st-key-wrap {
  margin-bottom: 1rem;
}

.st-key-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-family: var(--ds-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.st-key-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border);
  background: var(--ds-bg);
  overflow: hidden;
}

.st-key-field code {
  flex: 1;
  padding: 0.85rem 1rem;
  font-family: var(--ds-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ds-primary);
  word-break: break-all;
  align-self: center;
}

.st-key-actions {
  display: flex;
  align-items: center;
  gap: 0;
  border-left: 1px solid var(--ds-border-subtle);
  background: var(--ds-surface-low);
  padding: 0.25rem;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: none;
  border-radius: calc(var(--ds-radius-sm));
  background: transparent;
  color: var(--ds-text-secondary);
  font: inherit;
  font-size: var(--ds-text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.st-btn .material-symbols-outlined {
  font-size: 16px;
}

.st-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ds-text);
}

.st-btn--primary {
  background: var(--ds-primary-muted);
  color: var(--ds-primary);
}

.st-btn--primary:hover {
  background: rgba(75, 142, 255, 0.22);
}

.st-btn--danger:hover {
  color: var(--ds-err);
  background: rgba(248, 113, 113, 0.1);
}

.st-btn--icon {
  padding: 0.45rem;
  min-width: 36px;
}

.st-meta {
  margin: 0;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: 1.5;
}

.st-meta code {
  font-family: var(--ds-mono);
  color: var(--ds-text-secondary);
}

/* ── Workspace pill ── */
.st-workspace {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--ds-radius);
  background: var(--ds-bg);
  border: 1px solid var(--ds-border-subtle);
}

.st-workspace__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--ds-radius-sm);
  background: rgba(20, 209, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.st-workspace__icon .material-symbols-outlined {
  font-size: 18px;
  color: #4cd6ff;
}

.st-workspace__info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.st-workspace__info strong {
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text);
}

.st-workspace__slug {
  font-family: var(--ds-mono);
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

/* ── Code blocks ── */
.st-snippet {
  margin-top: 1.15rem;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border-subtle);
  overflow: hidden;
  background: var(--ds-bg);
}

.st-snippet__tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0 0.75rem;
  background: var(--ds-surface-high);
  border-bottom: 1px solid var(--ds-border-subtle);
}

.st-snippet__tablist {
  display: flex;
  gap: 0.15rem;
}

.st-snippet__tab {
  padding: 0.5rem 0.65rem;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--ds-text-xs);
  font-weight: 600;
  color: var(--ds-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.st-snippet__tab:hover { color: var(--ds-text-secondary); }

.st-snippet__tab.active {
  color: var(--ds-primary);
  border-bottom-color: var(--ds-primary-strong);
}

.st-snippet__copy {
  border: none;
  background: none;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: var(--ds-text-xs);
  font-weight: 600;
  color: var(--ds-primary);
  cursor: pointer;
}

.st-snippet__copy:hover { text-decoration: underline; }

.st-snippet pre {
  margin: 0;
  padding: 1rem;
  font-family: var(--ds-mono);
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--ds-text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.st-snippet-pane { display: none; }
.st-snippet-pane.active { display: block; }

/* ── KV list ── */
.st-kv {
  display: flex;
  flex-direction: column;
}

.st-kv__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ds-border-subtle);
  font-size: var(--ds-text-sm);
}

.st-kv__row:last-child { border-bottom: none; }

.st-kv__row > span:first-child {
  color: var(--ds-text-muted);
  font-weight: 500;
}

.st-kv__row code {
  font-family: var(--ds-mono);
  font-size: 0.75rem;
  color: var(--ds-text);
  text-align: right;
}

.st-kv__copy {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
  max-width: 70%;
}

.st-kv__copy code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-kv__row--copy {
  align-items: flex-start;
}

.st-role {
  display: inline-flex;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: var(--ds-text-xs);
  font-weight: 600;
  text-transform: capitalize;
  background: var(--ds-surface-high);
  color: var(--ds-text-secondary);
  border: 1px solid var(--ds-border-subtle);
}

/* ── Downloads ── */
.st-downloads {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.st-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border-subtle);
  background: var(--ds-bg);
  transition: border-color 0.15s;
}

.st-download:hover {
  border-color: rgba(75, 142, 255, 0.3);
}

.st-download__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.st-download__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-primary-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.st-download__icon .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-primary);
}

.st-download__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text);
}

.st-download__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ds-primary-strong);
  background: var(--ds-primary-muted);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.st-download-gates {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.st-download-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
  background: rgba(255, 255, 255, 0.02);
}

.st-download-gate__name {
  font-weight: 600;
  color: var(--ds-text);
}

.st-download-gate__meta {
  margin-top: 0.2rem;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.st-download-gates__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.st-gate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.st-gate-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.st-gate-toggle__track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease;
}

.st-gate-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.st-gate-toggle input:checked + .st-gate-toggle__track {
  background: var(--ds-primary-strong);
}

.st-gate-toggle input:checked + .st-gate-toggle__track .st-gate-toggle__thumb {
  transform: translateX(18px);
}

.st-gate-toggle input:focus-visible + .st-gate-toggle__track {
  box-shadow: 0 0 0 2px var(--ds-primary-muted);
}

.st-gate-toggle__label {
  min-width: 4.5rem;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
}

.st-download__size {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.st-download__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.st-download-curl {
  display: none;
}

.st-hint {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--ds-radius);
  font-size: var(--ds-text-xs);
  line-height: 1.55;
  color: var(--ds-text-muted);
  background: rgba(75, 142, 255, 0.06);
  border: 1px solid rgba(75, 142, 255, 0.12);
}

.st-hint strong {
  color: var(--ds-text-secondary);
  font-weight: 600;
}

/* ── Password form ── */
.st-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
}

.st-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.st-field label {
  font-size: var(--ds-text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.st-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.st-input {
  width: 100%;
  padding: 0.7rem 2.75rem 0.7rem 0.85rem;
  font: inherit;
  font-size: var(--ds-text-sm);
  color: var(--ds-text);
  background: var(--ds-bg);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.st-input::placeholder {
  color: var(--ds-text-muted);
}

.st-input:hover {
  border-color: rgba(75, 142, 255, 0.35);
}

.st-input:focus {
  border-color: var(--ds-primary-strong);
  box-shadow: 0 0 0 2px var(--ds-primary-muted);
}

.st-input-toggle {
  position: absolute;
  right: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.st-input-toggle:hover {
  color: var(--ds-text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.st-input-toggle .material-symbols-outlined {
  font-size: 18px;
}

.st-field__hint {
  margin: 0;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.st-form__error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--ds-radius);
  font-size: var(--ds-text-sm);
  color: var(--ds-err);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.st-form__actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.st-btn--submit {
  padding: 0.6rem 1.15rem;
  background: var(--ds-primary-strong);
  color: #002e69;
  font-size: var(--ds-text-sm);
  font-weight: 700;
  border-radius: var(--ds-radius);
}

.st-btn--submit:hover:not(:disabled) {
  background: #5a97ff;
  color: #002e69;
}

.st-btn--submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.st-btn--loading {
  pointer-events: none;
}

.st-security-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.st-security-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.st-security-list .material-symbols-outlined {
  font-size: 20px;
  color: var(--ds-ok);
  flex-shrink: 0;
  margin-top: 2px;
}

.st-security-list strong {
  display: block;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text);
  margin-bottom: 0.2rem;
}

.st-security-list p {
  margin: 0;
  font-size: var(--ds-text-sm);
  line-height: 1.5;
  color: var(--ds-text-muted);
}

.st-steps {
  margin: 1.15rem 0 0;
  padding-left: 1.25rem;
  font-size: var(--ds-text-sm);
  line-height: 1.6;
  color: var(--ds-text-secondary);
}

.st-steps li + li {
  margin-top: 0.45rem;
}

.st-steps code {
  font-family: var(--ds-mono);
  font-size: var(--ds-text-xs);
  color: var(--ds-primary);
}

.st-advanced {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ds-border-subtle);
}

.st-advanced summary {
  cursor: pointer;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text-muted);
  user-select: none;
}

.st-advanced summary:hover {
  color: var(--ds-text-secondary);
}

.st-muted {
  margin: 0.65rem 0 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  line-height: 1.5;
}

.st-empty {
  margin: 0;
  padding: 2rem;
  text-align: center;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}

/* ── Quick script picker ── */
.st-quick-meta {
  margin: 0 0 0.85rem;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.st-quick-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.st-quick-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border-subtle);
  background: var(--ds-bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.st-quick-item:hover:not(.is-locked) {
  border-color: rgba(75, 142, 255, 0.35);
}

.st-quick-item.is-selected {
  border-color: rgba(75, 142, 255, 0.45);
  background: rgba(75, 142, 255, 0.08);
}

.st-quick-item.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.st-quick-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ds-primary-strong);
  flex-shrink: 0;
}

.st-quick-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.st-quick-item__body strong {
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text);
}

.st-quick-item__body span {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: 1.45;
}

.st-quick-item__slot {
  flex-shrink: 0;
  min-width: 1.75rem;
  text-align: center;
  font-size: var(--ds-text-xs);
  font-weight: 700;
  color: var(--ds-primary);
}

/* Data retention */
.st-retention-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ds-gutter);
  align-items: start;
}

.st-retention-card__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.st-form--retention {
  max-width: none;
  gap: 0.5rem;
}

.st-form--retention select.st-input {
  padding-right: 0.85rem;
  appearance: auto;
}

.st-retention-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.st-retention-controls .st-field {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}

.st-retention-controls .st-btn--submit {
  flex: 0 0 auto;
  margin-bottom: 1px;
}

.st-retention-controls__hint {
  margin: 0;
}

.st-retention-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.st-retention-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
  min-width: 0;
}

.st-retention-stat__value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.st-retention-stat__label {
  font-size: 11px;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.st-retention-purge {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ds-border-subtle);
}

.st-retention-purge__head h3 {
  margin: 0 0 6px;
  font-size: var(--ds-text-md);
  font-weight: 600;
}

.st-retention-purge__head p {
  margin: 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  line-height: 1.45;
}

.st-retention-purge__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius);
}

.st-retention-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
}

.st-retention-check input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ds-primary);
  cursor: pointer;
}

.st-retention-check__text {
  font-size: var(--ds-text-sm);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ds-text-secondary);
  white-space: nowrap;
}

.st-retention-purge__toolbar .st-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  font-size: var(--ds-text-xs);
}

.st-retention-backup {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.st-retention-backup__hint {
  margin: 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-secondary);
  line-height: 1.5;
}

.st-btn--outline {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ds-text);
  font-size: var(--ds-text-sm);
}

.st-btn--outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(75, 142, 255, 0.35);
  color: var(--ds-text);
}

.st-btn--outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.st-btn--outline-danger {
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

.st-btn--outline-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

@media (max-width: 900px) {
  .st-retention-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .st-retention-stats {
    grid-template-columns: 1fr;
  }

  .st-retention-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .st-retention-controls .st-btn--submit {
    width: 100%;
    justify-content: center;
  }

  .st-retention-purge__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .st-retention-check__text {
    white-space: normal;
  }

  .st-retention-purge__toolbar .st-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .st-stats { grid-template-columns: repeat(2, 1fr); }
  .st-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .st-view { padding: 1rem; gap: 1.25rem; }
  .st-head { flex-direction: column; align-items: flex-start; }
  .st-stats { grid-template-columns: 1fr 1fr; }
  .st-key-field { flex-direction: column; }
  .st-key-actions {
    border-left: none;
    border-top: 1px solid var(--ds-border-subtle);
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .st-download { flex-direction: column; align-items: stretch; }
  .st-download__actions { justify-content: flex-end; }
  .st-nav { width: 100%; }
}

/* ── Onboarding playbook ── */
.st-ob-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: var(--ds-gutter);
  align-items: start;
}

.st-ob-layout--off .st-ob-main {
  opacity: 0.78;
}

.st-ob-head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.st-ob-steps-badge {
  background: rgba(75, 142, 255, 0.12);
  color: #93c5fd;
  border-color: rgba(75, 142, 255, 0.28);
}

.st-ob-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.st-ob-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.st-ob-step {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.st-ob-step__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.85rem;
}

.st-ob-step__node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.st-ob-step__node--blue { color: #93c5fd; background: rgba(75, 142, 255, 0.14); border-color: rgba(75, 142, 255, 0.35); }
.st-ob-step__node--amber { color: #fcd34d; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.32); }
.st-ob-step__node--violet { color: #c4b5fd; background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.32); }
.st-ob-step__node--rose { color: #fda4af; background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.28); }
.st-ob-step__node--cyan { color: #67e8f9; background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.28); }
.st-ob-step__node--green { color: #6ee7b7; background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.32); }

.st-ob-step__line {
  flex: 1;
  width: 2px;
  min-height: 1.5rem;
  margin: 0.4rem 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.st-ob-step__card {
  margin-bottom: 1rem;
  border: 1px solid var(--ds-border-subtle);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  border-left-width: 3px;
}

.st-ob-step__card--blue { border-left-color: rgba(75, 142, 255, 0.55); }
.st-ob-step__card--amber { border-left-color: rgba(251, 191, 36, 0.55); }
.st-ob-step__card--violet { border-left-color: rgba(167, 139, 250, 0.55); }
.st-ob-step__card--rose { border-left-color: rgba(244, 63, 94, 0.5); }
.st-ob-step__card--cyan { border-left-color: rgba(34, 211, 238, 0.5); }
.st-ob-step__card--green { border-left-color: rgba(52, 211, 153, 0.55); }

.st-ob-step__card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.st-ob-step__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.025);
}

.st-ob-step__identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.st-ob-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.st-ob-step__icon .material-symbols-outlined {
  font-size: 18px;
}

.st-ob-step__icon--blue { color: #93c5fd; background: rgba(75, 142, 255, 0.12); border-color: rgba(75, 142, 255, 0.22); }
.st-ob-step__icon--amber { color: #fcd34d; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.22); }
.st-ob-step__icon--violet { color: #c4b5fd; background: rgba(167, 139, 250, 0.1); border-color: rgba(167, 139, 250, 0.22); }
.st-ob-step__icon--rose { color: #fda4af; background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.2); }
.st-ob-step__icon--cyan { color: #67e8f9; background: rgba(34, 211, 238, 0.1); border-color: rgba(34, 211, 238, 0.2); }
.st-ob-step__icon--green { color: #6ee7b7; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.22); }

.st-ob-label-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ds-text);
  font: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.st-ob-label-input:hover,
.st-ob-label-input:focus {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.st-ob-type-select {
  flex-shrink: 0;
  min-width: 8.5rem;
  max-width: 10.5rem;
  height: 34px;
  padding: 0 1.75rem 0 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
  color: var(--ds-text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.st-ob-type-select:hover {
  border-color: rgba(75, 142, 255, 0.28);
}

.st-ob-type-select:focus {
  outline: none;
  border-color: var(--ds-primary-strong);
  box-shadow: 0 0 0 2px var(--ds-primary-muted);
}

.st-ob-step__actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
  margin-left: auto;
}

.st-ob-step__body {
  padding: 1rem 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.1);
}

.st-ob-control {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: var(--ds-text-sm);
  color: var(--ds-text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.st-ob-control::placeholder {
  color: var(--ds-text-muted);
}

.st-ob-control:hover {
  border-color: rgba(75, 142, 255, 0.28);
  background: rgba(0, 0, 0, 0.34);
}

.st-ob-control:focus {
  border-color: var(--ds-primary-strong);
  box-shadow: 0 0 0 2px var(--ds-primary-muted);
  background: rgba(0, 0, 0, 0.34);
}

.st-ob-control--select {
  padding-right: 2rem;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.st-ob-control--textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.45;
}

.st-ob-control--short {
  width: 5rem;
  flex: 0 0 auto;
}

.st-ob-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.st-ob-field__label {
  font-size: var(--ds-text-sm);
  font-weight: 500;
  color: var(--ds-text-secondary);
  letter-spacing: 0;
  text-transform: none;
}

.st-ob-field__inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.st-ob-field__suffix {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  white-space: nowrap;
}

.st-ob-field__hint {
  margin: 0.15rem 0 0;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
}

.st-ob-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--ds-border-subtle);
}

.st-ob-toggles--only {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.st-ob-fields {
  display: grid;
  gap: 0.85rem;
}

.st-ob-fields--split {
  grid-template-columns: 1fr minmax(7rem, 9rem);
  align-items: start;
}

.st-ob-field--wide {
  grid-column: 1;
}

.st-ob-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}

.st-ob-switch:hover {
  border-color: rgba(75, 142, 255, 0.22);
  background: rgba(75, 142, 255, 0.04);
}

.st-ob-switch__copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.st-ob-switch__title {
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text);
  line-height: 1.35;
}

.st-ob-switch__hint {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: 1.45;
}

.st-ob-switch__control {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.st-ob-switch__control input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.st-ob-switch__track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.st-ob-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease;
}

.st-ob-switch__control input:checked + .st-ob-switch__track {
  background: var(--ds-primary-strong);
  border-color: rgba(75, 142, 255, 0.45);
}

.st-ob-switch__control input:checked + .st-ob-switch__track .st-ob-switch__thumb {
  transform: translateX(18px);
}

.st-ob-switch__control input:focus-visible + .st-ob-switch__track {
  box-shadow: 0 0 0 2px var(--ds-primary-muted);
}

.st-ob-switch__state {
  min-width: 1.75rem;
  font-size: var(--ds-text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.st-ob-switch__control input:checked ~ .st-ob-switch__state {
  color: #93c5fd;
}

.st-ob-note {
  display: flex;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(75, 142, 255, 0.06);
  border: 1px solid rgba(75, 142, 255, 0.12);
}

.st-ob-note .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-primary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.st-ob-note p {
  margin: 0;
  font-size: var(--ds-text-sm);
  line-height: 1.5;
  color: var(--ds-text-secondary);
}

.st-ob-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 2.75rem 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  color: var(--ds-text-secondary);
}

.st-ob-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.25rem;
  border-radius: 12px;
  background: rgba(75, 142, 255, 0.08);
  border: 1px solid rgba(75, 142, 255, 0.16);
}

.st-ob-empty__icon .material-symbols-outlined {
  font-size: 28px;
  color: var(--ds-primary);
}

.st-ob-empty strong {
  font-size: var(--ds-text-base);
  color: var(--ds-text);
}

.st-ob-empty p {
  margin: 0;
  max-width: 24rem;
  font-size: var(--ds-text-sm);
  line-height: 1.55;
}

.st-ob-add-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  margin-bottom: 0.5rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, background 0.15s;
}

.st-ob-add-bar:hover {
  border-color: rgba(75, 142, 255, 0.28);
  background: rgba(75, 142, 255, 0.04);
}

.st-ob-add-bar__label {
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text-secondary);
  white-space: nowrap;
}

.st-ob-add__select {
  min-width: 10rem;
  max-width: 14rem;
  flex: 1 1 10rem;
}

.st-ob-step--add {
  align-items: center;
}

.st-ob-step--add .st-ob-step__rail {
  padding-top: 0;
}

.st-ob-step__node--add {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--ds-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.16);
}

.st-ob-step__node--add .material-symbols-outlined {
  font-size: 16px;
}

.st-ob-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--ds-border-subtle);
}

.st-ob-toolbar__hint {
  margin: 0;
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}

.st-ob-aside .st-card__title h2 {
  font-size: var(--ds-text-sm);
}

.st-ob-aside .st-card__title p {
  max-width: none;
}

.st-ob-tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.st-ob-tips-list li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: var(--ds-text-sm);
  line-height: 1.5;
  color: var(--ds-text-secondary);
}

.st-ob-tips-list li > .material-symbols-outlined {
  font-size: 18px;
  color: var(--ds-primary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.st-ob-tips-list code {
  font-family: var(--ds-mono);
  font-size: 0.78rem;
  color: var(--ds-text);
}

.st-input--textarea {
  min-height: 4.5rem;
  resize: vertical;
}

@media (max-width: 960px) {
  .st-ob-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .st-ob-main .st-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .st-ob-head-actions {
    justify-content: space-between;
  }

  .st-ob-step {
    grid-template-columns: 1.75rem 1fr;
  }

  .st-ob-step__head {
    flex-wrap: wrap;
  }

  .st-ob-type-select {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .st-ob-step__actions {
    margin-left: 0;
  }

  .st-ob-fields--split {
    grid-template-columns: 1fr;
  }

  .st-ob-add-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .st-ob-add__select {
    max-width: none;
  }

  .st-ob-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .st-ob-toolbar .st-btn--submit {
    width: 100%;
    justify-content: center;
  }

  .st-ob-switch {
    flex-direction: column;
    align-items: stretch;
  }

  .st-ob-switch__control {
    justify-content: space-between;
  }
}
