/* CatKing profile editor. Load after Lovart and project rules styles. */
#view-mine #mineSettingsPanel[hidden] { display: none; }

/* The profile header keeps a long nickname above the wallet address. */
#view-mine .account-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  grid-template-rows: minmax(30px, auto) minmax(30px, auto);
  column-gap: 13px;
  align-items: center;
  min-height: 72px;
}
#view-mine .account-card .account-top { display: contents; }
#view-mine .account-card .account-avatar { grid-column: 1; grid-row: 1 / 3; width: 68px; height: 68px; border-radius: 50%; }
#view-mine #accountAvatarImage { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center; }
#view-mine .account-card .account-top > div:last-child { grid-column: 2; grid-row: 1; min-width: 0; }
#view-mine .account-card .account-top h2 { display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; margin: 0; white-space: nowrap; }
#view-mine #accountNickname { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-mine .account-card .account-top h2 i { flex: 0 0 auto; }
#view-mine .account-card .address-box { position: static; grid-column: 2; grid-row: 2; width: 100%; min-width: 0; min-height: 30px; margin: 0; padding: 0; }
#view-mine .account-card .address-box > div { min-width: 0; }
#view-mine .account-card .address-value { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#view-mine #mineSettingsPanel {
  min-width: 0;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #eee3dc;
  border-radius: 20px;
  background: #fff;
  color: #4b3025;
  box-shadow: 0 5px 18px rgba(92,65,45,.07);
}
#view-mine #mineSettingsPanel .mine-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin-bottom: 15px; padding-bottom: 12px; border-bottom: 1px solid #f0e8e1; }
#view-mine #mineSettingsPanel .mine-panel-heading h2 { flex: 1; min-width: 0; margin: 0; color: #4b3025; font-size: 18px; font-weight: 800; }
#view-mine #mineSettingsPanel .mine-panel-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid #e7dcf4; border-radius: 12px; background: #faf6ff; color: #6546a3; font-size: 13px; font-weight: 700; }

#view-mine #profileSettingsForm { display: grid; gap: 14px; min-width: 0; }
#view-mine .profile-editor-preview { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 12px; border-radius: 16px; background: linear-gradient(110deg,#fff4e8,#f5efff); }
#view-mine #profileAvatarPreview { display: block; flex: 0 0 80px; width: 80px; height: 80px; border: 3px solid #fff; border-radius: 50%; background: #f9e8f1; object-fit: cover; object-position: center; box-shadow: 0 4px 12px rgba(92,65,45,.13); }
#view-mine .profile-editor-preview > div { min-width: 0; }
#view-mine #profileNicknamePreview { display: block; max-width: 100%; overflow: hidden; color: #4b3025; font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
#view-mine .profile-editor-preview small { display: block; margin-top: 4px; color: #6d625c; font-size: 11px; }

#view-mine .profile-field { display: grid; gap: 7px; min-width: 0; color: #4b3025; font-size: 13px; font-weight: 800; }
#view-mine .profile-field > span { display: block; }
#view-mine #profileNicknameInput { width: 100%; min-width: 0; height: 48px; padding: 0 13px; border: 1px solid #d9c9ec; border-radius: 12px; outline: 0; background: #fff; color: #4b3025; font-size: 16px; font-weight: 600; }
#view-mine #profileNicknameInput::placeholder { color: #776f72; opacity: 1; }
#view-mine #profileNicknameInput:focus { border-color: #8b6ccf; box-shadow: 0 0 0 3px rgba(139,108,207,.16); }
#view-mine #profileNicknameInput[aria-invalid="true"] { border-color: #c94d66; background: #fff8f8; }
#view-mine .profile-field-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #6d625c; font-size: 11px; font-weight: 500; }
#view-mine #profileNicknameCount { color: #7657b4; font-variant-numeric: tabular-nums; }

#view-mine .profile-avatar-field { min-width: 0; margin: 0; padding: 11px 12px 12px; border: 1px solid #eee3f5; border-radius: 16px; background: #fffcf8; }
#view-mine .profile-avatar-field legend { padding: 0 5px; color: #4b3025; font-size: 13px; font-weight: 800; }
#view-mine .profile-avatar-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
#view-mine #mineSettingsPanel .profile-avatar-option { display: grid; place-items: center; justify-self: center; width: 100%; max-width: 72px; min-width: 0; min-height: 48px; aspect-ratio: 1 / 1; margin: 0; padding: 3px; overflow: hidden; border: 2px solid transparent; border-radius: 14px; background: #f8edf8; color: #4b3025; cursor: pointer; }
#view-mine #mineSettingsPanel .profile-avatar-option img { display: block; width: 100%; height: 100%; border-radius: 10px; object-fit: contain; }
#view-mine #mineSettingsPanel .profile-avatar-option[aria-pressed="true"] { border-color: #7859bc; background: #f1e9ff; box-shadow: 0 0 0 2px rgba(120,89,188,.16); }
#view-mine #mineSettingsPanel .profile-avatar-option:disabled { opacity: .55; cursor: not-allowed; }

#view-mine .profile-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#view-mine .profile-upload-button,
#view-mine #mineSettingsPanel #profileAvatarReset { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 0 14px; border: 1px solid #dacbed; border-radius: 12px; background: #f6f0ff; color: #6546a3; font-size: 12px; font-weight: 800; cursor: pointer; }
#view-mine .profile-upload-button { position: relative; }
#view-mine #profileAvatarUpload { display: none; }
#view-mine #mineSettingsPanel #profileAvatarReset { background: #fff; }
#view-mine #profileAvatarHelp { margin: 0; color: #6d625c; font-size: 11px; line-height: 1.7; }
#view-mine #profileSaveStatus { min-height: 18px; margin: 0; color: #6546a3; font-size: 11px; line-height: 1.6; }
#view-mine #profileSaveStatus.error,
#view-mine #profileSaveStatus[data-state="error"] { color: #a9344c; }
#view-mine #profileSaveStatus.success,
#view-mine #profileSaveStatus[data-state="success"] { color: #276c51; }
#view-mine #mineSettingsPanel .profile-save-button { width: 100%; min-height: 48px; margin: 0; padding: 0 14px; border: 0; border-radius: 12px; background: linear-gradient(105deg,#8d6bdb,#f498c4); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; }
#view-mine #mineSettingsPanel .profile-save-button:disabled { background: #eee9f2; color: #625b68; opacity: 1; cursor: not-allowed; }
#view-mine #mineSettingsPanel .profile-storage-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff8ef; color: #665147; font-size: 10px; line-height: 1.7; }

#view-mine .profile-settings-footer { display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0e8e1; }
#view-mine #mineSettingsPanel #profileSwapSettings { flex: 0 0 auto; min-height: 44px; margin: 0; padding: 0 13px; border: 1px solid #dccfee; border-radius: 12px; background: #fff; color: #6546a3; font-size: 12px; font-weight: 800; }
#view-mine .profile-settings-footer small { min-width: 0; color: #6d625c; font-size: 10px; line-height: 1.5; }

#view-mine #mineSettingsPanel button:focus-visible,
#view-mine .profile-upload-button:focus-within { outline: 2px solid #8764d0; outline-offset: 2px; }

@media (max-width: 355px) {
  #view-mine #mineSettingsPanel { padding: 13px; }
  #view-mine .profile-avatar-options { gap: 6px; }
  #view-mine .profile-editor-preview { gap: 10px; padding: 10px; }
  #view-mine #profileAvatarPreview { flex-basis: 72px; width: 72px; height: 72px; }
  #view-mine #profileNicknamePreview { font-size: 15px; }
  #view-mine .profile-settings-footer { align-items: flex-start; flex-direction: column; gap: 6px; }
}
