
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background: var(--wood-deep);
  overflow: hidden;
}

.account-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.bg-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.settings-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 32px clamp(120px, 12vw, 180px);
}

.settings-card {
  width: min(100%, 560px);
  position: relative;
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin-bottom: 12px;
  color: #8a5a36;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.settings-card h1 {
  margin-bottom: 14px;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.55rem, 2.2vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #3d2a1d;
}

.settings-copy {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #5b4330;
}

.settings-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.settings-badges span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(123, 84, 56, 0.12);
  color: #6d4226;
  font-weight: 600;
}

/* ---------- Music controls ---------- */
.music-controls {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.music-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.music-label {
  min-width: 110px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #3d2a1d;
}

.music-toggle {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid rgba(95, 61, 34, 0.35);
  background: rgba(123, 84, 56, 0.18);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.music-toggle .music-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 2px 6px rgba(33, 18, 9, 0.3);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.music-toggle.is-on {
  background: #b9823f;
  border-color: #8a5a36;
}

.music-toggle.is-on .music-toggle-knob {
  transform: translateX(26px);
}

.music-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b9823f, #e6c795);
  outline: none;
  cursor: pointer;
}

.music-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fffaf0;
  border: 2px solid #8a5a36;
  box-shadow: 0 2px 6px rgba(33, 18, 9, 0.3);
}

.music-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fffaf0;
  border: 2px solid #8a5a36;
  box-shadow: 0 2px 6px rgba(33, 18, 9, 0.3);
}

.music-volume {
  min-width: 44px;
  text-align: right;
  font-weight: 700;
  color: #6d4226;
}

.music-note {
  margin-top: 18px;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.6;
  color: #7a5c3f;
}

/* ---------- Top navigation (copied/tuned from meal-planner.css) ---------- */
.top-navigation {
  position: fixed;
  top: 0;
  left: clamp(6px, 1.3vw, 20px);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 22px 0;
  z-index: 100;
}

.ui-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1), filter 0.22s cubic-bezier(0.22,1,0.36,1);
}

.nav-btn {
  width: clamp(84px, 9vw, 130px);
  height: clamp(72px, 7.6vw, 110px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(2px 4px 5px rgba(0,0,0,0.5));
}

.settings-card {
  width: min(100%, 560px);
  padding: 44px 38px 40px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 251, 240, 0.97), rgba(246, 235, 208, 0.95));
  border: 1px solid rgba(150, 105, 55, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 2px 6px rgba(90, 50, 16, 0.1),
    0 18px 44px rgba(60, 32, 10, 0.22),
    0 42px 90px rgba(60, 32, 10, 0.16);
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8a25c rgba(123, 84, 56, 0.12);
}

/* ---------- Kitchen preferences ---------- */
.pref-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 20px;
}

.pref-divider::before,
.pref-divider::after {
  content: "";
  flex: 1;
  height: 1px;
}

.pref-divider::before {
  background: linear-gradient(90deg, transparent, rgba(160, 111, 44, 0.55));
}

.pref-divider::after {
  background: linear-gradient(270deg, transparent, rgba(160, 111, 44, 0.55));
}

.pref-diamond {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-radius: 1.5px;
  background: linear-gradient(135deg, #f3c56d, #a8611f);
  box-shadow: 0 1px 2px rgba(90, 50, 16, 0.35);
}

.pref-group {
  margin-top: 14px;
  border: 1px solid rgba(138, 90, 54, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.6), rgba(250, 242, 222, 0.5));
  box-shadow: 0 2px 6px rgba(80, 45, 18, 0.06);
  transition: background 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.pref-group[open] {
  background: linear-gradient(180deg, #fffdf6, #f8eed3);
  border-color: rgba(138, 90, 54, 0.3);
  box-shadow: 0 8px 22px rgba(80, 45, 18, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.pref-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
  border-radius: 18px;
  transition: background 0.22s ease;
}

.pref-summary::-webkit-details-marker {
  display: none;
}

.pref-summary:hover {
  background: rgba(255, 252, 244, 0.6);
}

.pref-summary-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pref-title {
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.2rem;
  color: #3d2a1d;
  letter-spacing: 0.01em;
}

.pref-hint {
  font-size: 0.92rem;
  font-style: italic;
  color: #7a5c3f;
}

.pref-count {
  font-weight: 700;
  color: #a06f2c;
  font-style: normal;
}

.pref-icon {
  flex: none;
  position: relative;
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
  border: 1px solid rgba(122, 66, 20, 0.55);
  background: radial-gradient(circle at 35% 30%, #fbe9bc, #e2b76a 60%, #b9823f);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 3px rgba(122, 66, 20, 0.3),
    0 2px 6px rgba(80, 45, 18, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.pref-icon::before,
.pref-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: #4a2c0f;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.pref-icon::before {
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.pref-icon::after {
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}

.pref-group[open] .pref-icon::before,
.pref-group[open] .pref-icon::after {
  transform: translate(-50%, -50%) rotate(45deg);
}

.pref-group[open] .pref-icon {
  background: radial-gradient(circle at 35% 30%, #f2d394, #cf9647 60%, #a96a2c);
}

.pref-summary:hover .pref-icon {
  background: radial-gradient(circle at 35% 30%, #fdeec9, #e8c27e 60%, #c78f45);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -2px 3px rgba(122, 66, 20, 0.28),
    0 4px 9px rgba(80, 45, 18, 0.3);
}

.pref-summary:focus-visible {
  outline: 2px solid #a06f2c;
  outline-offset: -2px;
}

.pref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 18px 18px;
}

.pref-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid #d9c194;
  background: linear-gradient(180deg, #fffaf0, #f5ead2);
  color: #5b4330;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(80, 45, 18, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.pref-chip::after {
  content: "";
  flex: none;
  width: 8px;
  height: 10px;
  border-right: 2px solid #3d2a1d;
  border-bottom: 2px solid #3d2a1d;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.pref-chip:hover {
  transform: translateY(-1px);
  border-color: #c8a25c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(80, 45, 18, 0.12);
}

.pref-chip:active {
  transform: translateY(0) scale(0.96);
}

.pref-chip.is-selected {
  background: linear-gradient(180deg, #f7dd9f, #e2b76a 55%, #c78a3a);
  border-color: #8a5a36;
  color: #3d2a1d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 4px rgba(122, 66, 20, 0.18), 0 3px 8px rgba(90, 50, 16, 0.22);
}

.pref-chip.is-selected::after {
  opacity: 1;
}

.pref-chip:focus-visible {
  outline: 2px solid #a06f2c;
  outline-offset: 2px;
}

.pref-textarea {
  width: calc(100% - 36px);
  margin: 4px 18px 18px;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(138, 90, 54, 0.3);
  background-color: #fffdf6;
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 29px,
    rgba(200, 162, 92, 0.3) 29px,
    rgba(200, 162, 92, 0.3) 30px
  );
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  line-height: 30px;
  color: #3d2a1d;
  resize: vertical;
  box-shadow: inset 0 2px 5px rgba(80, 45, 18, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.pref-textarea:focus {
  outline: none;
  border-color: #a06f2c;
  box-shadow: inset 0 2px 5px rgba(80, 45, 18, 0.08),
    0 0 0 3px rgba(160, 111, 44, 0.18);
}

.pref-actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pref-save {
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid #8a5a36;
  background: linear-gradient(180deg, #f9e3ae, #e7bf74 50%, #c78a3a);
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: #3d2a1d;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(122, 66, 20, 0.22), 0 6px 16px rgba(90, 50, 16, 0.22);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease, filter 0.18s ease;
}

.pref-save:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 4px rgba(122, 66, 20, 0.2), 0 10px 22px rgba(90, 50, 16, 0.28);
}

.pref-save:active {
  transform: translateY(0) scale(0.98);
  box-shadow: inset 0 2px 6px rgba(122, 66, 20, 0.25),
    0 3px 8px rgba(90, 50, 16, 0.18);
}

.pref-save:focus-visible {
  outline: 2px solid #a06f2c;
  outline-offset: 2px;
}

.pref-status {
  font-style: italic;
  color: #6d4226;
  background: rgba(248, 230, 190, 0.65);
  border: 1px solid rgba(160, 111, 44, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.95rem;
}

@media (prefers-reduced-motion: no-preference) {
  .settings-card {
    animation: pref-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .pref-group[open] .pref-chips,
  .pref-group[open] .pref-textarea {
    animation: pref-drawer-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .pref-group[open] .pref-chip {
    animation: pref-chip-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .pref-group[open] .pref-chip:nth-child(2) { animation-delay: 20ms; }
  .pref-group[open] .pref-chip:nth-child(3) { animation-delay: 40ms; }
  .pref-group[open] .pref-chip:nth-child(4) { animation-delay: 60ms; }
  .pref-group[open] .pref-chip:nth-child(5) { animation-delay: 80ms; }
  .pref-group[open] .pref-chip:nth-child(6) { animation-delay: 100ms; }
  .pref-group[open] .pref-chip:nth-child(7) { animation-delay: 120ms; }
  .pref-group[open] .pref-chip:nth-child(8) { animation-delay: 140ms; }
  .pref-group[open] .pref-chip:nth-child(9) { animation-delay: 160ms; }
  .pref-group[open] .pref-chip:nth-child(10) { animation-delay: 180ms; }

  @keyframes pref-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }

  @keyframes pref-drawer-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
  }

  @keyframes pref-chip-in {
    from { opacity: 0; transform: translateY(5px) scale(0.97); }
    to { opacity: 1; transform: none; }
  }
}