/* Settings page. Pickers (.av-*, .vc-*) are styled in onboarding.css. */

.set { position: relative; overflow-x: clip; }
.set::before { /* one quiet shape behind the heading */
  content: ""; position: absolute; z-index: -1; top: -40px; right: -80px; width: 340px; height: 300px;
  background: var(--lav); opacity: .55; border-radius: 58% 42% 55% 45% / 48% 60% 40% 52%;
}
.set .page__head em { font-style: italic; color: var(--coral-ink); }

/* In-page section links. */
.set-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: clamp(24px, 4vw, 40px); }
.set-toc a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.set-toc a:hover { background: var(--lav); color: var(--ink); }
@media (pointer: coarse) { .set-toc a { min-height: 44px; } }

/* Sections: heading column beside the controls, a hairline between. */
.set-form { display: grid; }
.set-sec {
  display: grid; gap: var(--s-5);
  padding-block: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--s-5);
}
@media (min-width: 980px) {
  .set-sec { grid-template-columns: minmax(220px, 4fr) 8fr; gap: clamp(32px, 5vw, 72px); }
  .set-sec__head { position: sticky; top: var(--s-6); align-self: start; }
}
.set-sec__head { display: grid; gap: var(--s-2); max-width: 36ch; }
.set-sec__body { min-width: 0; }

.set-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s-3); }
.set-fieldset > legend { padding: 0; margin-bottom: var(--s-3); }
.set-name-field { max-width: 380px; }
.set-show-all { justify-self: start; }
.set-error { color: var(--err); font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }

/* Personalization */
.set-q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s-3); }
.set-q__text { padding: 0; margin-bottom: var(--s-2); font-weight: 600; }
.set-q .seg { justify-self: start; }

/* Memory */
.set-memory {
  display: grid; gap: var(--s-3); padding: var(--s-5); border-radius: var(--r-l);
  background: var(--surface); border: 1px solid var(--line);
}
.set-memory[data-state="unavailable"], .set-memory[data-state="error"] { background: var(--bg-2); border-color: transparent; }
.set-memory[data-state="unavailable"] .switch { color: var(--muted); cursor: not-allowed; }
.set-memory__actions { margin-top: var(--s-2); }
.set-notes { display: grid; gap: var(--s-2); color: var(--ink-2); }
.set-notes li { position: relative; padding-left: 20px; }
.set-notes li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px;
  border-radius: 50%; background: var(--lav-2);
}
.set-notes strong { color: var(--ink); font-weight: 600; }

.set-danger { --btn-fg: var(--err); }
.set-danger.btn--ghost { --btn-bd: rgba(207,63,63,.35); }
.set-danger.btn--ghost:hover { --btn-bd: var(--err); --btn-bg: #FDF1F1; }
.set-danger-fill { --btn-bg: var(--err); --btn-bd: var(--err); --btn-fg: #fff; }
.set-danger-fill:hover { --btn-bg: #B53434; box-shadow: 0 8px 24px rgba(207,63,63,.25); }

/* Voice & interaction */
.set-perm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); max-width: 520px; padding: var(--s-4) var(--s-5); border-radius: var(--r-l); background: var(--bg-2); }
.set-perm__label { font-weight: 600; }
.set-open { justify-self: start; align-self: start; }

/* Account */
.set-email { display: grid; gap: var(--s-1); }
.set-forget { display: grid; gap: var(--s-2); justify-items: start; padding-top: var(--s-4); border-top: 1px dashed var(--line); }

/* Floating save bar: fixed so it clears the mobile bottom bar too. */
.set-savebar {
  position: fixed; z-index: var(--z-panel); left: 50%; bottom: calc(var(--s-5) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s-2);
  padding: 8px 8px 8px 20px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--line);
  animation: set-bar-in var(--dur-3) var(--ease) both;
  max-width: calc(100% - 24px);
}
.set-savebar__text { font-weight: 600; font-size: 14px; white-space: nowrap; margin-right: var(--s-2); }
.set-savebar__text::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); margin-right: 8px; vertical-align: 1px; }
@keyframes set-bar-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 900px) { body.has-rail .set-savebar { margin-left: calc(var(--rail-w) / 2); } }
@media (max-width: 899.98px) { body.has-rail .set-savebar { bottom: calc(var(--bar-h) + var(--s-3) + env(safe-area-inset-bottom)); } }
/* Phones: full width between the gutters, so all three parts always fit. */
@media (max-width: 520px) {
  .set-savebar { left: 12px; right: 12px; transform: none; max-width: none; padding-left: 14px; animation-name: set-bar-in-m; }
  .set-savebar__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; margin-right: 0; }
  .set-savebar__more { display: none; }
}
@keyframes set-bar-in-m { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
/* Room at the end so the bar never covers the last controls. */
.set-form { padding-bottom: 72px; }

/* Dialogs */
.set-dialog { display: none; }
.set-dialog[open] { display: grid; gap: var(--s-3); }
.set-dialog__actions { justify-content: flex-end; margin-top: var(--s-3); }

@media (prefers-reduced-motion: reduce) {
  .set-savebar { animation: none; }
}
