.profile-hub-topbar {
  width: 100%;
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 12px;

  margin-bottom: 22px;
}

.profile-hub-back {
  flex: 0 0 auto;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  padding: 0;

  border: 1px solid var(--border, #292929);
  border-radius: 13px;

  background: var(--surface-2, #111);
  color: var(--text, #fff);

  cursor: pointer;
}

.profile-hub-back svg {
  width: 22px;
  height: 22px;

  fill: none;

  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-hub-title,
#profile-hub-title {
  min-width: 0;

  margin: 0;

  overflow: hidden;

  font-size: 22px;
  line-height: 1.2;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.profile-hub-home {
  width: 100%;

  display: grid;
  gap: 18px;
}

.profile-hub-home[hidden],
.profile-page[hidden] {
  display: none;
}

.profile-hub-intro {
  margin: 0;

  color: var(--text-muted, #999);

  font-size: 14px;
  line-height: 1.5;
}


.profile-hub-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(175px, 1fr));

  gap: 14px;
}


.profile-hub-card {
  min-width: 0;
  min-height: 190px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 10px;

  padding: 24px 18px;

  border: 1px solid var(--border, #292929);
  border-radius: 18px;

  background: var(--surface-2, #111);
  color: inherit;

  font: inherit;
  text-align: center;

  cursor: pointer;

  transition:
    border-color .16s ease,
    transform .16s ease,
    background .16s ease;
}

.profile-hub-card:hover {
  transform: translateY(-2px);

  border-color: #555;
}

.profile-hub-card:active {
  transform: translateY(0);
}


.profile-hub-icon {
  width: 54px;
  height: 54px;

  display: grid;
  place-items: center;

  margin-bottom: 2px;

  color: var(--text, #fff);
}

.profile-hub-icon svg {
  width: 100%;
  height: 100%;

  fill: none;

  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.profile-hub-card strong {
  display: block;

  font-size: 15px;
  line-height: 1.25;
}

.profile-hub-card small {
  display: block;

  max-width: 215px;

  color: var(--text-muted, #888);

  font-size: 12px;
  line-height: 1.45;
}


.profile-page {
  width: 100%;
  min-width: 0;
}

.profile-page-placeholder {
  width: 100%;

  padding: 22px;

  box-sizing: border-box;

  border: 1px solid var(--border, #292929);
  border-radius: 18px;

  background: var(--surface-2, #111);
}

.profile-page-placeholder p {
  margin: 0;

  color: var(--text-muted, #999);

  font-size: 14px;
  line-height: 1.55;
}


/*
  La sécurité est désormais une page autonome :
  plus besoin du séparateur de l'ancien profil.
*/

.profile-page[data-profile-page="security"]
.account-security {
  margin-top: 0;
  padding-top: 0;

  border-top: 0;
}


/*
  Le bouton est conservé pour la logique
  d'autosave existante.
*/

.profile-save-holder {
  margin: 0;
}


@media (max-width: 699px) {
  .profile-hub-topbar {
    margin-bottom: 18px;
  }

  .profile-hub-back {
    width: 40px;
    height: 40px;

    border-radius: 12px;
  }

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

    gap: 10px;
  }

  .profile-hub-card {
    min-height: 158px;

    padding: 18px 10px;

    border-radius: 14px;
  }

  .profile-hub-icon {
    width: 44px;
    height: 44px;
  }

  .profile-hub-card strong {
    font-size: 13px;
  }

  .profile-hub-card small {
    font-size: 11px;
  }
}


@media (max-width: 380px) {
  .profile-hub-grid {
    grid-template-columns: 1fr;
  }
}


/*
  ============================================================
  PROFILE HUB — DÉCONNEXION
  Action globale de compte, placée discrètement dans le header.
  ============================================================
*/

#profile-view .profile-hub-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

#profile-view .profile-hub-logout {
  width: auto !important;
  min-width: 0 !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 11px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.025) !important;
  color: #9d9d9d !important;
  font: inherit;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

#profile-view .profile-hub-logout:hover {
  border-color: rgba(255,255,255,.17) !important;
  background: rgba(255,255,255,.055) !important;
  color: #e0e0e0 !important;
}

#profile-view .profile-hub-logout:focus-visible {
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}

#profile-view .profile-hub-logout:disabled {
  opacity: .45;
  cursor: wait;
}

@media (max-width: 699px) {
  #profile-view .profile-hub-topbar {
    gap: 9px;
  }

  #profile-view .profile-hub-logout {
    width: auto !important;
    min-height: 32px !important;
    padding: 0 9px !important;
    font-size: 10px !important;
  }
}

/* GRFTSH PROFILE HUB LOGOUT V1 */


/*
  ============================================================
  GRFTSH PROFILE NSFW QUICK TOGGLE V1
  ============================================================
*/

#profile-view .profile-hub-topbar {
  grid-template-columns:
    auto minmax(0, 1fr) auto auto;
}

#profile-view .profile-hub-nsfw {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #9d9d9d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  cursor: pointer;
  user-select: none;
}

#profile-view .profile-hub-nsfw-label {
  white-space: nowrap;
}

#profile-view .profile-hub-nsfw-switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-block;
}

#profile-view .profile-hub-nsfw-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

#profile-view .profile-hub-nsfw-track {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  transition:
    border-color .16s ease,
    background .16s ease;
}

#profile-view .profile-hub-nsfw-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8a8a8a;
  transition:
    transform .16s ease,
    background .16s ease;
}

#profile-view
.profile-hub-nsfw-switch
input:checked + .profile-hub-nsfw-track {
  border-color: rgba(255,70,120,.72);
  background: rgba(255,70,120,.14);
}

#profile-view
.profile-hub-nsfw-switch
input:checked + .profile-hub-nsfw-track::after {
  transform: translateX(14px);
  background: #ff4678;
}

#profile-view
.profile-hub-nsfw-switch
input:focus-visible + .profile-hub-nsfw-track {
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}

#profile-view .profile-hub-nsfw:has(input:disabled) {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 699px) {
  #profile-view .profile-hub-topbar {
    grid-template-columns:
      auto minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  #profile-view .profile-hub-nsfw {
    gap: 5px;
    font-size: 9px;
  }

  #profile-view .profile-hub-nsfw-switch {
    width: 31px;
    height: 19px;
  }

  #profile-view .profile-hub-nsfw-track::after {
    width: 11px;
    height: 11px;
  }

  #profile-view
  .profile-hub-nsfw-switch
  input:checked + .profile-hub-nsfw-track::after {
    transform: translateX(12px);
  }
}

@media (max-width: 420px) {
  #profile-view .profile-hub-nsfw-label {
    display: inline;
    font-size: 8px;
    letter-spacing: .03em;
  }

  #profile-view .profile-hub-nsfw {
    gap: 4px;
  }
}

/* GRFTSH INTERFACE LANGUAGE CUSTOM SELECT V1 */

#profile-view .profile-language-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#profile-view .profile-language-custom {
  position: relative;
  width: 100%;
}

#profile-view .profile-language-trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--border, #292929);
  border-radius: 12px;
  background: var(--surface-2, #111);
  color: var(--text, #f4f4f4);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

#profile-view .profile-language-trigger:hover,
#profile-view .profile-language-trigger:focus-visible {
  border-color: rgba(255,255,255,.30);
}

#profile-view .profile-language-trigger:focus-visible {
  outline: 2px solid rgba(255,255,255,.16);
  outline-offset: 2px;
}

#profile-view .profile-language-trigger-chevron {
  flex: 0 0 auto;
  color: #8f8f8f;
  font-size: 17px;
  line-height: 1;
  transition: transform .16s ease;
}

#profile-view
.profile-language-trigger[aria-expanded="true"]
.profile-language-trigger-chevron {
  transform: rotate(180deg);
}

#profile-view .profile-language-menu {
  position: absolute;
  z-index: 180;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  overflow: hidden;
  padding: 7px;
  border: 1px solid #2d2d2d;
  border-radius: 14px;
  background: #101010;
  box-shadow:
    0 18px 50px rgba(0,0,0,.62);
}

#profile-view .profile-language-menu[hidden] {
  display: none !important;
}

#profile-view .profile-language-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f2f2f2;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

#profile-view .profile-language-option:hover,
#profile-view .profile-language-option:focus-visible {
  background: rgba(255,255,255,.075);
  outline: none;
}

#profile-view
.profile-language-option[aria-selected="true"] {
  background: rgba(255,70,120,.10);
  color: #fff;
}

@media (max-width: 699px) {
  #profile-view .profile-language-trigger {
    min-height: 48px;
    font-size: 16px;
  }

  #profile-view .profile-language-option {
    min-height: 46px;
    font-size: 15px;
  }
}

/* GRFTSH INTERFACE LANGUAGE CUSTOM SELECT V1 */


/* ==========================================================
   GRFTSH PROFILE UUID V1
   ========================================================== */

#profile-view .profile-account-uuid {
  width: fit-content;
  max-width: 100%;

  display: inline-flex;
  align-items: center;
  gap: 5px;

  margin: 2px 0 0;
  padding: 0;

  border: 0;
  background: transparent;

  color: #727272;

  font: inherit;
  font-size: 11px;
  line-height: 1.4;

  text-align: left;

  cursor: copy;
}

#profile-view .profile-account-uuid[hidden] {
  display: none !important;
}

#profile-view .profile-account-uuid code {
  max-width: 100%;

  overflow-wrap: anywhere;

  color: #8d8d8d;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 11px;

  user-select: all;
}

#profile-view .profile-account-uuid:hover {
  color: #a0a0a0;
}

#profile-view .profile-account-uuid:hover code {
  color: #b5b5b5;
}

#profile-view .profile-account-uuid.is-copied {
  color: #c0c0c0;
}

#profile-view .profile-account-uuid.is-copied code {
  color: #fff;
}

#profile-view .profile-account-uuid:focus-visible {
  outline: 1px solid rgba(255,255,255,.28);
  outline-offset: 4px;
  border-radius: 3px;
}


@media (max-width: 699px) {

  #profile-view .profile-account-uuid,
  #profile-view .profile-account-uuid code {
    font-size: 10px;
  }

}

/* GRFTSH_AI_VIEW_PREFERENCE_V1 */
#profile-view .profile-hub-topbar {grid-template-columns: auto minmax(0,1fr) auto auto auto;}
#profile-view .profile-hub-ai {flex: 0 0 auto;}
@media (max-width:699px) {
  #profile-view .profile-hub-topbar {grid-template-columns: auto minmax(0,1fr) auto auto auto; gap: 5px;}
  #profile-view .profile-hub-ai {gap: 4px;}
}


/* GRFTSH PROFILE HUB MOBILE TITLE HIDE V1 */
@media (max-width: 699px) {
  #profile-view #profile-hub-title {
    display: none;
  }

  #profile-view .profile-hub-topbar {
    grid-template-columns: auto 1fr auto auto;
    gap: 10px;
  }
}


/* GRFTSH PROFILE MOBILE TOGGLES V2 */
@media (max-width: 699px) {

  #profile-view .profile-hub-topbar {
    grid-template-columns:
      auto minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  #profile-view .profile-hub-back {
    margin-right: 16px;
  }

  #profile-view .profile-hub-nsfw,
  #profile-view .profile-hub-ai {
    gap: 6px;
    color: #c5c5c5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .025em;
  }

  #profile-view .profile-hub-nsfw-label,
  #profile-view .profile-hub-ai-label {
    font-size: 11px;
  }

  #profile-view .profile-hub-nsfw-switch,
  #profile-view .profile-hub-ai-switch {
    width: 38px;
    height: 23px;
  }

  #profile-view .profile-hub-nsfw-track,
  #profile-view .profile-hub-ai-track {
    border-color: rgba(255,255,255,.35);
    background: rgba(255,255,255,.10);
  }

  #profile-view .profile-hub-nsfw-track::after,
  #profile-view .profile-hub-ai-track::after {
    width: 15px;
    height: 15px;
    background: #b5b5b5;
  }

  #profile-view .profile-hub-nsfw-switch
  input:checked + .profile-hub-nsfw-track::after,
  #profile-view .profile-hub-ai-switch
  input:checked + .profile-hub-ai-track::after {
    transform: translateX(15px);
    background: #ff4678;
  }

}
