/* Personal page: profile, preferences, local data vault and avatar dialog. */

#dataVaultStart {
  scroll-margin-top: 92px;
}

.personal-section-head h2 {
  margin: 6px 0 0;
  color: var(--color-ink-strong);
  font-size: clamp(32px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.avatar-button {
  position: relative;
  width: 128px;
  height: 152px;
  padding: 0;
  overflow: hidden;
  border: 7px solid white;
  border-radius: 62px 62px 22px 22px;
  background: var(--member-diana-soft);
  box-shadow: 0 14px 32px rgba(100, 71, 97, 0.15);
  cursor: pointer;
}

.avatar-button img,
.avatar-placeholder {
  width: 100%;
  height: 100%;
}

.avatar-button img[hidden],
.avatar-placeholder[hidden] {
  display: none;
}

.avatar-button img {
  display: block;
  object-fit: cover;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  color: rgba(92, 70, 105, 0.72);
  font-family: Georgia, serif;
  font-size: 48px;
}

.avatar-edit {
  position: absolute;
  inset: auto 0 0;
  padding: 9px 4px 10px;
  color: white;
  background: rgba(36, 35, 53, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: translateY(2px);
  transition: background 180ms ease;
}

.avatar-button:hover .avatar-edit {
  background: rgba(36, 35, 53, 0.82);
}

.profile-dock {
  position: relative;
  z-index: 6;
  display: grid;
  width: 100%;
  min-height: 190px;
  margin: 28px auto 0;
  padding: 27px 34px 31px;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 30px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(82, 52, 75, 0.09);
}

.profile-dock::before {
  display:none;
}

.profile-identity {
  display: flex;
  padding-right: 26px;
  align-items: center;
  gap: 16px;
  border-right: 1px dashed rgba(93, 76, 101, 0.16);
}

.profile-identity > div:last-child {
  display: grid;
  gap: 5px;
}

.profile-tag {
  color: var(--member-eileen);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.05em;
}

.profile-identity strong {
  font-size: 17px;
}

.profile-identity small {
  color: #9a8e9b;
  font-size: var(--text-xs);
  line-height: 1.5;
}

.profile-dock .avatar-button {
  width: 92px;
  height: 112px;
  margin-bottom: 25px;
  flex: none;
  overflow: visible;
  border-width: 5px;
  border-radius: 46px 46px 18px 18px;
  background: var(--member-diana-soft);
}

.profile-dock .avatar-button img,
.profile-dock .avatar-placeholder {
  overflow: hidden;
  border-radius: 38px 38px 12px 12px;
}

.profile-dock .avatar-button img {
  padding: 3px;
  object-fit: contain;
  background: #fff;
}

.profile-dock .avatar-placeholder {
  font-size: 38px;
}

.profile-dock .avatar-edit {
  inset: auto auto -24px 50%;
  min-width: max-content;
  padding: 5px 11px;
  border: 2px solid white;
  border-radius: 999px;
  color: #5f5368;
  background: #fff;
  box-shadow: 0 7px 16px rgba(72, 53, 78, 0.14);
  transform: translateX(-50%);
}

.profile-dock .avatar-button:hover .avatar-edit {
  color: #6b54bd;
  background: #f4efff;
}

.profile-form {
  display: grid;
  align-self: center;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.profile-form .field--signature {
  grid-column: 1 / -1;
}

.profile-form .field input,
.profile-form .field select {
  height: 44px;
  background: #fffaf7;
  font-size:14px;
}

.personal-preferences {
  display: flex;
  min-height: 72px;
  margin-top: 18px;
  padding: 14px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(87, 102, 144, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(73, 59, 82, 0.055);
}

.personal-preference-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.personal-preference-copy > span:last-child {
  display: grid;
  gap: 2px;
}

.personal-preference-copy strong {
  color: #403949;
  font-size: 14px;
}

.personal-preference-copy small {
  color: #8b8391;
  font-size: 11px;
}

.personal-preference-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: #576690;
  font-weight: 900;
}

.preference-switch {
  position: relative;
  display: block;
  width: 70px;
  min-width: 70px;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgba(87, 102, 144, 0.16);
  border-radius: 999px;
  color: #576690;
  background: #f2f4f8;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.preference-switch span {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 26px;
  text-align: center;
  transform: translateY(-50%);
}

.preference-switch i {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 26px;
  height: 26px;
  margin: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 9px rgba(62, 54, 75, 0.14);
  transform: translateY(-50%);
}

.preference-switch[aria-pressed="true"] {
  color: #fff;
  border-color: #576690;
  background: #576690;
}

.preference-switch[aria-pressed="false"] span {
  right: 10px;
  left: auto;
}

.preference-switch[aria-pressed="false"] i {
  right: auto;
  left: 4px;
}

.data-vault {
  display: grid;
  margin: 0 0 58px;
  padding: 23px 26px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(85, 165, 143, 0.18);
  border-radius: 24px;
  background: rgba(250, 253, 251, .96);
  box-shadow: 0 16px 42px rgba(65, 95, 84, 0.07);
}

.data-vault-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--accent-mint);
  box-shadow: 0 10px 20px rgba(85, 165, 143, 0.2);
  font-size: 22px;
  font-weight: 950;
}

.data-vault-copy .eyebrow {
  display:inline-block;
  color: #397d69;
  background: transparent;
}

.data-vault-copy h2 {
  margin: 8px 0 5px;
  color: #302b43;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.data-vault-copy p {
  margin: 0;
  color: #77717d;
  font-size: 12px;
  line-height: 1.6;
}

.data-vault-status {
  display: inline-block;
  margin-top: 8px;
  color: #4b8b78;
  font-size: 10px;
  font-weight: 850;
}

.data-vault-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.data-vault-actions button {
  width: 112px;
  min-width: 112px;
  min-height: 42px;
  padding: 0 16px;
  justify-content: center;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

#footerExportButton {
  color:#fff;
  border-color:var(--member-eileen);
  background:var(--member-eileen);
  box-shadow:0 10px 22px rgba(87,102,144,.18);
}

#footerExportButton:hover {
  color:#fff;
  border-color:var(--member-eileen-ink);
  background:var(--member-eileen-ink);
}

#footerImportButton {
  color:#675aa6;
  border-color:rgba(103,90,166,.24);
  background:#f3f0ff;
  box-shadow:none;
}

#footerImportButton:hover {
  color:#fff;
  border-color:#675aa6;
  background:#675aa6;
}

#footerResetDataButton {
  color:#bf4056;
  border-color:rgba(207,69,91,.24);
  background:#fff1f3;
  box-shadow:none;
}

#footerResetDataButton:hover {
  color:#fff;
  border-color:#c74259;
  background:#c74259;
}

.personal-device-note { display:none; }

#avatarDialog .avatar-dialog-copy {
  margin: -8px 0 18px;
  color: var(--ink-soft);
  font-size: 12px;
}

#avatarDialog .avatar-sticker-grid {
  max-height: min(430px, 48vh);
  padding: 10px 3px 3px;
  grid-template-columns: repeat(6, minmax(84px, 1fr));
  grid-auto-rows: 96px;
  gap: 12px;
}

#avatarDialog .avatar-sticker-grid .sticker-item {
  width: 100%;
  height: 96px;
  min-height: 96px;
  aspect-ratio: auto;
}

@media (min-width: 1440px) {
  .personal-section-head h2 { font-size: 44px; }
  .profile-identity strong { font-size: 19px; }
  .profile-identity small,
  .profile-tag,
  .avatar-edit { font-size: 12px; }
  .personal-preference-copy strong { font-size: 15px; }
  .personal-preference-copy small { font-size: 12px; }
  .data-vault-copy h2 { font-size: 24px; }
  .data-vault-copy p { font-size: 14px; }
  .data-vault-status { font-size: 12px; }
}

/* Mid-size compact layout below the shared 900px web breakpoint. */
@media (min-width: 700px) and (max-width: 899.98px) {
  .profile-dock {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    padding-right: 0;
    padding-bottom: 20px;
    border-right: 0;
    border-bottom: 1px dashed rgba(93, 76, 101, 0.16);
  }

  .profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-mobile-app .personal-section,
  body.is-mobile-app .data-vault {
    width: auto;
    max-width: none;
    margin: 12px 10px;
    padding: 20px 16px;
    overflow: visible;
    border: 1px solid rgba(71, 60, 79, 0.08);
    border-radius: 26px;
    background: var(--soul-paper);
    box-shadow: var(--soul-shadow);
  }

  body.is-mobile-app .data-vault {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  body.is-mobile-app .data-vault-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.is-mobile-app .data-vault-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* Phone */
@media (max-width: 699px) {
  #dataVaultStart {
    scroll-margin-top: 22px;
  }

  .personal-section,
  .data-vault {
    width: auto;
    max-width: none;
    margin: 12px 8px;
    padding: 16px 13px;
    overflow: visible;
    border: 1px solid var(--soul-hairline);
    border-radius: 24px;
    background: var(--soul-paper);
    box-shadow: 0 12px 34px rgba(69, 52, 65, 0.05);
  }

  .profile-dock::before,
  .data-vault::before {
    display: none;
  }

  .personal-section-head {
    display: block;
    margin-bottom: 10px;
  }

  .personal-section-head h2 {
    margin: 6px 0 0;
    color: var(--soul-ink);
    font-size: clamp(27px, 7.4vw, 34px);
    line-height: 1.12;
  }

  .profile-dock {
    display: grid;
    width: 100%;
    min-height: 190px;
    margin-top: 16px;
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 16px;
    border: 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(73, 59, 82, 0.06);
  }

  .profile-identity {
    margin-bottom: 11px;
    padding: 0 0 14px;
    align-items: center;
    gap: 14px;
    border: 0;
    border-bottom: 1px dashed var(--soul-line);
  }

  .profile-identity > div:last-child {
    gap: 2px;
  }

  .profile-identity strong {
    font-size: 24px;
    line-height: 1.12;
  }

  .profile-identity small {
    color: var(--soul-muted);
    font-size: 10px;
  }

  .profile-tag {
    color: var(--member-eileen);
    font-size: 10px;
    font-weight: 900;
  }

  .profile-form {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .profile-form .field {
    min-width: 0;
  }

  .profile-form .field:first-child,
  .profile-form .field--signature {
    grid-column: 1 / -1;
  }

  .profile-form .field span {
    font-size: 11px;
  }

  .profile-form .field input,
  .profile-form .field select {
    width: 100%;
    min-width: 0;
    height: 43px;
    padding: 0 12px;
    border: 1px solid var(--soul-line);
    border-radius: 12px;
    background: #fffaf7;
    font-size: 12px;
  }

  .personal-preferences {
    min-height: 58px;
    padding: 9px 11px;
    border-radius: 17px;
  }

  .personal-preference-copy small {
    display: none;
  }

  .personal-preference-icon {
    width: 35px;
    height: 35px;
    color: #fff;
    background: var(--soul-nailin);
  }

  .preference-switch[aria-pressed="true"] {
    color: #fff;
    border-color: #576690;
    background: #576690;
    box-shadow: 0 7px 18px rgba(87, 102, 144, 0.2);
  }

  .data-vault {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    background: #fbfdfc;
  }

  .data-vault-mark {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .data-vault-copy h2 {
    margin: 3px 0 5px;
    font-size: 21px;
    line-height: 1.18;
  }

  .data-vault-copy p {
    margin: 0;
    color: var(--soul-muted);
    font-size: 11px;
  }

  .data-vault-status {
    font-size: 10px;
  }

  .data-vault-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .data-vault-actions button {
    width: auto;
    min-width: 0;
    min-height: 45px;
    border-radius: 14px;
    font-size: 11px;
  }

  .data-vault-actions #footerExportButton {
    grid-column: 1 / -1;
  }

  #avatarDialog .avatar-sticker-grid {
    max-height: 224px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 92px;
    gap: 6px;
  }

  #avatarDialog .avatar-sticker-grid .sticker-item {
    height: 92px;
    min-height: 72px;
    border-radius: 10px;
  }
}

@media (max-width:899.98px) {
  body.is-mobile-app .personal-device-note {
    display:grid;
    width:auto;
    margin:2px 20px 24px;
    justify-items:center;
    gap:3px;
    color:#8a838e;
    text-align:center;
  }

  body.is-mobile-app .personal-device-note strong {
    color:#576690;
    font-size:11px;
  }

  body.is-mobile-app .personal-device-note small {
    font-size:9px;
    line-height:1.5;
  }
}
