/* Top banner for version preview — overlays each version's UI */
:root { --refonte-banner-h: 36px; }

html { padding-top: var(--refonte-banner-h); }

.refonte-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--refonte-banner-h);
  background: rgba(0, 0, 0, .94);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  z-index: 99999;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  font-family: ui-monospace, 'Geist Mono', 'JetBrains Mono', SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #777;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
}
.refonte-banner a.back {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: background .15s, color .15s, border-color .15s;
  font-weight: 500;
}
.refonte-banner a.back:hover {
  background: rgba(76, 201, 240, .15);
  color: #4cc9f0;
  border-color: rgba(76, 201, 240, .35);
}
.refonte-banner .ttl { color: #c8c8c8; font-weight: 500; }
.refonte-banner .ttl em {
  color: #4cc9f0;
  font-style: normal;
  font-weight: 600;
  margin-right: 6px;
}
/* ── Theme switcher (pills colorées) ── */
.refonte-banner .theme-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .08);
}
.refonte-banner .theme-switch .ts-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6f6f6f;
  margin-right: 4px;
}
.refonte-banner .ts-pill {
  width: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform .15s ease, border-color .15s ease;
}
.refonte-banner .ts-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ts-color, #888);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.refonte-banner .ts-pill:hover { transform: scale(1.14); }
.refonte-banner .ts-pill:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, .9);
}
.refonte-banner .ts-pill.is-active {
  border-color: rgba(255, 255, 255, .9);
}

.refonte-banner .right {
  margin-left: auto;
  color: #555;
  font-size: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.refonte-banner .pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4cc9f0;
  box-shadow: 0 0 8px rgba(76,201,240,.5);
  display: inline-block;
}

/* Décale les éléments fixed/sticky qui collent au top:0 du --refonte-banner-h.
   ⚠ Pas .masthead : sur v4 (Revue) elle est en position:relative, l'offset
   décalerait tout le contenu en dessous. */
nav,
.subnav,
.sidebar { top: var(--refonte-banner-h) !important; }
/* v4 telemetry */
.telemetry { top: calc(60px + 16px + var(--refonte-banner-h)) !important; }
.depth-ruler { top: calc(60px + var(--refonte-banner-h)) !important; }
/* login pages */
.auth-bg { top: var(--refonte-banner-h); }

/* Si v4 a un --nav-h variable, son top:36px override est OK car même valeur */

/* ═════════════════════════════════════════════
   MOBILE (≤ 720px) — banner compacté
   ═════════════════════════════════════════════ */
@media (max-width: 720px) {
  .refonte-banner {
    gap: 8px;
    padding: 0 10px;
    font-size: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .refonte-banner::-webkit-scrollbar { display: none; }

  /* "← Toutes les versions" devient juste "←" */
  .refonte-banner a.back {
    flex-shrink: 0;
    padding: 4px 9px;
    font-size: 12px;
    line-height: 1;
  }
  .refonte-banner a.back > .back-label { display: none; }
  .refonte-banner a.back::after { content: '←'; font-size: 14px; line-height: 1; }
  /* fallback : on remplace le texte natif par le glyph quand pas de span */
  .refonte-banner a.back {
    text-indent: -9999px;
    width: 32px;
    overflow: hidden;
    position: relative;
  }
  .refonte-banner a.back::after {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-indent: 0;
  }

  /* Titre version : numéro discret, nom mis en avant */
  .refonte-banner .ttl {
    flex: 1;
    min-width: 0;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .refonte-banner .ttl em {
    margin-right: 4px;
    font-size: 10px;
  }

  /* Theme switch sans label */
  .refonte-banner .theme-switch {
    margin-left: 4px;
    padding-left: 8px;
    gap: 5px;
    flex-shrink: 0;
  }
  .refonte-banner .theme-switch .ts-label { display: none; }
  .refonte-banner .ts-pill { width: 16px; height: 16px; }

  /* Le bloc droit "Refonte Plongée.tv · POC" est masqué */
  .refonte-banner .right { display: none; }
}
