/* Perfil de cuenta dedicado — escritorio/tablet.
   El rediseño móvil vive al final de css/v2-mobile.css. */

.mv7-profile-view {
  width: 100%;
  min-height: calc(100vh - var(--v2-topbar-height));
  padding: 34px clamp(24px, 3vw, 48px) 48px;
}

.mv7-profile-view[hidden] {
  display: none;
}

body[data-v2-view='profile'] .mv7-live-pill {
  display: none;
}

.mv7-profile-editor-shell {
  width: min(100%, 1160px);
  margin: 0 auto;
}

.mv7-profile-private-hint svg,
.mv7-profile-preview-card footer svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.mv7-profile-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 290px);
  gap: 18px;
  align-items: stretch;
}

.mv7-profile-editor-card,
.mv7-profile-preview-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 42%),
    linear-gradient(150deg, rgba(23, 28, 25, 0.88), rgba(8, 11, 10, 0.92));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    inset 0 -1px rgba(255, 255, 255, 0.015),
    0 24px 68px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.mv7-profile-editor-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.mv7-profile-editor-hero {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 166px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--v2-line);
}

.mv7-profile-avatar-wrap {
  position: relative;
  width: 118px;
  height: 118px;
}

.mv7-profile-editor-avatar,
.mv7-profile-preview-avatar,
.mv7-profile-photo-preview {
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(145deg, #8e9992, #343b37);
  color: #fff;
  font-weight: 650;
}

.mv7-profile-editor-avatar {
  width: 118px;
  height: 118px;
  font-size: 34px;
}

.mv7-profile-editor-avatar img,
.mv7-profile-preview-avatar img,
.mv7-profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mv7-profile-avatar-camera {
  position: absolute;
  right: -1px;
  bottom: 2px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(22, 27, 24, 0.94);
  color: var(--v2-text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.mv7-profile-avatar-camera svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.mv7-profile-hero-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.mv7-profile-hero-copy strong {
  overflow: hidden;
  color: var(--v2-text);
  font-size: clamp(25px, 2.3vw, 33px);
  font-weight: 650;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv7-profile-hero-copy span {
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv7-profile-social-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 18px;
  margin-top: 3px;
  color: var(--v2-muted);
  font-size: 12px;
}

.mv7-profile-social-line span {
  color: inherit;
  font-size: inherit;
}

.mv7-profile-social-line strong {
  display: inline;
  color: var(--v2-text);
  font-size: inherit;
  font-weight: 650;
  letter-spacing: 0;
}

.mv7-profile-social-line i {
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--v2-line-strong);
}

.mv7-profile-photo-button {
  min-width: 132px;
}

.mv7-profile-fields {
  display: grid;
  gap: 19px;
  padding: 25px 28px 22px;
}

.mv7-profile-field {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--v2-text);
  font-size: 12px;
  font-weight: 560;
}

.mv7-profile-field > span:first-child em {
  color: var(--v2-muted);
  font-style: normal;
  font-weight: 450;
}

.mv7-profile-input-shell,
.mv7-profile-textarea-shell {
  position: relative;
  display: block;
  min-width: 0;
}

.mv7-profile-field input,
.mv7-profile-field textarea,
.mv7-preferences-fields select {
  font: inherit;
  width: 100%;
  border: 1px solid var(--v2-line-strong);
  border-radius: 11px;
  outline: 0;
  background: rgba(0, 0, 0, 0.16);
  color: var(--v2-text);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.mv7-profile-field input {
  min-height: 44px;
  padding: 0 15px;
}

.mv7-profile-field textarea {
  display: block;
  min-height: 86px;
  padding: 12px 15px 26px;
  resize: vertical;
  line-height: 1.5;
}

.mv7-profile-field input:focus,
.mv7-profile-field textarea:focus,
.mv7-preferences-fields select:focus {
  border-color: color-mix(in srgb, var(--v2-green) 56%, rgba(255, 255, 255, 0.15));
  box-shadow: 0 0 0 3px rgba(45, 222, 152, 0.09);
  background: rgba(255, 255, 255, 0.025);
}

.mv7-profile-field input[readonly] {
  padding-right: 124px;
  color: color-mix(in srgb, var(--v2-muted) 90%, white);
  cursor: default;
}

#profile-username {
  padding-right: 128px;
}

.mv7-profile-field-state,
.mv7-profile-email-state {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 570;
  white-space: nowrap;
}

.mv7-profile-field-state::before {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: '';
}

.mv7-profile-field-state.is-valid,
.mv7-profile-email-state {
  color: var(--v2-green-bright);
}

.mv7-profile-field-state.is-invalid {
  color: #ff7979;
}

.mv7-profile-field-state.is-checking {
  color: var(--v2-muted);
}

.mv7-profile-email-state {
  padding: 4px 8px;
  border: 1px solid rgba(45, 222, 152, 0.22);
  border-radius: 999px;
  background: rgba(45, 222, 152, 0.055);
}

.mv7-profile-email-state svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.mv7-profile-email-state.is-muted {
  border-color: var(--v2-line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--v2-muted);
}

.mv7-profile-field-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 430;
  line-height: 1.45;
}

.mv7-profile-textarea-shell > small {
  position: absolute;
  right: 13px;
  bottom: 9px;
  color: var(--v2-muted);
  font-size: 10px;
  font-weight: 450;
}

.mv7-profile-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding: 16px 28px;
  border-top: 1px solid var(--v2-line);
}

.mv7-profile-editor-actions > div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.mv7-profile-editor-actions button {
  min-width: 128px;
}

.mv7-profile-editor-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.mv7-profile-editor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--v2-muted);
  font-size: 11px;
}

.mv7-profile-editor-status[hidden] {
  display: none;
}

.mv7-profile-editor-status svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.mv7-profile-preview-card {
  position: sticky;
  top: 24px;
  display: grid;
  min-height: 100%;
  align-self: start;
  grid-template-rows: auto minmax(400px, 1fr) auto;
}

.mv7-profile-preview-card > header {
  display: grid;
  gap: 5px;
  padding: 22px 22px 0;
}

.mv7-profile-preview-card > header strong {
  font-size: 14px;
}

.mv7-profile-preview-card > header span {
  color: var(--v2-muted);
  font-size: 11px;
}

.mv7-profile-preview-content {
  display: flex;
  min-height: 430px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 28px 22px;
  text-align: center;
}

.mv7-profile-preview-avatar {
  width: 124px;
  height: 124px;
  margin-bottom: 18px;
  font-size: 34px;
}

.mv7-profile-preview-content > strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 25px;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv7-profile-preview-content > span {
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--v2-muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv7-profile-preview-stats {
  display: grid;
  width: min(100%, 230px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0 0;
  padding: 13px 0;
  border-block: 1px solid var(--v2-line);
}

.mv7-profile-preview-stats div {
  display: grid;
  gap: 3px;
}

.mv7-profile-preview-stats div + div {
  border-left: 1px solid var(--v2-line);
}

.mv7-profile-preview-stats dt {
  color: var(--v2-text);
  font-size: 16px;
  font-weight: 650;
}

.mv7-profile-preview-stats dd {
  margin: 0;
  color: var(--v2-muted);
  font-size: 10px;
}

.mv7-profile-preview-content > p {
  max-width: 25ch;
  margin: 18px 0 0;
  color: color-mix(in srgb, var(--v2-muted) 90%, white);
  font-size: 12px;
  line-height: 1.55;
}

.mv7-profile-preview-card > footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 18px;
  border-top: 1px solid var(--v2-line);
  color: var(--v2-muted);
  font-size: 10px;
  text-align: center;
}

.mv7-profile-preview-toggle {
  display: none;
}

body[data-v2-view='profile'] #profile-button {
  border-color: rgba(45, 222, 152, 0.48);
  box-shadow: 0 0 0 3px rgba(45, 222, 152, 0.1);
}

.mv7-profile-photo-dialog {
  width: min(460px, calc(100% - 32px));
}

.mv7-profile-photo-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 20px;
  border: 1px solid var(--v2-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.mv7-profile-photo-preview {
  width: 164px;
  height: 164px;
  font-size: 42px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.mv7-profile-photo-stage p {
  margin: 0;
  color: var(--v2-muted);
  font-size: 11px;
  text-align: center;
}

.mv7-profile-photo-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.mv7-profile-photo-error {
  margin: 12px 0 0;
  color: #ff8a8a;
  font-size: 12px;
  text-align: center;
}

.mv7-profile-photo-error[hidden] {
  display: none;
}

.mv7-profile-photo-dialog button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#profile-photo-cropper[hidden],
#profile-photo-preview[hidden] {
  display: none;
}

.mv7-profile-photo-stage:has(.cropt-container) {
  padding: 12px;
  border-radius: 24px;
}

#profile-photo-cropper {
  width: 100%;
  min-width: 0;
}

#profile-photo-cropper .cr-boundary {
  width: 100%;
  height: var(--profile-crop-boundary-height, clamp(230px, 36dvh, 320px));
  border-radius: 18px;
  background: #161618;
}

#profile-photo-cropper .cr-overlay {
  touch-action: none !important;
  overscroll-behavior: contain;
  -webkit-touch-callout: none;
}

#profile-photo-cropper .cr-viewport {
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.55);
}

#profile-photo-cropper .cr-viewport:focus-visible {
  outline: 3px solid #34c79a;
  outline-offset: 4px;
}

#profile-photo-cropper .cr-slider-wrap {
  width: calc(100% - 32px);
  margin: 8px auto 0;
}

#profile-photo-cropper .cr-slider {
  min-height: 44px;
  accent-color: #00a878;
  cursor: pointer;
}

@media (any-pointer: coarse) {
  #profile-photo-cropper .cr-slider-wrap {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #profile-photo-cropper .cr-loading::after {
    animation: none;
  }
}

/* Preferencias que antes estaban mezcladas dentro de Perfil. */
.mv7-preferences-workspace {
  container-type: inline-size;
}

.mv7-preferences-workspace .mv7-tab-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.mv7-preferences-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.mv7-preferences-fields label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--v2-muted);
  font-size: 11px;
}

.mv7-preferences-fields select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 0 12px;
}

.mv7-preferences-workspace #settings-currency-rate-hint[hidden] {
  display: none;
}

.mv7-preferences-workspace .mv7-profile-switcher-card {
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.mv7-preferences-workspace .mv7-tab-rail {
  grid-template-columns: minmax(0, 1fr);
}

.mv7-preferences-workspace .mv7-profile-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.mv7-preferences-workspace .mv7-profile-chip {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 10px 8px 9px;
  border: 1px solid var(--v2-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mv7-preferences-workspace .mv7-profile-chip:hover {
  border-color: var(--v2-line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.mv7-preferences-workspace .mv7-profile-chip:active {
  transform: translateY(1px);
}

.mv7-preferences-workspace .mv7-profile-chip:focus-visible {
  outline: 2px solid var(--v2-green-bright);
  outline-offset: -2px;
}

.mv7-preferences-workspace .mv7-profile-chip.is-active {
  border-color: rgba(45, 222, 152, 0.42);
  background: rgba(45, 222, 152, 0.07);
}

.mv7-preferences-workspace .mv7-profile-chip-avatar {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
  font-size: 16px;
}

.mv7-preferences-workspace .mv7-profile-chip.is-active .mv7-profile-chip-avatar {
  border-color: var(--v2-green);
  box-shadow: inset 0 0 0 2px rgba(45, 222, 152, 0.32);
}

.mv7-preferences-workspace .mv7-profile-chip-edit {
  right: 3px;
  bottom: 3px;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: rgba(7, 12, 10, 0.82);
}

.mv7-preferences-workspace .mv7-profile-chip-edit svg {
  width: 9px;
  height: 9px;
}

.mv7-preferences-workspace .mv7-profile-chip > span:last-child {
  display: block;
  width: 100%;
  line-height: 1.25;
  text-align: center;
}

.mv7-preferences-workspace .mv7-profile-chip-add {
  border-style: dashed;
}

.mv7-preferences-workspace .mv7-profile-region-summary {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.mv7-preferences-workspace .mv7-profile-region-summary dd {
  white-space: normal;
  overflow-wrap: anywhere;
}

:root[data-resolved-theme='light'] .mv7-preferences-workspace .mv7-profile-chip {
  background: rgba(248, 250, 252, 0.78);
}

:root[data-resolved-theme='light'] .mv7-preferences-workspace .mv7-profile-chip:hover {
  background: #fff;
}

:root[data-resolved-theme='light'] .mv7-preferences-workspace .mv7-profile-chip.is-active {
  border-color: rgba(10, 150, 102, 0.38);
  background: rgba(16, 185, 129, 0.08);
}

@container (min-width: 780px) {
  .mv7-preferences-workspace .mv7-tab-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  }

  .mv7-preferences-workspace .mv7-tab-main {
    display: contents;
  }

  .mv7-preferences-workspace .mv7-preferences-locale-card {
    grid-column: 1;
    grid-row: 1;
  }

  .mv7-preferences-workspace .mv7-tab-rail {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .mv7-preferences-workspace .mv7-profile-region {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@container (max-width: 520px) {
  .mv7-preferences-workspace .mv7-preferences-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.mv7-community-profile-bio {
  margin-top: 8px !important;
  max-width: 54ch;
  white-space: normal !important;
}

.mv7-community-profile-bio[hidden] {
  display: none;
}

.mv7-community-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@media (max-width: 1050px) and (min-width: 769px) {
  .mv7-profile-editor-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .mv7-profile-editor-hero {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .mv7-profile-avatar-wrap,
  .mv7-profile-editor-avatar {
    width: 98px;
    height: 98px;
  }

  .mv7-profile-photo-button {
    grid-column: 2;
    justify-self: start;
  }

  .mv7-profile-preview-avatar {
    width: 104px;
    height: 104px;
  }

  .mv7-preferences-workspace .mv7-tab-layout {
    grid-template-columns: 1fr;
  }
}
