/* ============================================================
   SETTINGS
   Styles for the settings sheet: its sections, the segmented
   switch, the reset cards — and the theme list, which is the
   Appearance section's content.
   ============================================================ */

.sheet--settings .sheet-body {
  padding-bottom: calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
}

/* ── Sections ─────────────────────────────────────────────── */
.set-sec { padding: var(--s-4) var(--s-5) var(--s-2); }
.set-sec + .set-sec { border-top: var(--border-w) solid var(--rim); }

.set-title {
  margin-bottom: var(--s-3);
  font-size: 0.66rem;
  font-weight: var(--body-weight-strong);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

.set-hint {
  margin-top: var(--s-2);
  padding-bottom: var(--s-2);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-dimmer);
  max-width: 46ch;
}

/* ── Segmented switch ─────────────────────────────────────── */
.seg {
  --seg-i: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: var(--border-w) solid var(--rim);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.seg::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 16px) / 3);
  border-radius: calc(var(--r-md) - 3px);
  background: linear-gradient(135deg, var(--accent), var(--support));
  transform: translateX(calc(var(--seg-i) * (100% + 4px)));
  transition: transform var(--dur) var(--ease);
}
.seg-btn {
  position: relative;
  padding: 9px 0;
  font-size: 0.8rem;
  font-weight: var(--body-weight-strong);
  color: var(--text-dim);
  transition: color var(--dur-fast) ease;
}
.seg-btn.is-active { color: var(--on-accent); }

/* ── Cards (reset + account) ──────────────────────────────── */
.set-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  border: var(--border-w) solid var(--rim);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.set-card--row { flex-direction: row; align-items: center; gap: var(--s-3); }
.set-card--danger { border-color: color-mix(in srgb, var(--accent) 28%, var(--rim)); }
.set-card-text { flex: 1; min-width: 0; }
.set-card-name {
  font-size: 0.88rem;
  font-weight: var(--body-weight-strong);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-card-desc { font-size: 0.72rem; line-height: 1.5; color: var(--text-dimmer); }

.set-btn {
  flex: none;
  padding: 9px 16px;
  border: var(--border-w) solid var(--rim-strong);
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: var(--body-weight-strong);
}
.set-btn:hover { border-color: var(--accent); }
.set-btn:disabled { opacity: 0.55; pointer-events: none; }
.set-btn--block { width: 100%; margin-top: var(--s-1); padding: 11px 16px; }
.set-btn--danger {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.set-btn.is-armed {
  color: var(--on-accent);
  border-color: var(--accent);
  background: var(--accent);
  animation: armed 900ms ease-in-out infinite;
}
@keyframes armed {
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent); }
}

/* ── Theme list (Appearance section) ──────────────────────── */
.theme-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.theme-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  padding: var(--s-3);
  border: var(--border-w) solid var(--rim);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease);
}
.theme-row:hover { border-color: var(--rim-strong); transform: translateX(2px); }
.theme-row:active { transform: scale(0.985); }
.theme-row.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.theme-chip {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--rim-strong);
}

.theme-row-text { flex: 1; min-width: 0; display: block; }
.theme-row-name {
  display: block;
  font-size: 1.02rem;
  line-height: 1.15;
  color: var(--text);
  text-transform: uppercase;
}
.theme-row-blurb {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--text-dimmer);
  line-height: 1.35;
}

.theme-row-tick {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-2);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease);
}
.theme-row.is-active .theme-row-tick { opacity: 1; transform: scale(1); }

