/* ── Profile page · 暮光暖巢 ── */

.layout-profile .screen-content {
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(232, 168, 124, 0.14), transparent 55%),
    var(--screen-bg);
}

.profile-shell {
  padding-bottom: 20px;
}

.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 36px;
  margin-bottom: 4px;
}

.profile-topbar-spacer { flex: 1; }

.profile-settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 252, 248, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(44, 54, 57, 0.05);
  transition: color 0.15s, border-color 0.15s, transform 0.12s var(--ease-soft);
}

.profile-settings-btn:active {
  color: var(--brand);
  border-color: var(--brand-light);
  transform: scale(0.94);
}

.profile-hero {
  position: relative;
  margin-bottom: 12px;
  padding: 16px 18px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(148deg, #FFF8F0 0%, #FFFCF8 48%, #F8F0E6 100%);
  border: 1px solid rgba(232, 168, 124, 0.2);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Account layer */
.profile-account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 14px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.profile-account:active {
  opacity: 0.82;
}

.profile-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-dark);
  background: linear-gradient(160deg, #FFFCF8, #F5EDE4);
  box-shadow:
    0 0 0 2px rgba(255, 252, 248, 0.95),
    0 0 0 3px rgba(196, 112, 75, 0.22);
}

.profile-account-copy {
  flex: 1;
  min-width: 0;
}

.profile-account-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 1px;
  letter-spacing: 0.01em;
}

.profile-account-phone {
  display: block;
  font-family: var(--font-family-data);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.profile-account-tag {
  flex-shrink: 0;
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(196, 112, 75, 0.12);
  color: var(--brand-dark);
}

.profile-account .profile-hero-chevron {
  margin-left: 0;
}

.profile-hero-divider {
  height: 1px;
  margin: 0 0 14px;
  background: rgba(232, 168, 124, 0.18);
}

.profile-hero-glow {
  position: absolute;
  top: -40px;
  right: -24px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.32), transparent 68%);
  pointer-events: none;
}

.profile-hero-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.profile-hero-inner:active {
  opacity: 0.82;
}

.profile-hero-chevron {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.profile-roster-avatars {
  display: flex;
  flex-shrink: 0;
  padding-top: 2px;
}

.profile-roster-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--surface-card);
  margin-left: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(44, 54, 57, 0.08);
}

.profile-roster-avatar:first-child { margin-left: 0; }

.profile-roster-avatar--parent {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: var(--brand-on);
}

.profile-roster-avatar--child {
  background: linear-gradient(135deg, var(--spark-bg), var(--worth-bg));
  color: var(--brand-dark);
}

.profile-roster-avatar--guardian {
  background: linear-gradient(135deg, var(--worth-bg), var(--grow-bg));
  color: var(--grow);
}

.profile-roster-avatar--pending {
  opacity: 0.55;
  background: var(--surface-muted);
  color: var(--text-tertiary);
}

.profile-hero-copy strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}

.profile-hero-copy > span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.profile-roster-insight {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: 13px;
  line-height: 1.5;
  color: var(--brand-dark);
}

.profile-todo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(232, 168, 124, 0.18);
}

.profile-todo-row.hidden { display: none; }

.profile-todo-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 252, 248, 0.7);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.profile-todo-pill i {
  font-size: 10px;
  opacity: 0.75;
}

.profile-todo-pill--enroll {
  border-color: rgba(196, 112, 75, 0.25);
  color: var(--brand-dark);
}

.profile-todo-pill--claim {
  border-color: rgba(212, 132, 124, 0.3);
  color: var(--notice);
}

.profile-todo-pill:active {
  background: var(--spark-bg);
}

.profile-todo-pill--claim:active {
  background: var(--notice-bg);
}

.profile-family-panel {
  padding: 18px 16px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.profile-family-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-family-title {
  margin: 0 0 4px;
  font-family: var(--font-family-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-family-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.profile-help-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-tertiary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.profile-help-btn:active {
  color: var(--brand);
  background: var(--spark-bg);
}

.profile-fm-list {
  gap: 8px;
  margin-bottom: 0;
}

.profile-fm-list .fm-mini-status {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-fm-list .fm-mini-status i {
  font-size: 10px;
}

.profile-fm-list .fm-mini-status--ready {
  background: var(--grow-bg);
  color: var(--grow);
}

.profile-fm-list .fm-mini-status--ready::before { display: none; }

.profile-fm-list .fm-mini-status--pending {
  background: var(--spark-bg);
  color: var(--brand);
}

.profile-fm-list .fm-mini-admin {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  color: var(--brand);
  opacity: 0.75;
}

/* Inbox strip */
.profile-inbox {
  margin-bottom: 16px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(251, 240, 238, 0.55) 0%, rgba(255, 252, 248, 0.4) 100%);
  border: 1px solid rgba(212, 132, 124, 0.22);
}

.profile-inbox.hidden { display: none; }

.profile-inbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-inbox-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-inbox-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--notice);
  color: #fff;
  font-family: var(--font-family-data);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-inbox-sub {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.profile-inbox-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.profile-inbox-scroll::-webkit-scrollbar { display: none; }

.profile-inbox-card {
  flex: 0 0 168px;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(212, 132, 124, 0.35);
  background: var(--surface-card);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-inbox-card:active {
  border-color: var(--notice);
  box-shadow: 0 0 0 3px rgba(212, 132, 124, 0.12);
}

.profile-inbox-wave {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--notice-bg);
  color: var(--notice);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-data);
  font-size: 12px;
  font-weight: 600;
}

.profile-inbox-body {
  flex: 1;
  min-width: 0;
}

.profile-inbox-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.profile-inbox-body span {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-inbox-card > i {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-tertiary);
  opacity: 0.6;
}

.profile-fm-list .fm-mini-card {
  position: relative;
  min-height: 96px;
  padding: 10px 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface-muted);
  box-shadow: none;
  gap: 6px;
  overflow: hidden;
}

.profile-fm-list .fm-mini-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--tile-accent, var(--brand-light));
  opacity: 0.85;
}

.profile-fm-list .fm-mini-card--parent { --tile-accent: var(--brand); }
.profile-fm-list .fm-mini-card--child { --tile-accent: var(--spark); }
.profile-fm-list .fm-mini-card--guardian { --tile-accent: var(--grow); }

.profile-fm-list .fm-mini-card--ready {
  background: linear-gradient(180deg, #FFFCF8 0%, var(--surface-muted) 100%);
  border-color: var(--border-subtle);
}

.profile-fm-list .fm-mini-card--ready:active {
  border-color: rgba(232, 168, 124, 0.4);
  box-shadow: 0 0 0 3px rgba(196, 112, 75, 0.08);
}

.profile-fm-list .fm-mini-card--pending {
  border-style: dashed;
  border-color: var(--border-default);
  background: transparent;
}

.profile-fm-list .fm-mini-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(44, 54, 57, 0.06);
}

.profile-fm-list .fm-mini-card--parent .fm-mini-initial {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: var(--brand-on);
}

.profile-fm-list .fm-mini-card--child .fm-mini-initial {
  background: linear-gradient(135deg, var(--spark-bg), var(--worth-bg));
  color: var(--brand-dark);
}

.profile-fm-list .fm-mini-card--guardian .fm-mini-initial {
  background: linear-gradient(135deg, var(--worth-bg), var(--grow-bg));
  color: var(--grow);
}

.profile-fm-list .fm-mini-card--pending .fm-mini-initial {
  opacity: 0.55;
  background: var(--surface-muted);
  color: var(--text-tertiary);
}

.profile-fm-list .fm-mini-relation {
  font-family: var(--font-family-display);
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-fm-list .fm-mini-name {
  font-size: 13px;
}

.profile-fm-list .fm-mini-status--pending::before { display: none; }

.profile-invite-link {
  border: 1.5px dashed var(--border-default);
  background: transparent;
  color: var(--brand);
  gap: 4px;
}

.profile-fm-list .fm-mini-card--add::before { display: none; }

.profile-fm-list .fm-mini-card--add i {
  font-size: 18px;
  opacity: 0.75;
}

.profile-fm-list .fm-mini-card--add span {
  font-size: 12px;
  font-weight: 500;
}

.profile-fm-list .fm-mini-card--add:active {
  background: var(--spark-bg);
  border-color: var(--brand-light);
}

.profile-invite-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: none;
  border-top: 1px solid var(--divider);
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.profile-invite-link:active {
  background: var(--spark-bg);
}

.profile-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 0;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
}

.profile-footnote i {
  font-size: 11px;
  color: var(--worth);
  opacity: 0.85;
}

.profile-institution-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(76, 117, 242, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}

.profile-institution-badge.hidden {
  display: none;
}

/* ── Profile menu · warm card (scheme B) ── */
.profile-menu {
  margin-bottom: 8px;
}

.profile-menu-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(168deg, #FFFCF8 0%, #F8F0E6 100%);
  border: 1px solid rgba(232, 168, 124, 0.18);
  box-shadow: 0 2px 8px rgba(196, 112, 75, 0.05);
  overflow: hidden;
}

.profile-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(232, 168, 124, 0.12);
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.profile-menu-row--last {
  border-bottom: none;
}

.profile-menu-row:active {
  opacity: 0.78;
  color: var(--brand-dark);
  background: rgba(196, 112, 75, 0.05);
}

.profile-menu-chevron {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0.45;
}

.profile-menu-row-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.profile-menu-row-label {
  color: var(--text-secondary);
}

.profile-menu-row-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vp-toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: rgba(44, 54, 57, 0.88);
  color: var(--brand-on);
  font-size: 13px;
  white-space: nowrap;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
}

.vp-toast.hidden {
  display: block;
}

.vp-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Family members sub-page ── */
.layout-family .screen-content {
  background:
    radial-gradient(ellipse 90% 40% at 50% -6%, rgba(232, 168, 124, 0.07), transparent 55%),
    radial-gradient(ellipse 55% 28% at 100% 18%, rgba(107, 144, 128, 0.04), transparent 50%),
    var(--screen-bg);
}

.layout-family .profile-fm-list {
  margin-bottom: 0;
}

.layout-family .title-btn {
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}

.layout-family .fm-list {
  gap: 14px;
}

@keyframes fmCardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.layout-family .fm-page-enter {
  animation: fmPageIn 0.55s var(--ease-soft) both;
}

@keyframes fmPageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .layout-family .fm-page-enter,
  .layout-family .profile-fm-list .fm-mini-card,
  .layout-family .profile-fm-list .fm-mini-enter {
    animation: none;
    transition: none;
  }
}

