/* Profile & Security — identity-first layout. Reuses existing card/kicker/chip tokens. */

#profileView {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

#profileView [hidden] {
  display: none !important;
}

#profileView #signedInAuth {
  display: grid;
  gap: 14px;
}

#profileView .profile-identity-card,
#profileView .profile-section {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
}

#profileView .profile-identity-card {
  border-color: color-mix(in srgb, var(--green, #285cf4) 22%, var(--line));
}

#profileView .profile-identity-card .signed-in-user {
  padding: 0;
  border: 0;
  background: transparent;
}

#profileView .profile-identity-card .signed-in-user strong {
  font: 800 24px/1.15 Manrope, sans-serif;
  letter-spacing: -.03em;
}

#profileView .profile-identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

#profileView .profile-identity-actions #signOutButton {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

#profileView .profile-section-head {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

#profileView .profile-section-head h3 {
  margin: 0;
  font: 800 16px/1.2 Manrope, sans-serif;
}

#profileView .profile-summary {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

#profileView .profile-summary-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
}

#profileView .profile-summary-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

#profileView .profile-summary-meta dd {
  margin: 4px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#profileView .profile-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#profileView .profile-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

#profileView .profile-status-badge.is-ok {
  border-color: #b7e3c8;
  background: #e8f7ef;
  color: #0d6a49;
}

#profileView .profile-status-badge.is-warn {
  border-color: #f0c9a0;
  background: #fff6ea;
  color: #8a4b00;
}

#profileView .profile-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#profileView .profile-field-wide {
  grid-column: 1 / -1;
}

#profileView .profile-section .household-card {
  margin: 0;
}

#profileView .profile-section p,
#profileView #backupPhoneStatus,
#profileView #billingSummary,
#profileView #billingFeedback {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#profileView .profile-verification {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

#profileView .profile-verification dt {
  color: var(--muted);
  font-size: 12px;
}

#profileView .profile-verification dd {
  margin: 5px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#profileView #profilePhones {
  margin: 8px 0 0;
  padding-left: 18px;
}

#profileView #addBackupPhone,
#profileView #signOutButton {
  width: auto;
  justify-self: start;
}

#profileView #accountDeletionCard #accountDeletionStatus,
#profileView #accountDeletionCard #accountDeletionFeedback {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#profileView #accountDeletionCard #accountDeletionFeedback.account-deletion-feedback {
  margin: 8px 0 0;
}

#profileView #accountDeletionCard #accountDeletionFeedback.is-warning {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

body[data-theme="cloud"] #profileView #accountDeletionCard #accountDeletionFeedback.is-warning {
  border: 0;
  background: transparent;
  color: #ff8d80;
}

#profileView #accountDeletionMembers {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

#profileView .deletion-member-row,
#profileView .member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
}

#profileView .deletion-member-row .secondary,
#profileView .member-row .secondary {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

#profileView #accountDeletionActions {
  grid-template-columns: repeat(auto-fit, minmax(10rem, max-content));
}

#profileView #billingCard .auth-actions {
  grid-template-columns: repeat(auto-fit, minmax(10rem, max-content));
}

#profileView #billingCard.premium-active {
  box-shadow: none;
  background: linear-gradient(135deg, #fffdf8 0%, #fff8e8 100%) !important;
}

#profileView #billingCard.premium-active::after {
  top: 10px;
  right: 14px;
  font-size: 36px;
}

@media (max-width: 720px) {
  #profileView .profile-identity-card .signed-in-user,
  #profileView .profile-summary-meta,
  #profileView .profile-verification,
  #profileView .invite-form,
  #profileView .pending-invite-actions,
  #profileView .household-invite-banner {
    grid-template-columns: 1fr;
  }

  #profileView .profile-edit-button,
  #profileView .profile-identity-actions {
    justify-self: start;
    justify-content: flex-start;
  }

  #profileView .profile-identity-card,
  #profileView .profile-section {
    padding: 16px;
  }
}

body[data-theme="midnight"] #profileView .profile-form {
  color: inherit;
  background: transparent;
}

body[data-theme="midnight"] #profileView .profile-status-badge.is-ok {
  border-color: rgba(110, 231, 183, .28);
  background: rgba(16, 185, 129, .16);
  color: #8ef0c8;
}

body[data-theme="midnight"] #profileView .profile-status-badge.is-warn {
  border-color: rgba(250, 204, 21, .28);
  background: rgba(250, 204, 21, .12);
  color: #f6d27a;
}
