/* ===== extrait de index.html : style #22 ===== */
  /*
    ==========================================================
    GRFTSH — Profil / réglages
    ==========================================================
  */

  #profile-view {
    padding-bottom:
      calc(110px + env(safe-area-inset-bottom));
  }


  /*
    ----------------------------------------------------------
    Formulaire : un peu plus compact, moins "formulaire admin"
    ----------------------------------------------------------
  */

  #profile-view .profile-section {
    margin-bottom: 18px;
  }

  #profile-view .profile-section > label {
    display: block;

    margin-bottom: 7px;

    color: #f1f1f1;

    font-size: 12px;
    font-weight: 750;
  }


  #profile-display-name-input,
  #profile-username-input,
  #profile-language {
    min-height: 44px;

    padding: 0 12px;

    border: 1px solid #292929;
    border-radius: 12px;

    background: #0d0d0d;
    color: #fff;

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


  #profile-bio {
    min-height: 92px;

    padding: 11px 12px;

    border: 1px solid #292929;
    border-radius: 12px;

    background: #0d0d0d;
    color: #fff;

    line-height: 1.45;

    resize: vertical;

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


  #profile-display-name-input:focus,
  #profile-username-input:focus,
  #profile-language:focus,
  #profile-bio:focus {
    outline: none;

    border-color: #515151;
    background: #101010;
  }


  /*
    ----------------------------------------------------------
    Le bouton Enregistrer disparaît.
    Le JS plus bas déclenche son handler existant.
    ----------------------------------------------------------
  */

  #profile-save {
    display: none !important;
  }


  /*
    ----------------------------------------------------------
    NSFW
    ----------------------------------------------------------
  */

  #profile-view
  .profile-section:has(#profile-show-nsfw) {
    position: relative;

    min-height: 76px;

    margin-top: 20px;
    margin-bottom: 24px;

    padding:
      14px
      76px
      14px
      14px;

    border: 1px solid #292929;
    border-radius: 14px;

    background: #0d0d0d;
  }


  #profile-view
  .profile-section:has(#profile-show-nsfw)
  label {
    margin-bottom: 4px;
  }


  #profile-show-nsfw {
    -webkit-appearance: none;
    appearance: none;

    position: absolute;

    top: 50%;
    right: 15px;

    width: 48px;
    height: 28px;

    margin: 0;

    transform: translateY(-50%);

    border: 1px solid #444;
    border-radius: 999px;

    background: #242424;

    cursor: pointer;

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


  #profile-show-nsfw::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background: #d8d8d8;

    box-shadow:
      0 1px 3px rgba(0,0,0,.35);

    transition:
      transform .18s ease,
      background .18s ease;
  }


  #profile-show-nsfw:checked {
    /*
      Vert sombre :
      volontairement sobre, pas "validation flashy".
    */
    background: #173c2a;
    border-color: #285f43;
  }


  #profile-show-nsfw:checked::before {
    transform: translateX(20px);

    background: #f2f2f2;
  }


  #profile-show-nsfw:focus-visible {
    outline: 2px solid #557a65;
    outline-offset: 3px;
  }


  /*
    ----------------------------------------------------------
    Compte et sécurité
    ----------------------------------------------------------
  */

  #profile-view .account-security {
    margin-top: 30px;

    padding-top: 20px;

    border-top:
      1px solid rgba(255,255,255,.10);
  }


  #profile-view
  .account-security > label {
    display: block;

    margin-bottom: 10px;

    color: #f0f0f0;

    font-size: 13px;
    font-weight: 800;
  }


  /*
    Déconnexion :
    action secondaire, compacte.
  */

  #profile-logout {
    display: inline-flex;

    width: auto !important;
    max-width: 100%;
    min-height: 40px;

    align-items: center;
    justify-content: center;

    margin-top: 2px !important;

    padding: 0 16px !important;

    border: 1px solid #333 !important;
    border-radius: 12px !important;

    background: #171717 !important;
    color: #e9e9e9 !important;

    font-size: 13px !important;
    font-weight: 750 !important;
  }


  #profile-logout:hover {
    background: #1d1d1d !important;
  }


  /*
    ----------------------------------------------------------
    Comptes bloqués
    ----------------------------------------------------------
  */

  .blocked-accounts-section {
    margin-top: 22px !important;

    padding-top: 18px !important;

    border-top:
      1px solid rgba(255,255,255,.08) !important;
  }


  .blocked-accounts-heading {
    font-size: 14px;
    font-weight: 800;
  }


  .blocked-accounts-help {
    max-width: 520px;

    margin-top: 5px !important;

    color: #8e8e8e !important;

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


  .blocked-accounts-list {
    margin-top: 10px !important;
  }


  .blocked-account-empty {
    color: #777 !important;

    font-size: 12px !important;
  }


  /*
    S'il n'y a personne de bloqué, inutile de montrer
    deux phrases qui disent pratiquement la même chose.
  */

  .blocked-accounts-section:has(.blocked-account-empty)
  .blocked-accounts-help {
    display: none;
  }


  .blocked-account-row {
    padding: 10px 12px !important;

    border-radius: 12px !important;

    background: #0d0d0d !important;
  }


  .blocked-account-unblock {
    min-height: 36px !important;

    padding: 7px 12px !important;

    border-radius: 10px !important;

    font-size: 12px !important;
  }


  /*
    ----------------------------------------------------------
    Suppression des publications
    ----------------------------------------------------------
  */

  #profile-delete-posts {
    display: inline-flex;

    width: auto !important;
    max-width: 100%;
    min-height: 40px;

    align-items: center;
    justify-content: center;

    margin-top: 24px !important;

    padding: 0 16px !important;

    border: 1px solid #d1d1d1 !important;
    border-radius: 12px !important;

    background: #d1d1d1 !important;
    color: #111 !important;

    font-size: 13px !important;
    font-weight: 750 !important;
  }


  #profile-delete-posts:hover {
    background: #e0e0e0 !important;
    border-color: #e0e0e0 !important;
  }


  /*
    Mobile très étroit :
    les actions peuvent reprendre toute la largeur
    seulement si elles n'ont vraiment plus de place.
  */

  @media (max-width: 360px) {
    #profile-logout,
    #profile-delete-posts {
      width: 100% !important;
    }
  }

/* ===== extrait de index.html : style #23 ===== */
  /*
    ==========================================================
    LANGUE — ligne de réglage compacte
    ==========================================================
  */

  #profile-view
  .profile-section:has(#profile-language) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 56px;

    margin-top: 20px;
    margin-bottom: 12px;

    padding: 0 14px;

    border: 1px solid #292929;
    border-radius: 14px;

    background: #0d0d0d;
  }


  #profile-view
  .profile-section:has(#profile-language)
  > label {
    flex: 1 1 auto;

    margin: 0;

    font-size: 13px;
    font-weight: 750;
  }


  #profile-language {
    flex: 0 1 auto;

    width: auto;
    min-width: 135px;
    min-height: 42px;

    padding:
      0
      26px
      0
      10px;

    border: 0 !important;
    border-radius: 10px;

    background-color: transparent !important;

    color: #dcdcdc;

    font-size: 13px;

    text-align: right;
    text-align-last: right;

    cursor: pointer;
  }


  #profile-language:focus {
    outline: none;

    background-color:
      rgba(255,255,255,.035) !important;
  }



  /*
    ==========================================================
    NSFW — même famille visuelle que Langue
    ==========================================================
  */

  #profile-view
  .profile-section:has(#profile-show-nsfw) {
    min-height: 82px;

    margin-top: 0;
    margin-bottom: 24px;

    padding:
      13px
      72px
      13px
      14px;

    border-radius: 14px;
  }


  #profile-view
  .profile-section:has(#profile-show-nsfw)
  label {
    font-size: 13px;
  }


  #profile-view
  .profile-section:has(#profile-show-nsfw)
  small,
  #profile-view
  .profile-section:has(#profile-show-nsfw)
  p {
    line-height: 1.35;
  }



  /*
    ==========================================================
    COMPTE ET SÉCURITÉ
    ==========================================================
  */

  #profile-view
  .account-security {
    margin-top: 18px;

    padding-top: 18px;
  }


  /*
    L'ancienne liste reste dans le DOM :
    elle continue d'être alimentée par loadBlockedUsers(),
    mais devient notre source pour le compteur.
  */

  .blocked-accounts-section.grftsh-block-summary-ready
  > .blocked-accounts-heading,

  .blocked-accounts-section.grftsh-block-summary-ready
  > .blocked-accounts-help,

  .blocked-accounts-section.grftsh-block-summary-ready
  > .blocked-accounts-list {
    display: none !important;
  }


  .blocked-accounts-section {
    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
  }


  .blocked-accounts-summary {
    display: flex;

    width: 100%;
    min-height: 52px;

    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 0 13px;

    border: 1px solid #292929;
    border-radius: 13px;

    background: #0d0d0d;
    color: #fff;

    font: inherit;

    cursor: pointer;

    text-align: left;
  }


  .blocked-accounts-summary:hover {
    background: #111;
  }


  .blocked-accounts-summary:focus-visible {
    outline: 2px solid #555;
    outline-offset: 2px;
  }


  .blocked-accounts-summary-label {
    overflow: hidden;

    font-size: 13px;
    font-weight: 750;

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


  .blocked-accounts-summary-right {
    display: flex;

    flex: 0 0 auto;

    align-items: center;
    gap: 10px;

    color: #969696;
  }


  .blocked-accounts-summary-count {
    min-width: 18px;

    font-size: 13px;

    text-align: right;
  }


  .blocked-accounts-summary-chevron {
    font-size: 23px;
    font-weight: 300;
    line-height: 1;

    transform: translateY(-1px);
  }



  /*
    Déconnexion sous la ligne Comptes bloqués.
  */

  #profile-logout {
    margin-top: 12px !important;
  }



  /*
    ==========================================================
    PUBLICATIONS / ACTION DESTRUCTIVE
    ==========================================================
  */

  .profile-publications-actions {
    margin-top: 20px;

    padding-top: 17px;

    border-top:
      1px solid rgba(255,255,255,.08);
  }


  .profile-publications-actions-title {
    margin-bottom: 10px;

    color: #f0f0f0;

    font-size: 13px;
    font-weight: 800;
  }


  #profile-delete-posts {
    min-height: 40px;

    margin-top: 0 !important;

    padding: 0 14px !important;

    border:
      1px solid #4a4a4a !important;

    border-radius: 11px !important;

    background:
      transparent !important;

    color: #bdbdbd !important;

    font-size: 12px !important;
    font-weight: 750 !important;
  }


  #profile-delete-posts:hover {
    border-color:
      #626262 !important;

    background:
      rgba(255,255,255,.035) !important;

    color:
      #dedede !important;
  }



  /*
    ==========================================================
    SOUS-VUE : COMPTES BLOQUÉS
    ==========================================================
  */

  #blocked-users-panel {
    position: fixed;

    inset: 0;

    z-index: 1900;

    overflow-y: auto;

    background: #050505;
    color: #fff;

    overscroll-behavior: contain;
  }


  #blocked-users-panel[hidden] {
    display: none;
  }


  .blocked-users-panel-inner {
    width: 100%;
    max-width: 620px;

    min-height: 100%;

    margin: 0 auto;

    padding:
      max(14px, env(safe-area-inset-top))
      20px
      calc(40px + env(safe-area-inset-bottom));
  }


  .blocked-users-panel-header {
    display: grid;

    grid-template-columns:
      44px
      1fr
      44px;

    align-items: center;

    min-height: 52px;

    margin-bottom: 18px;

    border-bottom:
      1px solid rgba(255,255,255,.09);
  }


  .blocked-users-panel-back {
    display: grid;

    width: 40px;
    height: 40px;

    place-items: center;

    padding: 0;

    border: 0;

    background: transparent;
    color: #fff;

    font-size: 28px;
    font-weight: 300;

    cursor: pointer;
  }


  .blocked-users-panel-title {
    overflow: hidden;

    margin: 0;

    font-size: 16px;
    font-weight: 800;

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


  .blocked-users-panel-description {
    margin:
      0
      0
      18px;

    color: #858585;

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


  .blocked-users-panel-list {
    display: grid;

    gap: 9px;
  }


  .blocked-users-panel-empty {
    padding:
      22px
      0;

    color: #777;

    font-size: 13px;

    text-align: center;
  }


  .blocked-users-panel-row {
    display: flex;

    min-height: 60px;

    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding:
      10px
      11px;

    border:
      1px solid #292929;

    border-radius: 13px;

    background: #0d0d0d;
  }


  .blocked-users-panel-user {
    min-width: 0;
  }


  .blocked-users-panel-name {
    overflow: hidden;

    font-size: 14px;
    font-weight: 800;

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


  .blocked-users-panel-username {
    overflow: hidden;

    margin-top: 2px;

    color: #888;

    font-size: 12px;

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


  .blocked-users-panel-unblock {
    flex: 0 0 auto;

    min-height: 36px;

    padding:
      0
      12px;

    border:
      1px solid #3c3c3c;

    border-radius: 10px;

    background: #171717;
    color: #fff;

    font: inherit;
    font-size: 12px;
    font-weight: 750;

    cursor: pointer;
  }


  .blocked-users-panel-unblock:hover {
    background: #202020;
  }


  .blocked-users-panel-unblock:disabled {
    opacity: .5;

    cursor: default;
  }



  /*
    Très petit écran.
  */

  @media (max-width: 360px) {

    #profile-view
    .profile-section:has(#profile-language) {
      gap: 8px;
    }


    #profile-language {
      min-width: 118px;
    }


    .blocked-users-panel-inner {
      padding-left: 14px;
      padding-right: 14px;
    }

  }

/* ===== extrait de index.html : style #34 ===== */
  /*
    Username :
    on conserve le conteneur extérieur,
    mais on supprime la seconde bordure intérieure.
  */

  #profile-username-input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;

    min-height: 40px;

    padding-left: 4px !important;
  }

  #profile-username-input:focus {
    border: 0 !important;
    background: transparent !important;
  }


  /*
    NSFW :
    une seule carte, pas une carte dans une carte.
  */

  #profile-view
  .profile-section:has(#profile-show-nsfw) {
    min-height: 72px;

    padding:
      14px
      76px
      14px
      14px;

    background: #0d0d0d;
  }

  #profile-view
  .profile-section:has(#profile-show-nsfw)
  > div,
  #profile-view
  .profile-section:has(#profile-show-nsfw)
  > label {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }


  /*
    Zone sécurité plus compacte.
  */

  #profile-view .account-security {
    margin-top: 24px;
    padding-top: 18px;
  }

  .blocked-accounts-section {
    margin-top: 18px !important;
    padding-top: 16px !important;
  }


  /*
    Suppression :
    toujours identifiable,
    mais moins lumineuse.
  */

  #profile-delete-posts {
    background: #b9b9b9 !important;
    border-color: #b9b9b9 !important;
    color: #111 !important;
  }

  #profile-delete-posts:hover {
    background: #c8c8c8 !important;
    border-color: #c8c8c8 !important;
  }


  /*
    Un petit peu plus d'air sous les titres de section.
  */

  .blocked-accounts-heading,
  #profile-view .account-security > label {
    letter-spacing: .01em;
  }
