.own-profile-page-wrap [hidden],
.self-edit-overlay[hidden],
#profileDeleteView[hidden],
#profileEditFormView[hidden] { display: none !important; }

.own-profile-main { width: min(1380px, calc(100% - 48px)); padding-top: 90px; }
.own-profile-actions { display: flex; }
.own-profile-actions .social-button { min-width: 132px; }

/* O perfil próprio reutiliza exatamente a linguagem visual do perfil público. */
.own-profile-page-wrap .public-avatar-frame {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: 0 12px 30px rgba(17,19,24,.14) !important;
}
.own-profile-page-wrap .public-avatar-frame img { border: 0 !important; }

/* Editor compacto, inspirado no perfil-nav. */
.self-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 18px;
}
.self-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,19,24,.58);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.self-edit-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(820px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(17,19,24,.10);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(17,19,24,.28);
}
.self-edit-header {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(17,19,24,.07);
  background: rgba(255,255,255,.98);
}
.self-edit-header h2 { margin: 2px 0 0; color: var(--texto-primario); font-size: 1.2rem; line-height: 1.1; }
.self-edit-kicker { color: var(--accent); font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.self-edit-back {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--borda-forte);
  border-radius: 50%;
  background: #fff;
  color: var(--texto-secundario);
  cursor: pointer;
}
.self-edit-back svg { width: 19px; height: 19px; }
.self-edit-scroll {
  max-height: calc(min(820px, 100vh - 32px) - 76px);
  overflow-y: auto;
  padding: 18px 20px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(90,96,108,.28) transparent;
}
.self-edit-scroll::-webkit-scrollbar { width: 6px; }
.self-edit-scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(90,96,108,.24); }
.self-edit-avatar-editor { display: grid; justify-items: center; gap: 10px; margin-bottom: 18px; }
.self-edit-avatar-editor img {
  width: 104px;
  height: 104px;
  display: block;
  object-fit: cover;
  border: 0 !important;
  border-radius: 50%;
  background: #eef0f3;
  box-shadow: 0 10px 25px rgba(17,19,24,.13);
}
.self-edit-outline-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--borda-forte);
  border-radius: 999px;
  background: #fff;
  color: var(--texto-primario);
  font: 850 .75rem var(--fonte-base);
  cursor: pointer;
}
.self-edit-outline-button svg { width: 16px; height: 16px; color: var(--accent); }
.self-edit-wide { width: 100%; margin-top: 9px; }
.self-edit-field { display: grid; gap: 7px; margin-bottom: 14px; color: var(--texto-primario); font-size: .74rem; font-weight: 850; }
.self-edit-field.compact { margin-bottom: 10px; }
.self-edit-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--borda-forte);
  border-radius: 14px;
  outline: 0;
  background: #fff;
  color: var(--texto-primario);
  font: .84rem var(--fonte-base);
}
.self-edit-field input:focus { border-color: rgba(var(--accent-rgb),.52); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.08); }
.self-edit-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(17,19,24,.08); }
.self-edit-section-title { display: grid; gap: 3px; margin-bottom: 11px; }
.self-edit-section-title > span { color: var(--texto-primario); font-size: .78rem; font-weight: 900; }
.self-edit-section-title small { color: var(--texto-terciario); font-size: .69rem; }
.self-edit-banner-preview {
  width: 100%;
  height: 118px;
  overflow: hidden;
  border: 1px solid var(--borda-cor);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),.82), rgba(var(--accent-rgb),.30));
  background-position: center;
  background-size: cover;
}
.self-edit-status { min-height: 20px; margin: 12px 0 8px; color: var(--texto-secundario); font-size: .72rem; font-weight: 750; text-align: center; }
.self-edit-status.error { color: #b91c1c; }
.self-edit-primary,
.self-delete-primary,
.self-edit-secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  font: 900 .79rem var(--fonte-base);
  cursor: pointer;
}
.self-edit-primary { border: 0; background: var(--accent); color: #fff; }
.self-edit-primary:disabled,.self-delete-primary:disabled { opacity: .65; cursor: wait; }
.self-edit-secondary { margin-top: 9px; border: 1px solid var(--borda-forte); background: #fff; color: var(--texto-primario); }
.self-edit-danger {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(185,28,28,.12);
}
.self-edit-danger > div { display: grid; gap: 3px; }
.self-edit-danger strong { color: #991b1b; font-size: .75rem; }
.self-edit-danger span { color: var(--texto-terciario); font-size: .65rem; line-height: 1.35; }
.self-edit-danger .self-edit-danger-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 0; border-radius: 999px; background: #c62828; color: #fff; font: 850 .7rem var(--fonte-base); cursor: pointer; box-shadow: 0 6px 16px rgba(198,40,40,.18); }
.self-edit-danger .self-edit-danger-button:hover { background: #b71c1c; }
.self-edit-danger .self-edit-danger-button svg { width: 15px; height: 15px; }
.self-delete-warning { display: flex; gap: 12px; margin-bottom: 18px; padding: 14px; border-radius: 18px; background: #fff4f2; color: #991b1b; }
.self-delete-warning svg { flex: 0 0 auto; width: 22px; height: 22px; }
.self-delete-warning div { display: grid; gap: 3px; }
.self-delete-warning strong { font-size: .78rem; }
.self-delete-warning span { color: #a94438; font-size: .68rem; line-height: 1.4; }
.self-delete-primary { border: 0; background: #b91c1c; color: #fff; }

@media (max-width: 560px) {
  .own-profile-main { padding-top: 76px; }
  .own-profile-actions { justify-content: center; }
  .self-edit-overlay { padding: 8px; align-items: end; }
  .self-edit-card { width: 100%; max-height: calc(100vh - 8px); border-radius: 26px 26px 18px 18px; }
  .self-edit-scroll { max-height: calc(100vh - 84px); padding: 16px; }
}


/* =====================================================
   Perfil próprio: 5 cartas em destaque editáveis
   ===================================================== */
.own-highlights-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.own-highlights-edit-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--borda-cor);
  border-radius: 999px;
  background: #fff;
  color: var(--texto-primario);
  font: 850 .7rem var(--fonte-base);
  cursor: pointer;
}
.own-highlights-edit-button svg { width: 15px; height: 15px; color: var(--accent); }
.own-highlights-help { margin: 2px 0 18px; color: var(--texto-terciario); font-size: 11px; }
.own-highlights { grid-template-columns: repeat(5, minmax(0, 150px)); }
.own-highlight-slot {
  position: relative;
  min-width: 0;
  min-height: 230px;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.own-highlight-slot:hover { transform: translateY(-2px); background: var(--bg-hover); border-color: var(--borda-cor); }
.own-highlight-slot img { width: 100%; aspect-ratio: .716; object-fit: contain; display: block; }
.own-highlight-slot strong { max-width: 100%; margin-top: 7px; overflow: hidden; color: var(--texto-primario); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.own-highlight-slot > span { max-width: 100%; margin-top: 2px; overflow: hidden; color: var(--texto-terciario); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.own-highlight-slot.empty {
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--borda-forte);
  background: rgba(255,255,255,.42);
}
.own-highlight-slot.empty svg { width: 24px; height: 24px; color: var(--texto-terciario); }
.own-highlight-slot.empty strong { margin: 0; font-size: 11px; }
.own-highlight-edit-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: var(--accent);
  box-shadow: 0 6px 14px rgba(17,19,24,.12);
}
.own-highlight-edit-mark svg { width: 14px; height: 14px; }

/* Seletor de destaques */
.highlight-picker-modal[hidden] { display: none !important; }
.highlight-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 10120;
  display: grid;
  place-items: center;
  padding: 18px;
}
.highlight-picker-backdrop { position: absolute; inset: 0; background: rgba(17,19,24,.60); }
.highlight-picker-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(17,19,24,.10);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(17,19,24,.28);
}
.highlight-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
.highlight-picker-header h2 { margin: 2px 0 0; color: var(--texto-primario); font-size: 1.15rem; }
.highlight-picker-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--borda-forte); border-radius: 50%; background: #fff; color: var(--texto-primario); cursor: pointer; }
.highlight-picker-search { margin: 0 20px 12px; min-height: 44px; padding: 0 14px; border: 1px solid var(--borda-forte); border-radius: 14px; outline: 0; color: var(--texto-primario); background: #fff; font: .8rem var(--fonte-base); }
.highlight-picker-search:focus { border-color: rgba(var(--accent-rgb),.52); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.08); }
.highlight-picker-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; padding: 2px 20px 18px; }
.highlight-picker-item { min-width: 0; padding: 7px; border: 1px solid transparent; border-radius: 14px; background: #fff; cursor: pointer; text-align: center; }
.highlight-picker-item:hover { background: var(--bg-hover); border-color: var(--borda-cor); }
.highlight-picker-item.selected { border-color: var(--accent); background: rgba(var(--accent-rgb),.05); }
.highlight-picker-item img { width: 100%; aspect-ratio: .716; object-fit: contain; display: block; }
.highlight-picker-item strong { display: block; margin-top: 5px; overflow: hidden; color: var(--texto-primario); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.highlight-picker-empty { grid-column: 1/-1; padding: 40px 12px; text-align: center; color: var(--texto-terciario); font-size: 12px; }
.highlight-picker-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 20px 18px; border-top: 1px solid rgba(17,19,24,.06); }
.highlight-picker-remove { min-height: 38px; padding: 0 14px; border: 1px solid rgba(185,28,28,.22); border-radius: 999px; background: #fff; color: #b91c1c; font: 850 .72rem var(--fonte-base); cursor: pointer; }
.highlight-picker-remove[hidden] { display: none !important; }

/* =====================================================
   Recorte do banner: mesma lógica de arrastar/zoom do avatar
   ===================================================== */
.profile-banner-crop-modal[hidden] { display: none !important; }
.profile-banner-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 10130;
  display: grid;
  place-items: center;
  padding: 18px;
}
.profile-banner-crop-backdrop { position: absolute; inset: 0; background: rgba(17,19,24,.62); }
.profile-banner-crop-card {
  position: relative;
  z-index: 1;
  width: min(560px,100%);
  padding: 20px;
  border: 1px solid rgba(17,19,24,.10);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(17,19,24,.28);
}
.profile-banner-crop-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.profile-banner-crop-header h2 { margin: 3px 0 0; color: var(--texto-primario); font-size: 1.15rem; }
.profile-banner-crop-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--borda-forte); border-radius: 50%; background: #fff; color: var(--texto-primario); cursor: pointer; }
.profile-banner-crop-stage { width: 100%; overflow: hidden; border-radius: 18px; background: #e8ebef; box-shadow: inset 0 0 0 1px rgba(17,19,24,.08); }
.profile-banner-crop-stage canvas { display: block; width: 100%; aspect-ratio: 3.2 / 1; height: auto; cursor: grab; touch-action: none; user-select: none; }
.profile-banner-crop-stage canvas:active { cursor: grabbing; }
.profile-banner-crop-help { margin: 10px 0 12px; color: var(--texto-terciario); font-size: .72rem; text-align: center; }
.profile-banner-crop-zoom { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; margin-bottom: 16px; color: var(--texto-primario); font-size: .73rem; font-weight: 850; }
.profile-banner-crop-zoom input { width: 100%; accent-color: var(--accent); }
.profile-banner-crop-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.profile-banner-crop-actions button { min-height: 44px; border-radius: 999px; font: 850 .74rem var(--fonte-base); cursor: pointer; }
.profile-banner-crop-actions .secondary { border: 1px solid var(--borda-forte); background: #fff; color: var(--texto-primario); }
.profile-banner-crop-actions .primary { border: 0; background: var(--accent); color: #fff; }

/* Modal mais leve: sem blur de fundo, evitando travadas em GPUs integradas. */
.self-edit-card { contain: layout paint; }
.self-edit-overlay, .highlight-picker-modal, .profile-banner-crop-modal { isolation: isolate; }

@media (max-width: 820px) {
  .own-highlights { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .highlight-picker-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .own-highlights-heading { align-items: flex-start; flex-direction: column; }
  .own-highlights { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .highlight-picker-modal, .profile-banner-crop-modal { padding: 8px; align-items: end; }
  .highlight-picker-card, .profile-banner-crop-card { width: 100%; border-radius: 26px 26px 18px 18px; }
  .highlight-picker-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .profile-banner-crop-actions { grid-template-columns: 1fr; }
}
