/*
 * Agents SaaS — mobile first, tonalité proche landing (doré discret),
 * sans ombres portées ni effets hover chargés sur les cartes.
 */

/* ——— Header site agents (bande pleine largeur, fixe) ——— */
body.body-agents-shell {
  --agents-site-header-h: clamp(3.25rem, 10vw, 3.85rem);
}

.agents-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgb(226 232 240 / 0.65);
}

.agents-site-header__inner {
  box-sizing: border-box;
  max-width: 58rem;
  margin: 0 auto;
  padding: max(0.65rem, env(safe-area-inset-top)) 1.25rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.agents-site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #0f172a;
  flex-shrink: 0;
  min-width: 0;
}

.agents-site-brand__logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.agents-site-brand__name {
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .agents-site-brand:hover {
    color: #0c1222;
    text-decoration: none;
  }

  .agents-site-brand:hover .agents-site-brand__name {
    color: inherit;
  }
}

.agents-site-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
  min-width: 0;
}

.agents-site-header__pseudo {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: -0.02em;
  max-width: min(14rem, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agents-site-header__pseudo--fallback {
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
}

.agents-site-header__link {
  font-size: 0.84rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
}

.agents-site-header__link:hover {
  color: #0f172a;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.agents-site-header__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 999px;
  outline-offset: 3px;
}

.agents-site-header__account:hover {
  text-decoration: none;
}

.agents-site-header__account:focus-visible {
  outline: 2px solid var(--agents-focus);
  outline-offset: 2px;
  border-radius: 999px;
}

.agents-site-header__avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #64748b 0%, #334155 100%);
  border: 2px solid rgb(255 255 255 / 0.95);
  box-shadow: 0 0 0 1px rgb(226 232 240 / 0.95);
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .agents-site-header__account:hover .agents-site-header__avatar {
    filter: brightness(1.06);
  }
}

body.body-agents-shell .main.main--agents-shell {
  padding: var(--agents-site-header-h) 0 0;
}

body.body-agents-shell .main.main--agents-shell:has(.agents-surface:not(.agents-surface--chat)) {
  padding-top: calc(var(--agents-site-header-h) + 1.35rem);
}

body.body-agents-shell .main.main--agents-shell:has(.agents-surface--account) {
  padding-top: calc(var(--agents-site-header-h) + 0.75rem);
}

body.body-agents-shell:not(:has(.agents-surface--chat)) .main.main--agents-shell {
  min-height: 55vh;
}

body.body-agents-shell .agents-surface {
  padding-top: 0;
}

.agents-surface {
  --agents-ink: #0c1222;
  --agents-ink-soft: #334155;
  --agents-muted: #64748b;
  --agents-line: rgb(226 232 240 / 0.98);
  --agents-line-strong: rgb(203 213 225 / 0.95);
  --agents-bg: #ffffff;
  --agents-bg-soft: #f8fafc;
  --agents-gold-mid: #c9a227;
  --agents-gold-pale: #f5edd8;
  --agents-focus: rgb(100 116 139 / 0.35);

  box-sizing: border-box;
  min-height: min(100dvh, 100%);
  padding: 0 env(safe-area-inset-right) max(2rem, env(safe-area-inset-bottom))
    env(safe-area-inset-left);
  padding-top: max(0.75rem, env(safe-area-inset-top));
  color: var(--agents-ink);
  background: #fff;
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.agents-surface.agents-surface--chat {
  --agents-line: rgb(212 163 74 / 0.22);
  --agents-line-strong: rgb(212 163 74 / 0.38);
  --agents-focus: rgb(212 163 74 / 0.45);
}

/* Évite que min-height 100dvh du bloc précédent casse la mise en page conversation flex */
.agents-surface.agents-surface--chat {
  min-height: 0;
  padding-bottom: 0;
}

.agents-surface *,
.agents-surface *::before,
.agents-surface *::after {
  box-sizing: border-box;
}

/* Barre haute */
.agents-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 58rem;
  margin: 0 auto;
  padding: 0.65rem 1.25rem 0.25rem;
}

.agents-topbar--auth {
  max-width: 28rem;
}

.agents-topbar--auth-solo {
  justify-content: flex-start;
}

.agents-topbar__brand {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
  color: var(--agents-ink);
  text-decoration: none;
}

.agents-topbar__brand--small {
  font-size: 0.88rem;
  font-weight: 600;
}

.agents-topbar__brand:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.agents-topbar__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  text-align: right;
  min-width: 0;
}

.agents-topbar__email {
  font-size: 0.72rem;
  color: var(--agents-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 380px) {
  .agents-topbar__email {
    max-width: 16rem;
  }
}

.agents-link-quiet {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--agents-ink-soft);
  text-decoration: none;
}

.agents-link-quiet:hover {
  color: var(--agents-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.agents-link-gold {
  font-weight: 600;
  color: #8a6a1c;
  text-decoration: none;
}

.agents-link-gold:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* Page bibliothèque */
.agents-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 58rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
}

.agents-shell-hero {
  text-align: center;
  padding: 0 0 1.1rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgb(226 232 240 / 0.5);
}

.agents-shell-hero__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--agents-ink);
}

.agents-shell-hero__lead {
  margin: 0 auto;
  max-width: 34rem;
  font-size: clamp(0.9rem, 2.8vw, 0.98rem);
  line-height: 1.55;
  color: var(--agents-ink-soft);
}

.agents-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--agents-muted);
}

.agents-hero {
  text-align: center;
  padding: 1.25rem 0 1.75rem;
}

.agents-hero__titles {
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.agents-hero__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.45rem, 5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--agents-ink);
}

.agents-hero__title::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0.75rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--agents-gold-mid), transparent);
  opacity: 0.55;
}

.agents-hero__lead {
  margin: 0 auto;
  max-width: 28rem;
  font-size: clamp(0.9rem, 3.2vw, 1.02rem);
  line-height: 1.55;
  color: var(--agents-ink-soft);
}

/* Compte à rebours « recrues » (fin de période d’accès) */
.agents-recruits-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.7rem auto 0;
  font-variant-numeric: tabular-nums;
}

.agents-recruits-timer__prefix {
  font-size: 0.8rem;
  color: var(--agents-muted);
}

.agents-recruits-timer__row {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18rem;
}

.agents-recruits-timer__unit {
  display: inline-flex;
  align-items: baseline;
  gap: 0.08rem;
}

.agents-recruits-timer__value {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--agents-ink);
}

.agents-recruits-timer__suffix {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--agents-ink-soft);
}

.agents-recruits-timer__dot {
  font-size: 0.72rem;
  color: var(--agents-muted);
  margin: 0 0.15rem;
  opacity: 0.7;
}

/* Grille : une seule colonne, cartes empilées */
.agents-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 540px) {
  .agents-grid {
    gap: 1.15rem;
  }
}

.agents-grid__item {
  margin: 0;
}

/* Accueil experts : composition 2 + 2 + 1 (5e carte centrée) sur desktop */
.agents-grid.agents-grid--pentagon {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .agents-grid.agents-grid--pentagon {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    width: 100%;
    margin-inline: auto;
  }

  .agents-grid--pentagon .agents-grid__item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .agents-grid--pentagon .agents-grid__item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .agents-grid--pentagon .agents-grid__item:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  .agents-grid--pentagon .agents-grid__item:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  .agents-grid--pentagon .agents-grid__item:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    width: min(100%, 26rem);
  }
}

/* Onglets Experts / Ressources / Roadmap (alignés largeur header) */
.agents-shell-tabs {
  margin: 0 auto 1.5rem;
  padding: 0;
}

.agents-shell-tabs__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--agents-line-strong);
  overflow: hidden;
  background: rgb(255 255 255 / 0.75);
}

.agents-shell-tabs__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  min-height: 2.65rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--agents-ink-soft);
  text-decoration: none;
  border-right: 1px solid rgb(226 232 240 / 0.9);
  transition: background 0.15s ease, color 0.15s ease;
}

.agents-shell-tabs__tab:hover,
.agents-shell-tabs__tab:focus-visible {
  text-decoration: none;
}

.agents-shell-tabs__tab:last-child {
  border-right: 0;
}

.agents-shell-tabs__tab .bx {
  font-size: 1.1rem;
  opacity: 0.88;
}

.agents-shell-tabs__tab:hover {
  background: rgb(248 250 252);
  color: var(--agents-ink);
}

.agents-shell-tabs__tab.is-active {
  background: rgb(255 251 235 / 0.85);
  color: var(--agents-ink);
  box-shadow: inset 0 -2px 0 var(--agents-gold-mid);
}

.agents-shell-tabs__badge {
  min-width: 1.25rem;
  padding: 0.06rem 0.32rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgb(254 243 199 / 0.85);
  color: #7a5010;
  border: 1px solid rgb(201 162 39 / 0.28);
}

.agents-resources-pagehead {
  margin: 0 0 0.35rem;
}

.agents-shell-back {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.2rem 0.35rem 0.2rem 0.15rem;
  margin: 0 0 0 -0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--agents-muted);
  text-decoration: none;
  border-radius: 8px;
}

.agents-shell-back .bx {
  font-size: 1.35rem;
  line-height: 1;
  margin-top: 1px;
}

.agents-shell-back:hover {
  color: var(--agents-ink);
  background: rgb(248 250 252);
}

/* Back link — shared */
.agents-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--agents-muted);
  text-decoration: none;
  transition: color 0.12s ease;
}

.agents-back-link .bx {
  font-size: 1rem;
}

@media (hover: hover) and (pointer: fine) {
  .agents-back-link:hover {
    color: var(--agents-ink);
    text-decoration: none;
  }
}

/* Account page */
.agents-account-layout {
  max-width: 38rem;
  margin: 0 auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.agents-account-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.25rem 0 0.75rem;
  text-align: center;
}

.agents-account-identity__avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #c9a227 0%, #8b6914 100%);
  border: 2px solid rgb(255 255 255 / 0.95);
  box-shadow: 0 0 0 1px rgb(201 162 39 / 0.35), 0 2px 8px rgb(201 162 39 / 0.15);
  margin-bottom: 0.45rem;
}

.agents-account-identity__name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--agents-ink);
}

.agents-account-identity__email {
  margin: 0;
  font-size: 0.88rem;
}

.agents-account-section {
  padding: 1rem 1.15rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--agents-line);
  background: rgb(255 255 255 / 0.92);
}

.agents-account-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.7rem;
}

.agents-account-section__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--agents-ink);
}

.agents-account-section__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.agents-account-status {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.agents-account-status--active {
  background: rgb(220 252 231 / 0.85);
  color: #166534;
  border: 1px solid rgb(134 239 172 / 0.4);
}

.agents-account-status--expired {
  background: rgb(254 226 226 / 0.85);
  color: #991b1b;
  border: 1px solid rgb(252 165 165 / 0.4);
}

.agents-account-days-left {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgb(254 243 199 / 0.85);
  color: #7a5010;
  border: 1px solid rgb(201 162 39 / 0.28);
}

.agents-account-link {
  color: var(--agents-gold-mid);
  font-weight: 600;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .agents-account-link:hover {
    text-decoration: underline;
  }
}

.agents-account-dl {
  margin: 0;
}

.agents-account-dl > div {
  padding: 0.45rem 0;
  border-top: 1px solid rgb(241 245 249 / 0.95);
}

.agents-account-dl > div:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.agents-account-dl dt {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--agents-muted);
}

.agents-account-dl dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--agents-ink);
}

/* Cartes : bordure discrète, pas d’ombre, hover minimal */
.agents-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--agents-line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .agents-card:hover {
    border-color: var(--agents-line-strong);
    background: rgb(255 255 255 / 0.97);
  }
}

.agents-card__domain {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--agents-muted);
}

.agents-card__intro {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.agents-card__avatar {
  width: min(104px, 28vw);
  height: auto;
  max-height: 7rem;
  flex-shrink: 0;
  align-self: flex-start;
  display: block;
  border: 0;
  background: transparent;
  border-radius: 0;
  object-fit: contain;
  object-position: top center;
}

.agents-card__intro-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.agents-card__persona {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--agents-ink);
}

.agents-card__title {
  margin: 0.15rem 0 0;
  font-size: 0.91rem;
  font-weight: 600;
  line-height: 1.38;
  color: #725a14;
}

.agents-card__subtitle {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--agents-ink-soft);
}

.agents-card .agents-btn--block {
  margin-top: 0;
}

/* Boutons pill dorés sobres — même forme partout */
.agents-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.85rem;
  padding: 0.55rem 1.35rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgb(201 162 39 / 0.42);
  -webkit-appearance: none;
  appearance: none;
  transition: filter 0.12s ease, transform 0.08s ease;
}

.agents-btn--block {
  width: 100%;
}

.agents-btn--primary {
  color: #1a1408;
  background: linear-gradient(
    175deg,
    #faf4e4 0%,
    #f0e2bc 35%,
    #e8d8a8 100%
  );
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .agents-btn--primary:hover {
    filter: brightness(1.035);
    text-decoration: none;
  }
}

.agents-btn--primary:active {
  transform: scale(0.99);
}

.agents-btn--primary:focus-visible {
  outline: 2px solid var(--agents-focus);
  outline-offset: 2px;
}

.agents-btn--secondary {
  color: #334155;
  background: rgb(255 255 255 / 0.92);
  border: 1px solid rgb(226 232 240);
}

@media (hover: hover) and (pointer: fine) {
  .agents-btn--secondary:hover {
    filter: brightness(0.98);
    text-decoration: none;
    background: rgb(248 250 252);
  }
}

.agents-btn--account-logout {
  color: #b91c1c;
  border-color: rgb(252 165 165 / 0.75);
  background: rgb(254 242 242 / 0.75);
}

@media (hover: hover) and (pointer: fine) {
  .agents-btn--account-logout:hover {
    filter: none;
    background: rgb(254 226 226 / 0.85);
    text-decoration: none;
  }
}

.agents-account-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.25rem;
}

.agents-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Chat — colonne : perso → cadre messages (scroll interne) → saisie ; tout tient dans la hauteur viewport */
.agents-surface--chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  color-scheme: light;
}

/* Page conversation figée : pas de scroll document, uniquement le cadre messages */
html:has(.agents-surface--chat) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.body-agents-shell:has(.agents-surface--chat) {
  margin: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  display: flex;
  flex-direction: column;
}

body.body-agents-shell:has(.agents-surface--chat) .site-footer {
  display: none;
}

body.body-agents-shell:has(.agents-surface--chat) .main.main--agents-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

body.body-agents-shell:has(.agents-surface--chat) .agents-surface.agents-surface--chat {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 0;
  padding-top: clamp(0.45rem, 3.5vmin, 0.95rem);
}

@supports (height: 100dvh) {
  html:has(.agents-surface--chat) {
    height: 100dvh;
    max-height: 100dvh;
  }

  body.body-agents-shell:has(.agents-surface--chat) {
    height: 100dvh;
    max-height: 100dvh;
  }
}

@supports (height: 100svh) {
  html:has(.agents-surface--chat) {
    height: 100svh;
    max-height: 100svh;
  }

  body.body-agents-shell:has(.agents-surface--chat) {
    height: 100svh;
    max-height: 100svh;
  }
}

/* Mobile : Safari iOS — bloquer le scroll du document (barre d’URL / rebond) */
@media (max-width: 900px) {
  html:has(.agents-surface--chat) {
    height: -webkit-fill-available;
    max-height: -webkit-fill-available;
  }

  body.body-agents-shell:has(.agents-surface--chat) {
    position: fixed;
    inset: 0;
    width: 100%;
    height: -webkit-fill-available;
    max-height: -webkit-fill-available;
    overflow: hidden;
  }

  body.body-agents-shell:has(.agents-surface--chat) .main.main--agents-shell {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }
}

.agents-chat-peerbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  flex-shrink: 0;
  gap: 0.25rem;
  max-width: 36rem;
  margin-top: clamp(0.35rem, 2vmin, 0.65rem);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  padding: 0.5rem 0.75rem 0.55rem;
  min-height: 3.75rem;
  border-bottom: 1px solid var(--agents-line);
  background: rgb(255 255 255 / 0.65);
  backdrop-filter: blur(8px);
}

.agents-chat-peerbar__back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: -0.2rem 0 -0.2rem -0.35rem;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
  color: var(--agents-ink-soft);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.agents-chat-peerbar__back:hover {
  color: var(--agents-ink);
}

.agents-chat-peerbar__back:focus-visible {
  outline: 2px solid var(--agents-focus);
  outline-offset: 2px;
  border-radius: 10px;
}

.agents-chat-peerbar__back-icon {
  display: block;
  margin-top: -0.05rem;
}

.agents-chat-peerbar__peer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: center;
  min-width: 0;
  max-width: min(100%, calc(100vw - 6.5rem));
}

.agents-chat-peerbar__photo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center bottom;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.agents-chat-peerbar__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
  min-width: 0;
  text-align: left;
}

.agents-chat-peerbar__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--agents-ink);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agents-chat-peerbar__role {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--agents-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agents-chat-peerbar__spacer {
  justify-self: end;
}

.agents-chat-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 36rem;
  margin: 0 auto;
  width: 100%;
  padding: 0.35rem 0.65rem 0.4rem;
}

.agents-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-bottom: 0;
  padding: 0.55rem 0.45rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--agents-line);
  border-radius: 12px;
  background: transparent;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.agents-chat-load-more-wrap {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0.15rem 0 0.25rem;
}

.agents-chat-load-more-wrap--near-top {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.35rem 0;
  margin: -0.15rem 0 0.1rem;
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 0.96) 0%,
    rgb(255 255 255 / 0.88) 70%,
    transparent 100%
  );
}

.agents-chat-load-more {
  font-size: 0.82rem;
}

.agents-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body.body-agents-shell:has(.agents-surface--chat) .agents-chat-log {
  scrollbar-gutter: stable;
}

/* Zone saisie + envoi : dans le flux (réserve sa place sous le cadre messages, pas de chevauchement) */
.agents-chat-compose {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 0 0.65rem max(0.65rem, calc(env(safe-area-inset-bottom, 0px) + 0.35rem)) 0.65rem;
}

.agents-chat-form--float {
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.42rem 0.4rem 0.72rem;
  border-radius: 1.55rem;
  border: 1px solid var(--agents-line-strong);
  background: rgb(255 255 255 / 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: none;
}

.agents-chat-form--float:focus-within {
  border-color: rgb(184 146 52 / 0.72);
}

.agents-chat-form--float textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 2.4rem;
  max-height: min(9rem, 34vh);
  resize: none;
  overflow-y: hidden;
  box-sizing: border-box;
  padding: 0.42rem 0.38rem;
  margin: 0;
  border: none;
  border-radius: 0;
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.48;
  background: transparent;
  color: var(--agents-ink);
  box-shadow: none;
}

.agents-chat-form--float textarea::placeholder {
  color: rgb(100 116 139 / 0.75);
}

.agents-chat-form--float textarea:focus-visible {
  outline: none;
}

.agents-chat-form--float .agents-btn--compose-send {
  flex-shrink: 0;
  width: auto;
  min-width: max-content;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 999px;
}

.agents-chat-form--float .agents-btn--compose-send:focus-visible {
  outline: 2px solid var(--agents-focus);
  outline-offset: 2px;
}

.agents-chat-mic {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--agents-line-strong);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.65);
  color: var(--agents-ink-soft);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.agents-chat-mic:hover {
  border-color: rgb(184 146 52 / 0.55);
  color: var(--agents-ink);
  background: rgb(255 255 255 / 0.92);
}

.agents-chat-mic:focus-visible {
  outline: 2px solid var(--agents-focus);
  outline-offset: 2px;
}

.agents-chat-mic:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.agents-chat-mic--recording {
  border-color: rgb(220 38 38 / 0.85);
  color: #dc2626;
  background: rgb(254 242 242 / 0.95);
  animation: agents-chat-mic-pulse 1.2s ease-in-out infinite;
}

.agents-chat-mic--transcribing {
  opacity: 0.65;
  pointer-events: none;
}

@keyframes agents-chat-mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(220 38 38 / 0.25);
  }
  50% {
    box-shadow: 0 0 0 6px rgb(220 38 38 / 0.08);
  }
}

/* Lignes de bulles (Messages) */
.agents-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.agents-msg-row:last-child {
  margin-bottom: 0;
}

.agents-msg-row--user {
  justify-content: flex-end;
  gap: 0.35rem;
}

.agents-msg-row--assistant {
  justify-content: flex-start;
}

.agents-msg-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(78%, 26rem);
}

.agents-msg-stack--end {
  align-items: flex-end;
  order: -1;
}

.agents-msg-row--user .agents-msg-stack {
  max-width: min(78%, 26rem);
}

.agents-msg-avatar {
  flex-shrink: 0;
  align-self: flex-end;
}

.agents-msg-avatar--agent {
  width: 44px;
  height: auto;
  max-height: 3.15rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: bottom center;
  border: 0;
  background: transparent;
  border-radius: 0;
  align-self: flex-end;
}

.agents-msg-avatar--user {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--agents-gold-pale), var(--agents-gold-mid));
  border: 1px solid rgb(201 162 39 / 0.45);
  opacity: 0.95;
}

.agents-msg-bubble {
  padding: 0.5rem 0.68rem;
  border-radius: 18px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.agents-msg-bubble--assistant {
  background: rgb(255 255 255 / 0.94);
  border: 1px solid var(--agents-line-strong);
  border-bottom-left-radius: 6px;
  color: var(--agents-ink);
}

.agents-msg-bubble--user {
  background: rgb(253 246 229 / 0.98);
  border: 1px solid rgb(212 163 74 / 0.22);
  border-bottom-right-radius: 6px;
  color: var(--agents-ink);
}

.agents-msg-body {
  font-size: 0.94rem;
}

.agents-msg-resources {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.agents-msg-rescard {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--agents-line);
  background: rgb(255 253 246 / 0.92);
}

.agents-msg-rescard__title {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--agents-ink);
}

.agents-msg-rescard__desc {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--agents-ink-soft);
}

.agents-msg-rescard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.agents-res-page {
  text-align: center;
  padding: 0.25rem 0 1.35rem;
}

.agents-res-page__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--agents-muted);
}

.agents-res-page__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--agents-ink);
}

.agents-res-page__lead {
  margin: 0 auto 0.25rem;
  max-width: 28rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.agents-res-gauge-block {
  margin: 1.15rem auto 0;
  max-width: min(100%, 36rem);
  text-align: center;
}

.agents-res-gauge {
  height: 0.65rem;
  border-radius: 999px;
  background: rgb(241 245 249 / 0.95);
  border: 1px solid var(--agents-line);
  overflow: hidden;
}

.agents-res-gauge__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8860b 0%, #c9a227 60%, #d4ad2d 100%);
  min-width: 0;
  transition: width 0.35s ease;
}

.agents-res-gauge__meta {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.35;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.agents-res-gauge__dot {
  margin: 0 0.2rem;
}

.agents-res-gauge__remain {
  color: var(--agents-ink-soft);
}

.agents-res-gauge__strong {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--agents-ink);
}

.agents-res-gauge__hint {
  margin: 0.35rem 0 0;
}

.agents-res-hub-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 2rem;
}

.agents-res-agent-block {
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--agents-line-strong);
  background: #fff;
}

.agents-res-agent-block--team {
  border-style: solid;
  background: rgb(248 250 252 / 0.65);
}

.agents-res-agent-block__head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.agents-res-agent-block__head--team {
  align-items: center;
}

.agents-res-agent-block__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgb(255 255 255 / 0.9);
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.1);
  flex-shrink: 0;
}

.agents-res-team-avatars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.agents-res-team-avatars__face {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  margin-left: -0.45rem;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.08);
}

.agents-res-team-avatars__face:first-child {
  margin-left: 0;
}

.agents-res-agent-block__intro {
  flex: 1 1 12rem;
  min-width: 0;
}

.agents-res-agent-block__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.agents-res-agent-block__role {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--agents-muted);
}

.agents-res-agent-block__tag {
  margin: 0.2rem 0 0;
}

.agents-res-agent-block__cta {
  flex-shrink: 0;
}

.agents-res-agent-block__empty {
  margin: 0.35rem 0 0;
}

.agents-res-section {
  margin-top: 1.35rem;
}

.agents-res-agent-block > .agents-res-section:first-of-type {
  margin-top: 0.5rem;
}

.agents-res-section-title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--agents-ink);
}

.agents-res-section-intro {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 40rem;
}

.agents-res-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .agents-res-cards--unlocked {
    grid-template-columns: 1fr 1fr;
  }
}

.agents-res-card {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--agents-line);
  background: #fff;
}

.agents-res-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
}

.agents-res-card__pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.agents-res-card__pill--live {
  background: rgb(236 253 245);
  color: rgb(21 128 61);
  border: 1px solid rgb(187 247 208);
}

.agents-res-card__pill--locked {
  background: rgb(241 245 249);
  color: rgb(71 85 105);
  border: 1px solid rgb(226 232 240);
}

.agents-res-card--live {
  border-color: rgb(201 162 39 / 0.28);
  background: rgb(255 253 248 / 0.95);
}

.agents-res-card--locked {
  position: relative;
  opacity: 0.9;
  background: rgb(248 250 252);
  border: 1px solid var(--agents-line);
  padding-top: 1.35rem;
}

.agents-res-card__lock {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 10px;
  background: rgb(226 232 240 / 0.95);
  color: rgb(100 116 139);
}

.agents-res-card__lock .bx {
  font-size: 1rem;
}

.agents-res-card__type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: rgb(254 243 199 / 0.9);
  color: rgb(120 53 15);
  margin-bottom: 0.35rem;
}

.agents-res-card__top .agents-res-card__type {
  margin-bottom: 0;
}

.agents-res-card__type--link {
  background: rgb(224 242 254 / 0.95);
  color: rgb(3 105 161);
}

.agents-res-card__type--pdf {
  background: rgb(254 243 199 / 0.9);
  color: rgb(120 53 15);
}

.agents-res-card__holder {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--agents-ink-soft);
}

.agents-res-card__holder-avatar {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--agents-line);
}

.agents-res-card--locked .agents-res-card__holder {
  opacity: 0.95;
}

.agents-res-card__holder--bare {
  gap: 0;
}

.agents-res-card__via {
  margin: 0 0 0.25rem;
}

.agents-res-card__name {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.agents-res-card__desc {
  margin: 0 0 0.5rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--agents-ink-soft);
}

.agents-res-card__when {
  margin: 0 0 0.45rem;
}

.agents-res-card__teaser {
  margin: 0;
  line-height: 1.45;
}

.agents-res-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.agents-resources-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-top: 0.85rem;
  justify-content: center;
}

.agents-resources-stat {
  font-size: 0.88rem;
}

.agents-resources-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agents-resources-card {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--agents-line);
  background: rgb(255 255 255 / 0.92);
}

.agents-resources-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}

.agents-resources-card__badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgb(254 243 199 / 0.95);
  color: rgb(120 53 15);
}

.agents-resources-card__title {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.agents-resources-card__desc {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--agents-ink-soft);
}

.agents-resources-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.agents-resources-empty {
  margin: 1rem 0;
  text-align: center;
}

.agents-btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

/* ——— Resources : nouveaux composants ——— */

/* Pourcentage dans la gauge */
.agents-res-gauge__pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--agents-gold-mid);
}

/* Méta droite de l'entête agent (badge + lien chat) */
.agents-res-agent-block__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* Badge X/Y */
.agents-res-agent-block__badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.agents-res-agent-block__badge--unlocked {
  background: rgb(254 243 199 / 0.85);
  color: #7a5010;
  border: 1px solid rgb(201 162 39 / 0.28);
}

.agents-res-agent-block__badge--locked {
  background: rgb(241 245 249);
  color: var(--agents-muted);
  border: 1px solid var(--agents-line-strong);
}

/* Lien chat inline dans l'entête */
.agents-res-agent-block__chat-link {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--agents-gold-mid);
  text-decoration: none;
  white-space: nowrap;
}

.agents-res-agent-block__chat-link .bx {
  font-size: 1rem;
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .agents-res-agent-block__chat-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
  }
}

/* Liste compacte des ressources verrouillées */
.agents-res-locked-list {
  margin-top: 0.75rem;
}

.agents-res-locked-list--divided {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--agents-line);
}

.agents-res-locked-list__label {
  margin: 0 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--agents-muted);
}

.agents-res-locked-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agents-res-locked-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--agents-line);
  min-width: 0;
}

.agents-res-locked-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.agents-res-locked-item__icon {
  font-size: 0.78rem;
  color: var(--agents-muted);
  opacity: 0.55;
  flex-shrink: 0;
}

.agents-res-locked-item__type {
  flex-shrink: 0;
  margin-bottom: 0;
}

.agents-res-locked-item__title {
  flex: 1;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--agents-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agents-res-locked-item__holder {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--agents-muted);
}

/* État vide de la bibliothèque */
.agents-res-empty-state {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.agents-res-empty-state__text {
  max-width: 30rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Auth inscription / connexion flux agents */
.agents-surface--auth {
  display: flex;
  flex-direction: column;
}

.agents-auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.25rem 2.5rem;
}

.agents-auth__card {
  width: 100%;
  max-width: 22rem;
  padding: 1.5rem 1.35rem 1.65rem;
  border: 1px solid var(--agents-line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.92);
}

.agents-auth__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.agents-auth__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--agents-ink-soft);
}

.agents-auth__foot {
  margin: 1.25rem 0 0;
  font-size: 0.86rem;
  color: var(--agents-muted);
  text-align: center;
}

.agents-auth__note {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--agents-muted);
  text-align: center;
}

.agents-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agents-consent-cgv {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--agents-ink-soft);
  cursor: pointer;
}

.agents-consent-cgv input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--agents-gold, #b45309);
}

.agents-consent-cgv a {
  color: var(--agents-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.agents-field__label {
  display: block;
  margin-bottom: 0.32rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--agents-ink-soft);
}

.agents-field__input {
  display: block;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--agents-line-strong);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--agents-ink);
}

.agents-field__input:focus-visible {
  outline: 2px solid var(--agents-focus);
  outline-offset: 1px;
}

.agents-field__hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: var(--agents-muted);
}

.agents-alert {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.agents-alert--error {
  color: #7f1d1d;
  background: rgb(254 226 226 / 0.65);
  border: 1px solid rgb(252 165 165 / 0.5);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Pied de page global : plus discret quand on est dans l’espace agents */
body:has(.agents-surface) .site-footer {
  border-top: 1px solid var(--agents-line, rgb(212 163 74 / 0.18));
  background: transparent;
}

body:has(.agents-surface) .main {
  padding-bottom: 0;
}

/* Admin indexation (léger rappel visuel) */
.agents-admin-body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: #fffefb;
}

.agents-admin-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.agents-admin-stats li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgb(212 163 74 / 0.12);
}

.ok-msg {
  color: #166534;
  background: rgb(220 252 231 / 0.6);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgb(134 239 172 / 0.45);
}

/* Roadmap : timeline + jalons */

.agents-roadmap-admin-note {
  margin: 0.65rem auto 0;
  max-width: 28rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #92400e;
  background: rgb(254 243 199 / 0.45);
  border: 1px solid rgb(251 191 36 / 0.35);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  text-align: center;
}

.agents-roadmap-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #7f1d1d;
  background: rgb(254 226 226 / 0.65);
  border: 1px solid rgb(252 165 165 / 0.5);
  margin-top: 0.75rem;
}

.agents-roadmap-alert .bx {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.06rem;
}

/* ——— Bloc résumé (période + timebar + progression globale) ——— */

.agents-roadmap-summary {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.05rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--agents-line);
  background: rgb(255 255 255 / 0.92);
}

.agents-roadmap-summary__period {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.55rem;
}

.agents-roadmap-summary__dates {
  font-size: 0.84rem;
}

.agents-roadmap-summary__time-pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--agents-ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.agents-roadmap-timebar {
  margin: 0;
}

.agents-roadmap-timebar__track {
  height: 6px;
  border-radius: 999px;
  background: rgb(241 245 249);
  overflow: hidden;
}

.agents-roadmap-timebar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8860b 0%, #c9a227 60%, #d4ad2d 100%);
  transition: width 0.35s ease;
}

.agents-roadmap-summary__overall {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--agents-line);
  margin-top: 0.7rem;
}

.agents-roadmap-summary__overall-label {
  font-size: 0.82rem;
  font-weight: 600;
}

.agents-roadmap-summary__overall-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--agents-gold-mid);
}

/* ——— Timeline ——— */

.agents-roadmap-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agents-roadmap-phase {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0 0.85rem;
  padding-bottom: 1.25rem;
}

.agents-roadmap-phase--last {
  padding-bottom: 0;
}

/* Rail vertical + dot */
.agents-roadmap-phase__rail {
  position: relative;
  width: 3px;
  margin-left: 7px;
  border-radius: 999px;
  background: var(--agents-line-strong);
}

/* Dot */
.agents-roadmap-phase__rail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.7rem;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgb(203 213 225);
}

/* Phase actuelle : dot + rail dorés */
.agents-roadmap-phase--current .agents-roadmap-phase__rail {
  background: linear-gradient(180deg, rgb(201 162 39 / 0.5) 0%, var(--agents-line-strong) 100%);
}

.agents-roadmap-phase--current .agents-roadmap-phase__rail::before {
  background: #c9a227;
  border-color: #fff;
  box-shadow: 0 0 0 2.5px rgb(201 162 39 / 0.3);
}

/* Phase passée : dot ardoise */
.agents-roadmap-phase--past .agents-roadmap-phase__rail::before {
  background: #64748b;
  border-color: #fff;
  box-shadow: 0 0 0 1.5px rgb(100 116 139 / 0.3);
}

/* ——— Carte de phase ——— */

.agents-roadmap-card {
  padding: 0.95rem 1rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--agents-line);
  background: rgb(255 255 255 / 0.94);
  margin-bottom: 0; /* spacing handled by phase padding-bottom */
}

/* Phase actuelle : bordure et fond dorés */
.agents-roadmap-phase--current .agents-roadmap-card {
  border-color: rgb(201 162 39 / 0.45);
  background: rgb(255 253 248 / 0.97);
  box-shadow: 0 4px 16px rgb(15 23 42 / 0.05);
}

/* Phase passée : fond légèrement grisé */
.agents-roadmap-phase--past .agents-roadmap-card {
  background: rgb(248 250 252 / 0.85);
  border-color: var(--agents-line);
}

/* Phase future : légèrement atténuée */
.agents-roadmap-phase--future .agents-roadmap-card {
  opacity: 0.88;
}

/* En-tête : meta (days + dates) + badge */
.agents-roadmap-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  flex-wrap: wrap;
}

.agents-roadmap-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.agents-roadmap-card__days {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--agents-muted);
  white-space: nowrap;
}

.agents-roadmap-card__window {
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Badge phase actuelle : doré */
.agents-roadmap-card__badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgb(254 243 199 / 0.85);
  color: #7a5010;
  border: 1px solid rgb(201 162 39 / 0.28);
  white-space: nowrap;
}

/* Badge terminée : ardoise */
.agents-roadmap-card__badge--past {
  background: rgb(241 245 249);
  color: var(--agents-muted);
  border-color: var(--agents-line-strong);
}

/* Zone expert : avatar + nom/domaine */
.agents-roadmap-card__expert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.agents-roadmap-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgb(255 255 255 / 0.9);
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.1);
}

.agents-roadmap-card__expert-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.agents-roadmap-card__persona {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--agents-ink);
  line-height: 1.2;
}

.agents-roadmap-card__domain {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

/* Barre de progression + méta */
.agents-roadmap-card__progress {
  margin: 0 0 0.85rem;
}

.agents-roadmap-card__bar {
  height: 8px;
  border-radius: 999px;
  background: rgb(241 245 249);
  overflow: hidden;
}

/* Default (futur/passé) : fill ardoise */
.agents-roadmap-card__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #94a3b8, #64748b);
  transition: width 0.35s ease;
}

/* Phase actuelle : fill doré */
.agents-roadmap-phase--current .agents-roadmap-card__bar-fill {
  background: linear-gradient(90deg, #b8860b 0%, #c9a227 60%, #d4ad2d 100%);
}

.agents-roadmap-card__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.agents-roadmap-card__pct {
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--agents-ink);
}

/* CTA bouton */
.agents-roadmap-card__cta {
  width: 100%;
  justify-content: center;
  margin-top: 0;
}

/* Note de bas de page */
.agents-roadmap-footnote {
  margin: 1.5rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* —— Audit fin de cycle (J-1) —— */
.agents-final-audit {
  max-width: 42rem;
  margin: 0 auto;
}

.agents-final-audit__head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.agents-final-audit__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.agents-final-audit__lede {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.agents-final-audit__avatars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.agents-final-audit__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.agents-final-audit__actions {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.agents-final-audit__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.agents-final-audit__loader {
  margin-bottom: 1.5rem;
  text-align: center;
}

.agents-final-audit__progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0 auto 0.75rem;
  max-width: 22rem;
}

.agents-final-audit__progress-bar {
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9a227, #f0d78c, #c9a227);
  background-size: 200% 100%;
  animation: agents-audit-progress 1.2s ease-in-out infinite;
}

@keyframes agents-audit-progress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.agents-final-audit__loader-text {
  font-size: 0.85rem;
  margin: 0;
}

.agents-final-audit__paper {
  background: #f4f1eb;
  color: #1c1917;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.35rem 1.5rem 1.5rem;
}

.agents-final-audit__body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.68;
  color: #292524;
  word-break: break-word;
}

.agents-final-audit__h2 {
  margin: 1.35rem 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #713f12;
  line-height: 1.35;
  border-bottom: 1px solid rgba(180, 140, 50, 0.45);
  padding-bottom: 0.45rem;
}

.agents-final-audit__body > .agents-final-audit__h2:first-child {
  margin-top: 0;
}

.agents-final-audit__p {
  margin: 0 0 1rem;
  max-width: 38rem;
  color: #292524;
}

.agents-final-audit__p:last-child {
  margin-bottom: 0;
}

.agents-final-audit__body strong {
  font-weight: 700;
  color: #0c0a09;
}

.agents-final-audit__err {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #f5a8a8;
}

.agents-final-audit--readonly .agents-final-audit__avatars {
  opacity: 0.88;
}

/* Experts / roadmap / ressources : période LLM terminée (archives seulement) */
.agents-avatar--archived {
  filter: grayscale(1);
  opacity: 0.45;
}

.body-agents-shell--portal-readonly .agents-shell-hero {
  opacity: 0.92;
}

.agents-grid--portal-readonly .agents-card {
  opacity: 0.92;
}

.agents-btn--disabled,
.agents-btn.agents-btn--disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.55;
}

.agents-res-agent-block__chat-link--disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.5;
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
  .agents-final-audit__progress-bar {
    animation: none;
    width: 100%;
    opacity: 0.5;
  }

  .agents-card,
  .agents-btn {
    transition: none;
  }

  .agents-btn--primary:active {
    transform: none;
  }

  .agents-roadmap-timebar__fill,
  .agents-roadmap-card__bar-fill {
    transition: none;
  }
}
