/* ========================================================================== */
/* ETHNOS R146 — Annuaire, favoris et correction ciblée du bas Tchat          */
/* Base : R145. Corrections validées le 3 août 2026.                          */
/* ========================================================================== */

/* 1 — Le panneau Tchat rejoint réellement la barre légale.                   */
/* La grille gagne les 8 px qui découvraient le faux prolongement crème,      */
/* tandis que la vue centrale conserve sa hauteur précédente.                 */
@media (min-width:901px){
  html[data-ethnos-ui="discord-r111"] body .memberLayout{
    bottom:var(--footer-legal) !important;
  }
  html[data-ethnos-ui="discord-r111"] body .memberWorkspace{
    height:calc(100% - var(--r110-dock-height) - 17px) !important;
  }
}
@media (max-width:900px){
  html[data-ethnos-ui="discord-r111"] body .memberLayout{
    bottom:var(--footer-legal) !important;
  }
  html[data-ethnos-ui="discord-r111"] body .memberWorkspace{
    height:calc(100% - 62px) !important;
  }
}

/* 2 — Recherche Messages : 40 px de moins et centrage réel sur les formats   */
/* 1366 × 768 et 1536 × 864.                                                  */
@media (width:1366px) and (height:768px),
       (width:1536px) and (height:864px){
  html body .memberMessagesDrawer .memberMessageSearch{
    box-sizing:border-box !important;
    width:calc(100% - 118px) !important;
    max-width:calc(100% - 118px) !important;
    margin-left:auto !important;
    margin-right:auto !important;
    justify-self:center !important;
    transform:none !important;
  }
}

/* 3 — Annuaire : palette, typographies et hiérarchie communes aux volets. */
html body .memberDirectoryShell{
  --directory-main:#fff8ee;
  --directory-alt:#f4f8f7;
  --directory-warm:#fff2e3;
  --directory-navy:#071a39;
  --directory-orange:#f26722;
  color:var(--directory-navy) !important;
  font-family:var(--ethnos-official-title) !important;
  background:var(--directory-main) !important;
  background-image:none !important;
}
html body .memberDirectoryHeader{
  box-sizing:border-box !important;
  padding:clamp(20px,2vw,32px) clamp(18px,1.7vw,28px) clamp(16px,1.35vw,22px) !important;
  border-bottom:1px solid rgba(7,26,57,.12) !important;
  background:var(--directory-main) !important;
}
html body .memberDirectoryHeader h2{
  margin:0 !important;
  color:var(--directory-navy) !important;
  font-family:var(--ethnos-official-title) !important;
  font-size:clamp(26px,1.85vw,36px) !important;
  font-weight:800 !important;
  line-height:1.02 !important;
  letter-spacing:-.025em !important;
}
html body .memberDirectoryHeader h2 small{
  color:var(--directory-orange) !important;
  font-family:var(--ethnos-official-title) !important;
  font-size:.48em !important;
  font-weight:800 !important;
  letter-spacing:-.01em !important;
}
html body .memberDirectoryHeader p{
  max-width:36em !important;
  margin:9px auto 0 !important;
  color:#607481 !important;
  font-family:Manrope,Inter,"Segoe UI",Arial,sans-serif !important;
  font-size:clamp(11px,.78vw,14px) !important;
  font-weight:600 !important;
  line-height:1.42 !important;
}
html body .memberDirectoryContent{
  padding:clamp(15px,1.35vw,22px) clamp(14px,1.25vw,20px) 6px !important;
  background:var(--directory-main) !important;
}
html body .memberDirectorySection{
  border-bottom-color:rgba(7,26,57,.12) !important;
}
html body .memberDirectorySection h3{
  color:var(--directory-navy) !important;
  font-family:var(--ethnos-official-title) !important;
  font-size:clamp(18px,1.22vw,24px) !important;
  font-weight:750 !important;
  letter-spacing:-.018em !important;
}
html body .memberDirectoryDrawer label,
html body .memberDirectoryNameForm>p{
  color:#667985 !important;
  font-family:Manrope,Inter,"Segoe UI",Arial,sans-serif !important;
}

/* Recherche géographique : deux champs superposés et chevrons identiques. */
html body .memberDirectoryLocationForm{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:10px !important;
}
html body .memberDirectoryLocationForm>.realFlagSelect,
html body .memberDirectoryLocationForm>select,
html body .memberDirectoryLocationForm>button{
  grid-column:1 !important;
  width:100% !important;
}
html body .memberDirectoryLocationForm .realFlagSelectButton{
  color:#fffaf3 !important;
  font-family:Manrope,Inter,"Segoe UI",Arial,sans-serif !important;
}
html body .memberDirectoryLocationForm .realFlagSelectButton::after{
  content:"" !important;
  width:8px !important;
  height:8px !important;
  border-right:2px solid #d7e1e3 !important;
  border-bottom:2px solid #d7e1e3 !important;
  transform:translateY(-68%) rotate(45deg) !important;
  right:15px !important;
  top:50% !important;
}
html body .memberDirectoryLocationForm>select{
  appearance:none !important;
  -webkit-appearance:none !important;
  padding-right:42px !important;
  background-color:rgba(255,255,255,.74) !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5.25 7 9l4-3.75' fill='none' stroke='%2383949e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 14px center !important;
}

/* Résultats : un bandeau pleine largeur, crème et cliquable. */
html body .memberDirectoryShell.isResultsMode .memberDirectoryContent{
  padding:clamp(14px,1.2vw,20px) clamp(12px,1vw,17px) 5px !important;
  background:var(--directory-main) !important;
}
html body .memberDirectoryResults{
  width:100% !important;
  gap:9px !important;
}
html body .memberDirectoryResult{
  box-sizing:border-box !important;
  width:100% !important;
  max-width:none !important;
  min-height:58px !important;
  margin:0 !important;
  padding:8px 10px !important;
  border:1px solid rgba(7,26,57,.14) !important;
  border-radius:11px !important;
  background:var(--directory-alt) !important;
  color:var(--directory-navy) !important;
  box-shadow:0 5px 14px rgba(7,26,57,.045) !important;
  cursor:pointer !important;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease !important;
}
html body .memberDirectoryResult:nth-child(even){background:var(--directory-warm) !important}
html body .memberDirectoryResult:hover,
html body .memberDirectoryResult:focus-visible{
  border-color:rgba(242,103,34,.50) !important;
  box-shadow:0 9px 20px rgba(7,26,57,.09) !important;
  transform:translateY(-1px) !important;
  outline:none !important;
}
html body .memberDirectoryIdentity strong,
html body .memberDirectoryPresence span{
  color:var(--directory-navy) !important;
  font-family:var(--ethnos-official-title) !important;
}
html body .memberDirectoryIdentity small{color:#667b87 !important}
html body .memberDirectoryPresence.isVisible span{color:#267850 !important}
html body .memberDirectoryPresence.isDiscreet span{color:#a86626 !important}
html body .memberDirectoryPresence.isOffline span{color:#6e7b82 !important}

/* 4 — Petite fiche d’identité centrale ouverte depuis un résultat Annuaire. */
html.directoryIdentityOpen body{overflow:hidden !important}
.memberDirectoryIdentityModal[hidden]{display:none !important}
.memberDirectoryIdentityModal{
  position:fixed;
  inset:0;
  z-index:1600;
  display:grid;
  place-items:center;
  padding:20px;
  font-family:var(--ethnos-official-title);
}
.memberDirectoryIdentityBackdrop{
  position:absolute;
  inset:0;
  background:rgba(2,15,23,.58);
  backdrop-filter:blur(7px);
}
.memberDirectoryIdentityCard{
  position:relative;
  width:min(480px,calc(100vw - 34px));
  max-height:min(720px,calc(100vh - 34px));
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
  border:1px solid rgba(49,209,207,.30);
  border-radius:18px;
  background:#fff8ee;
  color:#071a39;
  box-shadow:0 28px 90px rgba(0,0,0,.42);
}
.memberDirectoryIdentityCardHeader{
  display:grid;
  grid-template-columns:82px minmax(0,1fr);
  align-items:center;
  gap:16px;
  padding:22px;
  background:linear-gradient(118deg,#03141e 0%,#062431 72%,#083241 100%);
}
.memberDirectoryIdentityAvatar{
  width:78px;
  height:78px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:3px solid #f26722;
  border-radius:50%;
  background:#0a3042;
  color:#fffaf3;
  font-size:22px;
  font-weight:800;
}
.memberDirectoryIdentityAvatar img{width:100%;height:100%;object-fit:cover}
.memberDirectoryIdentityCardHeader span{
  color:#31d1cf;
  font-size:10px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.memberDirectoryIdentityCardHeader h3{
  margin:5px 0 3px;
  color:#fffaf3;
  font-family:var(--ethnos-official-title);
  font-size:clamp(23px,2vw,31px);
  font-weight:800;
  line-height:1.04;
}
.memberDirectoryIdentityCardHeader p{margin:0;color:#afc1c7;font:600 12px/1.4 Manrope,Inter,sans-serif}
.memberDirectoryIdentityBody{
  min-height:0;
  overflow-y:auto;
  padding:18px 20px;
  background:#fff8ee;
}
.memberDirectoryIdentityBody section{
  padding:0 0 15px;
  margin:0 0 15px;
  border-bottom:1px solid rgba(7,26,57,.11);
}
.memberDirectoryIdentityBody section:last-child{margin-bottom:0;border-bottom:0}
.memberDirectoryIdentityBody h4{
  margin:0 0 9px;
  color:#071a39;
  font-size:15px;
  font-weight:800;
}
.memberDirectoryIdentityBody p{margin:0;color:#566c79;font:600 12px/1.55 Manrope,Inter,sans-serif;white-space:pre-wrap}
.memberDirectoryIdentityFacts{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.memberDirectoryIdentityFacts div{
  padding:11px;
  border:1px solid rgba(7,26,57,.10);
  border-radius:10px;
  background:#f4f8f7;
}
.memberDirectoryIdentityFacts small{display:block;color:#728690;font:700 9px Manrope,Inter,sans-serif;text-transform:uppercase;letter-spacing:.08em}
.memberDirectoryIdentityFacts strong{display:block;margin-top:4px;color:#071a39;font-size:12px}
.memberDirectoryIdentityInterests{display:flex;flex-wrap:wrap;gap:7px}
.memberDirectoryIdentityInterests span{
  padding:6px 9px;
  border:1px solid rgba(49,209,207,.30);
  border-radius:999px;
  background:#f4f8f7;
  color:#536a77;
  font:650 10px Manrope,Inter,sans-serif;
}
.memberDirectoryIdentityTrophies{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.memberDirectoryIdentityTrophies article{
  min-width:0;
  display:grid;
  justify-items:center;
  gap:6px;
  padding:10px 6px;
  border:1px solid rgba(7,26,57,.10);
  border-radius:10px;
  background:#fff2e3;
  text-align:center;
}
.memberDirectoryIdentityTrophies img{width:48px;height:48px;object-fit:contain}
.memberDirectoryIdentityTrophies span{color:#526875;font:700 9px/1.3 Manrope,Inter,sans-serif}
.memberDirectoryIdentityClose{
  width:calc(100% - 28px);
  min-height:46px;
  margin:10px 14px 14px;
  border:1px solid #071a39;
  border-radius:10px;
  background:#071a39;
  color:#fffaf3;
  font-family:var(--ethnos-official-title);
  font-size:15px;
  font-weight:800;
  cursor:pointer;
}
.memberDirectoryIdentityClose:hover,.memberDirectoryIdentityClose:focus-visible{filter:brightness(1.09);outline:none}

/* 5 — Salons favoris : fiche sur toute la largeur et plus compacte. */
html body .memberFavoritesList{
  box-sizing:border-box !important;
  width:100% !important;
  padding:clamp(12px,1.2vw,18px) clamp(10px,.9vw,14px) !important;
  gap:8px !important;
}
html body .memberFavoriteSalonRow{
  box-sizing:border-box !important;
  width:100% !important;
  max-width:none !important;
  min-height:54px !important;
  padding:8px 11px !important;
  gap:9px !important;
}
html body .memberFavoriteSalonRow h3{
  font-size:clamp(15px,1vw,19px) !important;
  line-height:1.05 !important;
}
html body .memberFavoriteSalonRow p{margin-top:2px !important}
html body .memberFavoriteSalonRow button{
  min-height:36px !important;
  padding:0 13px !important;
}

@media (max-width:1450px) and (max-height:820px){
  html body .memberDirectoryHeader{padding:13px 12px 10px !important}
  html body .memberDirectoryHeader h2{font-size:22px !important}
  html body .memberDirectoryHeader p{font-size:9px !important}
  html body .memberDirectoryContent{padding:9px 10px 3px !important}
  html body .memberDirectorySection h3{font-size:15px !important}
  .memberDirectoryIdentityCard{max-height:calc(100vh - 22px)}
}
