/* TiberIA.OS 2.17.0 : Avatars animés, Lip-Sync, Diaporama CSS, QR roulant, Admin rubriques (Ch. 5.7), Dégradés (Ch. 5.1/5.2), Budget Maison, Whale's Lair */

/* ---------- Correctifs mobile C3 / C4 (pied de page et bulles d'aide) ---------- */
.pied .wrap { padding-left: 56px; padding-right: 56px; }
main#contenu { padding-bottom: 72px; }
@media (max-width: 720px) {
  .pied .wrap { padding-left: 62px; padding-right: 62px; padding-bottom: 64px; }
}

/* ---------- Ch. 5.1 : Repères de défilement horizontal (dégradés + flèches) ---------- */
.scroll217-wrap { position: relative; }
.scroll217-fade-l, .scroll217-fade-r {
  position: absolute; top: 0; bottom: 0; width: 42px; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.scroll217-fade-l { left: 0; background: linear-gradient(90deg, rgba(5,8,17,.92) 25%, transparent); }
.scroll217-fade-r { right: 0; background: linear-gradient(270deg, rgba(5,8,17,.92) 25%, transparent); }
.scroll217-wrap.has-l .scroll217-fade-l,
.scroll217-wrap.has-r .scroll217-fade-r { opacity: 1; }
.scroll217-btn {
  pointer-events: auto; width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid rgba(255,179,0,.45); background: rgba(11,18,34,.92);
  color: #ffb300; font-size: 16px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.scroll217-btn:hover { background: #ffb300; color: #0b1220; }

/* ---------- Ch. 5.2 : Démarcation visuelle des rangées du catalogue ---------- */
.cat-bandeau217, .secteur-bloc217 {
  background: rgba(18, 28, 52, 0.52);
  border: 1px solid rgba(127, 208, 255, 0.16);
  border-left: 3px solid var(--bandeau-accent, #ffb300);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

/* ---------- Ch. 5.7 : Menu latéral Admin par rubriques colorées et repliables ---------- */
.admin29-nav .admin29-groupe {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(127, 208, 255, 0.12);
}
.admin29-nav .admin29-groupe:first-of-type { border-top: 0; margin-top: 4px; }
.admin29-nav .admin29-titre.titre217 {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #ffb300; padding: 6px 8px; margin: 0 0 4px 0; border-radius: 8px;
  cursor: pointer; user-select: none; background: rgba(255, 179, 0, 0.08);
}
.admin29-nav .admin29-groupe.actif217 .admin29-titre.titre217 {
  color: #7fd0ff; background: rgba(127, 208, 255, 0.14);
}
.admin29-nav .admin29-groupe a {
  padding-left: 16px !important;
  border-left: 2px solid transparent;
}
.admin29-nav .admin29-groupe a[aria-current="page"] {
  border-left-color: #ffb300;
  background: rgba(255, 179, 0, 0.14);
  font-weight: 700;
}
.admin29-nav .admin29-groupe.replie217 > a { display: none !important; }
.admin29-nav .admin29-chev { font-size: 11px; transition: transform .2s; }
.admin29-nav .admin29-groupe.replie217 .admin29-chev { transform: rotate(-90deg); }

/* ---------- Avatars IA corps entier animés + Lip-Sync ---------- */
.av217-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: linear-gradient(160deg, rgba(14,23,46,.92), rgba(7,12,24,.95));
  border: 1px solid rgba(127,208,255,.26);
  border-radius: 18px; padding: 14px; position: relative; overflow: hidden;
}
.av217-stage {
  width: 170px; height: 270px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.av217-stage svg, .av217-stage img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45));
}
@keyframes av217-breathe {
  0%, 100% { transform: translateY(0px) scaleY(1); }
  50% { transform: translateY(-3px) scaleY(1.012); }
}
@keyframes av217-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97% { transform: scaleY(0.1); }
}
@keyframes av217-aura {
  0%, 100% { opacity: .65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.av217-stage .av-body { transform-origin: 120px 360px; animation: av217-breathe 3.8s ease-in-out infinite; }
.av217-stage .av-eye { transform-origin: 120px 74px; animation: av217-blink 4.6s ease-in-out infinite; }
.av217-stage .av-aura { transform-origin: 120px 190px; animation: av217-aura 3.2s ease-in-out infinite; }
.av217-box.parle .av217-stage .av-aura { opacity: 1; filter: brightness(1.3); }
.av217-box.parle { border-color: #ffb300; box-shadow: 0 0 24px rgba(255,179,0,.22); }
.av217-wave {
  display: flex; align-items: flex-end; gap: 3px; height: 18px;
}
.av217-wave span {
  width: 4px; height: 4px; border-radius: 3px; background: #7fd0ff; transition: height .08s linear;
}
.av217-box.parle .av217-wave span { background: #ffb300; }
.av217-meta { text-align: center; }
.av217-meta b { display: block; font-size: 14px; }
.av217-meta small { color: #9fb2cc; font-size: 12px; }
.av217-controls { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.av217-3d-badge {
  position: absolute; bottom: 8px; right: 8px; font-size: 11px; font-weight: 700;
  background: rgba(56,189,248,.22); color: #7fd0ff; border: 1px solid rgba(127,208,255,.4);
  padding: 2px 8px; border-radius: 999px;
}

/* Mise en page chat Fractal avec avatar corps entier à côté */
.fx217-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start;
}
@media (max-width: 820px) {
  .fx217-layout { grid-template-columns: 1fr; }
  .fx217-layout .av217-stage { width: 130px; height: 190px; }
}
.fx217-switcher { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fx217-switcher button[aria-pressed="true"] { background: #ffb300; color: #120c00; font-weight: 700; }

/* ---------- QR code roulant connexion ---------- */
.qr217-card {
  margin-top: 16px; padding: 18px; border-radius: 16px;
  border: 1px solid rgba(127,208,255,.28); background: rgba(12,20,38,.85);
  display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center;
}
@media (max-width: 640px) { .qr217-card { grid-template-columns: 1fr; text-align: center; } }
.qr217-svg {
  background: #ffffff; padding: 10px; border-radius: 12px; max-width: 180px; margin: 0 auto;
}
.qr217-svg svg { width: 100%; height: auto; display: block; }
.qr217-code { font-size: 22px; font-weight: 800; letter-spacing: 4px; color: #ffb300; margin: 6px 0; }
.qr217-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin: 8px 0; }
.qr217-bar i { display: block; height: 100%; background: linear-gradient(90deg, #38bdf8, #ffb300); transition: width 1s linear; }

/* ---------- Page Diaporama commercial animé en CSS ---------- */
.diapo217 {
  position: relative; border-radius: 22px; overflow: hidden;
  border: 1px solid rgba(255,179,0,.28); background: #050811;
  min-height: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.diapo217-slides { position: relative; min-height: 460px; }
.diapo217-slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .85s ease; display: flex; align-items: center;
}
.diapo217-slide.actif { opacity: 1; pointer-events: auto; position: relative; min-height: 460px; }
.diapo217-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1); will-change: transform;
}
@keyframes kb-in { from { transform: scale(1.0); } to { transform: scale(1.13); } }
@keyframes kb-out { from { transform: scale(1.14); } to { transform: scale(1.01); } }
@keyframes kb-pan { from { transform: scale(1.1) translateX(-2%); } to { transform: scale(1.1) translateX(2%); } }
.diapo217-slide.actif .diapo217-bg.kenburns-in { animation: kb-in 8s ease-out forwards; }
.diapo217-slide.actif .diapo217-bg.kenburns-out { animation: kb-out 8s ease-out forwards; }
.diapo217-slide.actif .diapo217-bg.kenburns-pan { animation: kb-pan 8s ease-in-out forwards; }
.diapo217-voile {
  position: absolute; inset: 0;
  background: linear-gradient(95deg, rgba(5,8,17,.92) 0%, rgba(5,8,17,.74) 55%, rgba(5,8,17,.22) 100%);
}
.diapo217-corps {
  position: relative; z-index: 2; padding: 42px 40px 64px; max-width: 640px;
}
@keyframes text-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.diapo217-slide.actif .diapo217-badge { animation: text-rise .55s ease .1s both; }
.diapo217-slide.actif .diapo217-titre { animation: text-rise .65s ease .22s both; }
.diapo217-slide.actif .diapo217-texte { animation: text-rise .75s ease .35s both; }
.diapo217-slide.actif .diapo217-cta { animation: text-rise .85s ease .48s both; }
.diapo217-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em;
  color: #ffb300; background: rgba(255,179,0,.14); border: 1px solid rgba(255,179,0,.38);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.diapo217-titre { font-size: clamp(24px, 3.6vw, 40px); line-height: 1.15; margin: 0 0 14px; color: #fff; }
.diapo217-texte { font-size: 16px; line-height: 1.6; color: #d5e2f5; margin: 0 0 22px; }
.diapo217-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: linear-gradient(180deg, transparent, rgba(5,8,17,.88));
}
.diapo217-dots { display: flex; gap: 8px; }
.diapo217-dots button {
  width: 26px; height: 6px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.28); transition: background .25s, width .25s;
}
.diapo217-dots button[aria-current="true"] { background: #ffb300; width: 42px; }
@media (prefers-reduced-motion: reduce) {
  .diapo217-bg, .diapo217-badge, .diapo217-titre, .diapo217-texte, .diapo217-cta,
  .av217-stage .av-body, .av217-stage .av-eye, .av217-stage .av-aura { animation: none !important; }
}

/* ---------- Budget Maison & Whale's Lair ---------- */
.secu217-banner {
  border: 1px solid rgba(6,182,212,.45); background: rgba(6,182,212,.11);
  border-radius: 14px; padding: 12px 16px; color: #cffafe; font-size: 14px;
}
.jauge217 { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 6px; }
.jauge217 i { display: block; height: 100%; background: #22c55e; }
.jauge217.warn i { background: #f59e0b; }
.jauge217.over i { background: #ef4444; }
.whale217-filigrane {
  position: relative; padding: 20px; border-radius: 14px; background: rgba(10,16,32,.9);
  border: 1px solid rgba(127,208,255,.22); user-select: none;
}
.whale217-wm {
  font-size: 11px; color: rgba(127,208,255,.45); text-align: right; margin-bottom: 10px; letter-spacing: .06em;
}
.grid217-av {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}


/* ======================================================================
   v2.17.1 — Correctifs Topbar, Barre Admin fixe sous l'en-tête & Recherche Catalogue
   ====================================================================== */

/* 1. Barre du haut : Accueil · Catalogue · Moteur Fractal · StarNet · Admin · Plus ▾ toujours visibles sur une ligne */
.topbar { z-index: 60; }
.nav.principal { gap: 4px; flex-wrap: nowrap; }
.nav.principal > a, .nav.principal .nav-plus-btn { white-space: nowrap; }

/* 2. Suppression du menu latéral gauche relou en Admin -> Barre horizontale fixe sous la barre du site */
.admin29-grille { display: block !important; grid-template-columns: 1fr !important; }
.admin29-nav, .admin29-mobile { display: none !important; }
.admin29-grille > #onglet { width: 100%; max-width: 100%; margin-top: 14px; }

.admin217-sticky {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  z-index: 48;
  background: rgba(7, 11, 22, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(127, 208, 255, 0.22);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.admin217-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin217-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid rgba(127, 208, 255, 0.24);
  background: rgba(16, 25, 48, 0.85);
  color: #e6eefc;
  font: 700 14px/1.2 var(--f-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.admin217-cat-btn:hover {
  border-color: #ffb300;
  color: #ffb300;
}
.admin217-cat-btn.actif, .admin217-cat-btn[aria-expanded="true"] {
  background: #ffb300;
  border-color: #ffb300;
  color: #140e00;
}
.admin217-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.admin217-subs[hidden] { display: none; }
.admin217-subs a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  text-decoration: none;
  color: #dce8fa;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.admin217-subs a:hover {
  border-color: #7fd0ff;
  color: #7fd0ff;
}
.admin217-subs a[aria-current="page"] {
  background: rgba(56, 189, 248, 0.2);
  border-color: #7fd0ff;
  color: #7fd0ff;
  font-weight: 700;
}

/* 3. Barre de recherche disquettes ultra-visible dans le Catalogue */
.cat217-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 12px 0 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 26, 50, 0.92), rgba(10, 17, 34, 0.95));
  border: 1px solid rgba(255, 179, 0, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.cat217-search-field {
  position: relative;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
}
.cat217-search-field .cat217-loupe {
  position: absolute;
  left: 14px;
  color: #ffb300;
  pointer-events: none;
  font-size: 16px;
}
.cat217-search-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 40px 10px 42px;
  border-radius: 11px;
  border: 1px solid rgba(127, 208, 255, 0.32);
  background: rgba(5, 8, 17, 0.85);
  color: #ffffff;
  font-size: 15px;
}
.cat217-search-field input:focus {
  outline: none;
  border-color: #ffb300;
  box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.2);
}
.cat217-clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.cat217-clear[hidden] { display: none; }
.cat217-count {
  font-size: 13.5px;
  color: #9fb2cc;
  white-space: nowrap;
}
/* Quand la nouvelle barre de recherche est affichée, on évite le doublon visuel avec l'ancien champ #q de base */
.filtres.cat217-dedupe > label.search { display: none !important; }


/* ======================================================================
   v2.17.2 — Upload binaire avec barre de progression & Studio Avatar Personnalisable Créateur
   ====================================================================== */
.up217-info {
  font-size: 12px; padding: 6px 10px; border-radius: 8px;
  background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0; word-break: break-all;
}
.up217-info.defaut {
  background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.25); color: #cbd5e1;
}
.up217-info.err {
  background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.4); color: #fecaca;
}
.up217-prog {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px;
}
.up217-prog[hidden] { display: none; }
.up217-prog i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #38bdf8, #ffb300); transition: width .12s linear;
}
.up217-statut { font-size: 12px; color: #7fd0ff; min-height: 16px; }
.av217-3d-card {
  height: 126px; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 10px;
  background: radial-gradient(circle at 50% 35%, rgba(56,189,248,.22), rgba(7,12,26,.95));
  border: 1px solid rgba(56,189,248,.45); color: #e0f2fe; text-align: center;
}
.av217-3d-card b { font-size: 13px; color: #ffb300; }
.av217-3d-card small { font-size: 11px; color: #94a3b8; word-break: break-all; }

/* Studio Avatar Personnalisable (Espace Créateur) */
.cr217-studio {
  display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start;
}
@media (max-width: 780px) { .cr217-studio { grid-template-columns: 1fr; } }
.cr217-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cr217-tabs button[aria-selected="true"] { background: #ffb300; color: #140e00; font-weight: 700; }
.cr217-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cr217-swatch {
  width: 24px; height: 24px; border-radius: 999px; border: 2px solid rgba(255,255,255,.35);
  cursor: pointer; padding: 0;
}
.cr217-swatch:hover { transform: scale(1.12); border-color: #ffb300; }
