/* ============================================================
   dashboard.css — coque /dashboard (topbar, tabs-bar, content,
   mobile-nav). Layout responsive, breakpoint principal 768 px.
   Source de couleurs : tokens.css. Aucune valeur en dur.
   Tout est dans @layer layout (cf. ordre déclaré dans tokens.css).
   ============================================================ */

@layer layout {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    /* Garde-fou anti-overflow horizontal — un enfant qui dépasserait
     le viewport ne provoque PLUS de scrollbar pleine largeur. */
    overflow-x: clip;
  }

  body {
    font-family: var(--font-ui);
    font-size: var(--text-base);
    color: var(--tx);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100dvh; /* dynamic viewport height — gère mobile bars */
    text-rendering: optimizeLegibility;
  }

  #app-root {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 100dvh;
    min-width: 0;
  }

  /* --------------------------------------------------------------
   Topbar
   -------------------------------------------------------------- */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--topbar-h);
    padding-inline: var(--pad-page-x);
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 92%, transparent),
      color-mix(in srgb, var(--bg) 72%, transparent)
    );
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--bd);
  }

  .topbar-logo {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--ac);
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .topbar-site {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--tx);
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    padding: var(--space-1) var(--space-3);
    height: 32px;
    min-width: 140px;
    max-width: 260px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--t-fast);
  }
  .topbar-site:focus {
    border-color: var(--ac);
  }

  .topbar-site-group {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .topbar-site-add {
    font-family: var(--font-ui);
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1;
    color: var(--ac);
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--t-fast);
  }
  .topbar-site-add:hover,
  .topbar-site-add:focus {
    border-color: var(--ac);
  }

  /* Pill toggle Prod | Démo */
  .topbar-demo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
  }

  .topbar-demo-btn {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--tx2);
    background: transparent;
    border: 0;
    border-radius: calc(var(--r) - 2px);
    padding: var(--space-1) var(--space-3);
    height: 28px;
    cursor: pointer;
    outline: none;
    transition:
      background var(--t-fast),
      color var(--t-fast);
  }
  .topbar-demo-btn:hover:not(:disabled) {
    color: var(--tx);
  }
  .topbar-demo-btn.is-active {
    background: var(--ac2);
    color: var(--ac);
    font-weight: 600;
  }
  .topbar-demo-btn:disabled {
    opacity: 0.5;
    cursor: wait;
  }

  /* Sprint I 2026-05-14 — Pill période unifiée v2 (staged state + Apply).
     Bouton compact + dropdown structuré avec footer Apply. Mobile :
     bottom-sheet plein écran < 640px (vs 480 Sprint H). Couleur accent
     = var(--ac) #10b981 emerald, déjà cohérente avec le design system
     dark+light (cf. tokens.css). Inspirée Plausible / Simple Analytics. */
  /* Sprint responsive 2026-05-15 — pill unique scindée en deux pills
     côte à côte ("Filtrer" + "Comparer"). Le wrapper porte la cohésion
     visuelle (gap fixe), chaque pill garde son propre dropdown. Filter
     pill = principale (accent border), Compare pill = secondaire (gris). */
  .topbar-filter-controls {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }
  .topbar-period-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .topbar-period-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--tx);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    max-width: 320px;
    min-height: 36px;
  }
  .topbar-period-pill:hover {
    background: var(--bg);
    border-color: var(--ac);
  }
  .topbar-period-pill[aria-expanded='true'] {
    border-color: var(--ac);
    background: var(--bg);
    box-shadow: var(--shadow-focus);
  }
  /* Filter pill = contrôle primaire (la période est l'interaction analytics
     #1). Tinte accent subtile au repos pour la rendre clairement reconnaissable
     comme bouton — avant elle se fondait dans la topbar. */
  .topbar-period-pill--filter {
    background: var(--ac2);
    border-color: var(--ac);
    color: var(--ac);
    font-weight: 500;
  }
  .topbar-period-pill--filter:hover {
    background: var(--ac2);
    border-color: var(--ac);
    filter: brightness(1.05);
  }
  .topbar-period-pill--filter .topbar-period-pill-chev,
  .topbar-period-pill--filter .topbar-period-pill-icon {
    color: var(--ac);
  }
  .topbar-period-pill-icon {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .topbar-period-pill-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .topbar-period-pill-chev {
    display: inline-flex;
    color: var(--tx2);
    transition: transform var(--t-fast);
  }
  .topbar-period-pill[aria-expanded='true'] .topbar-period-pill-chev {
    transform: rotate(180deg);
    color: var(--ac);
  }

  /* Backdrop overlay (mobile uniquement, masqué desktop). */
  .topbar-period-backdrop {
    display: none;
  }

  /* Panel desktop : floating card. */
  .topbar-period-panel {
    position: absolute;
    z-index: 60;
    width: 380px;
    max-width: calc(100vw - 24px);
    padding: 16px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 12px;
    box-shadow: var(--shadow-3);
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: var(--font-ui);
    animation: pill-panel-in 180ms var(--ease);
  }
  @keyframes pill-panel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .topbar-period-panel-close {
    display: none; /* mobile only via media query */
  }
  .period-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .period-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tx3);
  }
  .period-section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .period-section-grid--compact {
    grid-template-columns: repeat(3, 1fr);
  }
  .period-option {
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--bd);
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--tx);
    cursor: pointer;
    text-align: center;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 38px;
  }
  .period-option:hover:not(.is-disabled):not([disabled]) {
    border-color: var(--ac);
    background: var(--ac2);
  }
  .period-option.is-active {
    background: var(--ac);
    color: #fff;
    border-color: var(--ac);
    font-weight: 600;
  }
  .period-option.is-disabled,
  .period-option[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .period-option.is-custom {
    font-style: italic;
  }

  /* Custom date row — visible quand selPeriod === 'custom'. */
  .period-custom-row {
    display: none;
    gap: 10px;
    padding-top: 8px;
  }
  .period-custom-row.is-visible {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .period-custom-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--tx2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .period-custom-input {
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--bd);
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--tx);
    min-height: 38px;
    color-scheme: dark light; /* harmonise le calendrier natif au thème user */
  }
  .period-custom-input:focus {
    outline: none;
    border-color: var(--ac);
    box-shadow: var(--shadow-focus);
  }
  .period-custom-input.is-invalid {
    border-color: var(--dn);
    background: var(--dn2);
  }

  /* Footer Apply / Cancel. */
  .period-panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--bd);
    margin-top: 2px;
  }
  .period-panel-btn {
    padding: 9px 16px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--bd);
    transition: background var(--t-fast), filter var(--t-fast);
    min-height: 38px;
  }
  .period-panel-btn--cancel {
    background: transparent;
    color: var(--tx2);
  }
  .period-panel-btn--cancel:hover {
    color: var(--tx);
    background: var(--bg);
  }
  .period-panel-btn--apply {
    background: var(--ac);
    border-color: var(--ac);
    color: #fff;
  }
  .period-panel-btn--apply:hover {
    filter: brightness(1.08);
  }
  .period-panel-btn--apply:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
  }

  /* Mobile : bottom-sheet plein écran ≤ 640px (vs 480px Sprint H). */
  @media (max-width: 640px) {
    /* Sprint responsive 2026-05-15 v2 — les deux pills (Filter + Compare)
       partagent la row 2 mobile (cf. .topbar-filter-controls ci-dessous).
       Tap target élargi à 40 px min, max-width libéré, flex-grow pour
       remplir l'espace disponible. La hiérarchie visuelle (accent pour
       Filter, gris pour Compare) est déjà gérée par les règles defaults. */
    .topbar-period-pill {
      max-width: none;
      flex: 1 1 auto;
      min-height: 40px;
      font-weight: 500;
    }
    .topbar-period-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.4);
      z-index: 59;
      animation: pill-backdrop-in 180ms var(--ease);
    }
    @keyframes pill-backdrop-in {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    .topbar-period-panel {
      position: fixed;
      bottom: 0;
      left: 0 !important; /* annule le style.left injecté par JS (topbar.js#open) */
      top: auto !important;
      width: 100vw;
      max-width: 100vw;
      max-height: 88vh;
      overflow-y: auto;
      border-radius: 16px 16px 0 0;
      box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
      padding: 22px 16px 16px 16px;
      gap: 16px;
      animation: pill-sheet-in 220ms var(--ease);
    }
    @keyframes pill-sheet-in {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }
    .topbar-period-panel-close {
      display: block;
      position: absolute;
      top: 10px;
      right: 14px;
      width: 36px;
      height: 36px;
      font-size: 24px;
      line-height: 1;
      background: transparent;
      border: 0;
      color: var(--tx2);
      cursor: pointer;
      border-radius: 50%;
    }
    .topbar-period-panel-close:hover {
      background: var(--bg);
      color: var(--tx);
    }
    /* Sur mobile, le panel a un petit "handle" en haut pour suggérer le swipe. */
    .topbar-period-panel::before {
      content: '';
      display: block;
      width: 40px;
      height: 4px;
      background: var(--bd);
      border-radius: 2px;
      margin: 0 auto 12px auto;
    }
    .period-section-grid,
    .period-section-grid--compact {
      grid-template-columns: repeat(2, 1fr);
    }
    .period-option {
      padding: 12px 10px;
      min-height: 44px; /* touch target ≥ 44px iOS guideline */
      font-size: 14px;
    }
    .period-custom-row.is-visible {
      grid-template-columns: 1fr;
    }
    .period-panel-footer {
      position: sticky;
      bottom: 0;
      background: var(--bg2);
      padding: 12px 0 0 0;
      margin-bottom: env(safe-area-inset-bottom, 0);
    }
    .period-panel-btn {
      flex: 1 1 0;
      min-height: 44px;
    }
  }


  .topbar-spacer {
    flex: 1 1 auto;
  }

  .topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--tx2);
    background: transparent;
    border: 1px solid var(--bd);
    border-radius: var(--r);
    cursor: pointer;
    transition:
      color var(--t-fast),
      border-color var(--t-fast);
  }
  .topbar-icon:hover {
    color: var(--tx);
    border-color: var(--bd2);
  }

  /* ============================================================
   Sélecteur de langue : pill avec drapeau + chevron + dropdown
   Pattern Crowdin / Wise / pages SaaS multilingues 2026
   ============================================================ */
  .topbar-locale-wrap {
    position: relative;
    display: inline-flex;
  }

  .topbar-locale-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 8px 0 6px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    cursor: pointer;
    outline: none;
    transition:
      border-color var(--t-fast),
      background var(--t-fast);
    flex: 0 0 auto;
  }
  .topbar-locale-btn:hover,
  .topbar-locale-btn[aria-expanded='true'] {
    border-color: var(--bd2);
    background: var(--bg3);
  }
  .topbar-locale-btn:focus-visible {
    border-color: var(--ac);
    box-shadow: var(--shadow-focus);
  }

  .topbar-locale-flag {
    display: block;
    width: 18px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid var(--bd);
    flex: 0 0 auto;
  }

  .topbar-locale-chev {
    display: inline-flex;
    align-items: center;
    color: var(--tx2);
    transition:
      transform var(--t-fast),
      color var(--t-fast);
  }
  .topbar-locale-btn:hover .topbar-locale-chev,
  .topbar-locale-btn[aria-expanded='true'] .topbar-locale-chev {
    color: var(--tx);
  }
  .topbar-locale-btn[aria-expanded='true'] .topbar-locale-chev {
    transform: rotate(180deg);
  }

  .topbar-locale-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    z-index: 32;
    display: none;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 4px;
    min-width: 160px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    box-shadow: var(--shadow-3);
    animation: topbar-more-pop 160ms var(--ease);
  }
  /* Sprint responsive 2026-05-15 — la règle right-anchor mobile du menu locale
     vit maintenant dans le bloc principal @media (max-width: 767.98px) plus
     bas dans le fichier (cf. recherche `.topbar-locale-menu` dans ce bloc).
     Le but : un seul bloc 767.98 px pour respecter mediaBlock() helper côté
     test-new/mobile-overflow-guard.test.js qui prend la première occurrence. */
  .topbar-locale-wrap.is-open .topbar-locale-menu {
    display: flex;
  }

  .topbar-locale-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--tx);
    transition: background var(--t-fast);
    outline: none;
  }
  .topbar-locale-item:hover,
  .topbar-locale-item:focus-visible {
    background: var(--bg3);
  }
  .topbar-locale-item.is-active {
    background: var(--ac2);
    color: var(--ac);
    font-weight: 500;
  }

  .topbar-locale-item-flag {
    display: block;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid var(--bd);
    flex: 0 0 auto;
  }

  /* Bouton profil — visible uniquement sur mobile. Pill (initiale + chevron)
   plutôt qu'un cercle simple : le chevron crie "cliquable / dropdown",
   évite le piège UX du cercle qu'on prend pour un avatar décoratif. */
  .topbar-profile-btn {
    display: none;
  }

  /* Conteneur des items "secondaires" (démo-toggle, locale, docs, user-block).
   Sur desktop : display: contents → ses enfants flottent dans la topbar
   comme des frères directs. Sur mobile : devient un popover sous la topbar
   stylé comme un menu profil pro (Vercel/Linear/Stripe). */
  .topbar-more-menu {
    display: contents;
  }

  /* Header / labels de section / divider : visibles UNIQUEMENT dans le mode
   popover (mobile, ouvert). Masqués en desktop pour que .topbar-more-menu
   reste un wrapper invisible avec ses enfants en frères du topbar. */
  .profile-header,
  .profile-menu-section-label,
  .profile-menu-divider {
    display: none;
  }

  /* Sur desktop, les wrappers .profile-menu-section sont aussi en
   `display: contents` → leurs enfants (démo-toggle, locale-toggle) flottent
   directement dans la topbar comme avant la refonte. */
  .profile-menu-section {
    display: contents;
  }

  .topbar-user {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .topbar-user-email {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tx2);
    font-size: var(--text-sm);
  }

  .topbar-btn {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--tx2);
    background: transparent;
    border: 1px solid var(--bd);
    border-radius: var(--r);
    padding: 0 var(--space-3);
    height: 32px;
    cursor: pointer;
    transition:
      color var(--t-fast),
      border-color var(--t-fast),
      background var(--t-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
  }
  .topbar-btn:hover {
    color: var(--tx);
    border-color: var(--bd2);
    background: color-mix(in srgb, var(--tx) 5%, transparent);
  }
  .topbar-btn svg {
    flex-shrink: 0;
    opacity: 0.85;
  }
  .topbar-btn:hover svg {
    opacity: 1;
  }
  .topbar-btn-label {
    line-height: 1;
  }

  /* CTA signup en mode démo : remplace billing+logout. Style accent emerald
   — c'est la conversion principale de la page démo. */
  .topbar-btn-signup {
    color: #fff;
    background: var(--ac);
    border-color: var(--ac);
    font-weight: 600;
  }
  .topbar-btn-signup:hover {
    color: #fff;
    background: color-mix(in srgb, var(--ac) 88%, black);
    border-color: color-mix(in srgb, var(--ac) 88%, black);
  }

  /* --------------------------------------------------------------
   Tabs bar (desktop ≥ 768 px)
   -------------------------------------------------------------- */
  .tabs-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: var(--tabsbar-h);
    padding-inline: var(--pad-page-x);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--bd);
    position: sticky;
    top: var(--topbar-h);
    z-index: 20;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .tabs-bar-item {
    position: relative;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--tx2);
    background: transparent;
    border: 0;
    margin-bottom: -1px;
    padding: 0 var(--space-4);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--t-fast);
  }

  .tabs-bar-item::after {
    content: '';
    position: absolute;
    left: var(--space-4);
    right: var(--space-4);
    bottom: 0;
    height: 2px;
    background: var(--ac);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--t-base);
  }

  .tabs-bar-item:hover {
    color: var(--tx);
  }
  .tabs-bar-item.active {
    color: var(--ac);
  }
  .tabs-bar-item.active::after {
    transform: scaleX(1);
  }
  .tabs-bar-item:focus-visible {
    outline: none;
    color: var(--tx);
  }
  .tabs-bar-item:focus-visible::after {
    transform: scaleX(0.6);
    background: var(--tx2);
  }

  /* --------------------------------------------------------------
   Main content
   -------------------------------------------------------------- */
  #tab-content {
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--max-w-content);
    /* `align-self: center` est plus fiable que `margin-inline: auto` sur un
     flex item d'un container `flex-direction: column` avec
     `align-items: stretch` (le défaut) — auto-margin ne centre pas dans ce
     cas. Gardé margin-inline: auto en garde-fou si l'élément se retrouvait
     hors flex (ex: print, ou si #app-root n'était plus flex). */
    align-self: center;
    margin-inline: auto;
    padding-inline: var(--pad-page-x);
    padding-block: var(--pad-page-y);
    min-width: 0; /* essentiel pour que les enfants ne forcent pas la largeur */
  }

  .tab-placeholder {
    max-width: 900px;
  }

  .tab-placeholder h1 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--tx);
  }

  .tab-placeholder p {
    margin: 0;
    color: var(--tx2);
    font-size: var(--text-base);
  }

  /* --------------------------------------------------------------
   Boot error
   -------------------------------------------------------------- */
  .boot-error {
    max-width: 600px;
    margin: var(--space-12) auto;
    padding: var(--space-6);
    border: 1px solid var(--dn);
    border-radius: var(--r);
    color: var(--tx);
    background: var(--bg2);
  }

  .boot-error h1 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
    color: var(--dn);
  }

  .boot-error p {
    margin: 0;
    color: var(--tx2);
  }

  /* --------------------------------------------------------------
   Mobile nav (< 768 px)
   -------------------------------------------------------------- */
  .mobile-nav {
    display: none;
  }

  @media (max-width: 767.98px) {
    .tabs-bar {
      display: none;
    }

    /* Sprint responsive 2026-05-15 — sur mobile (≤ 767 px), le bouton locale
       est sur la rangée 1 de la topbar à droite du site-select : ouvrir le
       menu vers la droite (left: 0) le pousse hors écran. On l'ancre par
       la droite pour qu'il s'ouvre vers la gauche et reste dans le viewport. */
    .topbar-locale-menu {
      left: auto;
      right: 0;
    }

    /* La topbar mobile : 2 rangées.
     Row 1 (sticky) : logo + site-select + add + spacer + theme + ⋯
     Row 2 (sticky below) : période (24h / 7j / 30j / ...) en scroll
     horizontal — les filtres période sont l'usage #1 sur analytics,
     les garder visibles vaut mieux que les enterrer dans un menu. */
    .topbar {
      flex-wrap: wrap;
      height: auto;
      min-height: var(--topbar-h);
      gap: var(--space-2);
      overflow: visible;
      padding-inline: var(--space-3);
      padding-block: var(--space-2);
      row-gap: var(--space-2);
    }

    /* Logo : on garde la marque mais plus petite sur mobile. */
    .topbar-logo {
      font-size: var(--text-sm);
    }

    .topbar-site {
      min-width: 110px;
      max-width: calc(100vw - 220px);
    }

    /* Période + Comparer : visibles en row 2, ordre 99 pour la pousser en
     dernier même si le HTML place demo/spacer entre. Les deux pills
     (Filter + Compare) partagent la row, chacune flex: 1 1 auto.
     Note : `.topbar-filter-controls` est le wrapper introduit Sprint
     2026-05-15 ; remplace l'ancien target `.topbar-period-wrap`. */
    .topbar-filter-controls {
      order: 99;
      flex-basis: 100%;
      width: 100%;
      justify-content: stretch;
      gap: var(--space-2);
    }
    .topbar-period-wrap {
      flex: 1 1 0;
      min-width: 0;
    }

    .topbar-user-email {
      display: none;
    }

    /* Mobile : icône seule, label masqué (économie d'espace topbar). */
    .topbar-btn {
      padding: 0 var(--space-2);
      min-width: 32px;
      justify-content: center;
    }
    .topbar-btn-label {
      display: none;
    }

    /* Pill profil mobile : initiale circulaire (24px) + chevron ▾ dans un
     conteneur à coins arrondis. Le chevron est ESSENTIEL — il signale
     "ouvre un menu" instantanément, contrairement à un simple cercle. */
    .topbar-profile-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      height: 36px;
      padding: 0 8px 0 4px;
      border-radius: 999px;
      border: 1px solid var(--bd2);
      background: var(--bg2);
      cursor: pointer;
      flex: 0 0 auto;
      transition:
        border-color var(--t-fast),
        background var(--t-fast),
        transform var(--t-fast);
    }
    .topbar-profile-btn:hover,
    .topbar-profile-btn[aria-expanded='true'] {
      border-color: var(--ac);
      background: var(--ac2);
    }
    .topbar-profile-btn:active {
      transform: scale(0.96);
    }
    .topbar-profile-btn:focus-visible {
      outline: none;
      box-shadow: var(--shadow-focus);
    }

    /* Initiale circulaire (cercle plein emerald avec initiale blanche/sombre). */
    .topbar-profile-avatar {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--ac);
      color: #06281e;
      font-family: var(--font-mono);
      font-size: var(--text-xs);
      font-weight: 700;
      flex: 0 0 auto;
    }
    .light .topbar-profile-avatar {
      color: #ffffff;
    }

    .topbar-profile-chev {
      display: inline-flex;
      align-items: center;
      color: var(--tx2);
      transition:
        transform var(--t-fast),
        color var(--t-fast);
    }
    .topbar-profile-btn:hover .topbar-profile-chev,
    .topbar-profile-btn[aria-expanded='true'] .topbar-profile-chev {
      color: var(--ac);
    }
    .topbar-profile-btn[aria-expanded='true'] .topbar-profile-chev {
      transform: rotate(180deg);
    }

    /* Le wrapper bascule en dropdown profil pro positionné sous la topbar. */
    .topbar-more-menu {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      right: var(--space-3);
      z-index: 31;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      min-width: 280px;
      max-width: calc(100vw - 2 * var(--space-3));
      padding: var(--space-2);
      background: var(--bg2);
      border: 1px solid var(--bd);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-3);
      animation: topbar-more-pop 180ms var(--ease);
      overflow: hidden;
    }
    .topbar-more-menu.is-open {
      display: flex;
    }

    /* --- Header avec avatar + email tronqué --- */
    .topbar-more-menu .profile-header {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: var(--space-3);
      margin-bottom: var(--space-2);
      background: var(--bg3);
      border-radius: var(--radius-md);
      min-width: 0;
    }
    .topbar-more-menu .profile-avatar {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--ac);
      color: #06281e;
      font-family: var(--font-mono);
      font-size: var(--text-sm);
      font-weight: 600;
    }
    .light .topbar-more-menu .profile-avatar {
      color: #ffffff;
    }
    .topbar-more-menu .profile-meta {
      display: flex;
      flex-direction: column;
      gap: 1px;
      min-width: 0;
    }
    .topbar-more-menu .profile-meta-label {
      font-size: var(--text-xs);
      color: var(--tx3);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .topbar-more-menu .profile-meta-email {
      font-size: var(--text-sm);
      color: var(--tx);
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* --- Section nommée (Mode / Langue) — sur mobile, on remet display: flex
     pour que le wrapper soit visible avec son label uppercase et son contrôle. */
    .topbar-more-menu.is-open .profile-menu-section {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: var(--space-2) var(--space-3);
    }
    .topbar-more-menu .profile-menu-section-label {
      display: block;
      font-size: 10.5px;
      color: var(--tx3);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-weight: 600;
    }

    /* --- Toggles démo + locale en pills pleine largeur --- */
    .topbar-more-menu .topbar-demo-toggle,
    .topbar-more-menu .locale-toggle {
      width: 100%;
      background: var(--bg3);
    }
    .topbar-more-menu .topbar-demo-btn,
    .topbar-more-menu .locale-toggle-btn {
      flex: 1 1 0;
      text-align: center;
      height: 32px;
    }

    /* --- Items boutons (docs, mon compte, déconnexion) --- */
    .topbar-more-menu .topbar-btn,
    .topbar-more-menu .topbar-icon {
      width: 100%;
      justify-content: flex-start;
      padding: 0 var(--space-3);
      height: 40px;
      border-radius: var(--radius-md);
      border: 0;
      background: transparent;
      gap: var(--space-3);
      color: var(--tx);
      font-size: var(--text-sm);
      font-weight: 500;
    }
    .topbar-more-menu .topbar-btn:hover,
    .topbar-more-menu .topbar-icon:hover {
      background: var(--bg3);
      color: var(--tx);
      border-color: transparent;
    }
    .topbar-more-menu .topbar-btn-label {
      display: inline;
    }
    .topbar-more-menu .topbar-btn svg,
    .topbar-more-menu .topbar-icon svg {
      width: 16px;
      height: 16px;
      flex: 0 0 auto;
      opacity: 1;
      color: var(--tx2);
    }
    /* Logout : teinté rouge subtil */
    .topbar-more-menu .topbar-btn-logout {
      color: var(--tx);
    }
    .topbar-more-menu .topbar-btn-logout:hover {
      background: var(--dn2);
      color: var(--dn);
    }
    .topbar-more-menu .topbar-btn-logout:hover svg {
      color: var(--dn);
    }

    /* --- Séparateur entre la liste et la déconnexion --- */
    .topbar-more-menu .profile-menu-divider {
      display: block;
      height: 1px;
      background: var(--bd);
      border: 0;
      margin: var(--space-2) var(--space-3);
    }

    /* User block dans le menu : full width vertical, email caché (déjà
     en header). */
    .topbar-more-menu .topbar-user {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: 0 var(--space-1);
    }
    .topbar-more-menu .topbar-user-email {
      display: none;
    }

    /* Show le header / labels de section quand on est en popover. */
    .topbar-more-menu.is-open .profile-header {
      display: flex;
    }
    .topbar-more-menu.is-open .profile-menu-section-label {
      display: block;
    }
    .topbar-more-menu.is-open .profile-menu-divider {
      display: block;
    }

    #tab-content {
      padding-inline: var(--space-4);
      padding-block: var(--space-4);
      padding-bottom: calc(var(--mobilenav-h) + env(safe-area-inset-bottom, 0) + 12px);
      /* Sprint post-audit 2026-05-13 — garde-fou anti-overflow horizontal :
         si une card interne pousse trop loin, on clip plutôt que créer une
         scrollbar pleine largeur sur la page. */
      max-width: 100vw;
      overflow-x: clip;
    }

    .mobile-nav {
      position: fixed;
      inset-inline: 0;
      bottom: 0;
      z-index: 40;
      display: flex;
      align-items: stretch;
      justify-content: space-around;
      height: var(--mobilenav-h);
      padding-bottom: env(safe-area-inset-bottom, 0);
      background: color-mix(in srgb, var(--bg) 88%, transparent);
      backdrop-filter: blur(14px) saturate(160%);
      -webkit-backdrop-filter: blur(14px) saturate(160%);
      border-top: 1px solid var(--bd);
    }

    .mobile-nav-item {
      position: relative;
      flex: 1 1 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      padding: var(--space-1);
      color: var(--tx3);
      background: transparent;
      border: 0;
      cursor: pointer;
      transition:
        color var(--t-fast),
        background var(--t-fast);
      min-width: 0;
    }

    .mobile-nav-item:hover {
      color: var(--tx2);
    }
    .mobile-nav-item.active {
      color: var(--ac);
    }
    .mobile-nav-item.active::before {
      content: '';
      position: absolute;
      top: 0;
      left: 28%;
      right: 28%;
      height: 2px;
      background: var(--ac);
      border-radius: 0 0 2px 2px;
    }

    .mobile-nav-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .mobile-nav-label {
      font-size: 10px;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
  }

  @media (max-width: 360px) {
    .mobile-nav-label {
      display: none;
    }
  }

  /* Sprint post-audit 2026-05-13 — padding réduit ≤ 375 px (iPhone SE,
     Android pliable) pour gagner ~8 px utiles à l'intérieur des cards. */
  @media (max-width: 375px) {
    #tab-content {
      padding-inline: var(--space-3);
    }
  }

  @keyframes topbar-more-pop {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* ============================================================
   Tab header (h1 + sous-titre + boutons d'export)
   ============================================================ */
  .tab-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
    flex-wrap: wrap;
  }

  .tab-header-title {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    flex: 1 1 auto;
  }

  .tab-title {
    margin: 0;
    font-family: var(--font-ui);
    font-size: var(--text-fluid-title);
    font-weight: 600;
    color: var(--tx);
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  .tab-subtitle {
    margin: 0;
    font-size: var(--text-base);
    color: var(--tx2);
    line-height: 1.5;
    max-width: 720px;
  }

  .tab-header-exports {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    align-self: flex-start;
    flex-wrap: wrap;
  }

  .tab-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--tx);
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
      border-color var(--t-fast),
      color var(--t-fast),
      background var(--t-fast),
      box-shadow var(--t-fast);
    flex: 0 0 auto;
  }
  .tab-export-btn:hover {
    color: var(--ac);
    border-color: var(--ac);
    background: var(--ac2);
  }
  .tab-export-btn:focus-visible {
    outline: none;
    border-color: var(--ac);
    box-shadow: var(--shadow-focus);
  }
  .tab-export-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
  }
  .tab-export-btn svg {
    flex: 0 0 auto;
  }

  .tab-export-btn-zip {
    background: var(--bg);
    color: var(--tx2);
  }
  .tab-export-btn-zip:hover {
    color: var(--ac);
    background: var(--ac2);
    border-color: var(--ac);
  }

  /* CSV button dans header de card */
  .card-csv-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    margin-right: 4px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--tx3);
    background: transparent;
    border: 0;
    border-radius: var(--r);
    cursor: pointer;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: color var(--t-fast);
  }
  .card-csv-btn:hover,
  .card-csv-btn:focus-visible {
    color: var(--ac);
    outline: none;
  }
  .card-csv-btn svg {
    flex: 0 0 auto;
  }

  @media (max-width: 480px) {
    .card-csv-btn-text {
      display: none;
    }
  }

  @media (max-width: 767.98px) {
    .tab-header {
      margin-bottom: var(--space-5);
      gap: var(--space-3);
    }
    .tab-subtitle {
      font-size: var(--text-sm);
    }
    .tab-header-exports {
      width: 100%;
      flex-direction: column;
      gap: 6px;
    }
    .tab-export-btn {
      width: 100%;
      justify-content: center;
    }
  }

  /* ============================================================
   Date picker popover
   ============================================================ */
  .date-picker-popover {
    position: absolute;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: min(280px, calc(100vw - 2 * var(--space-4)));
    padding: var(--space-3);
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    box-shadow: var(--shadow-3);
  }

  .date-picker-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--tx2);
  }

  .date-picker-input {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--tx);
    background: var(--bg);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    padding: 6px 10px;
    min-height: 32px;
    min-width: 0;
  }
  .date-picker-input:focus {
    border-color: var(--ac);
    outline: none;
  }

  .date-picker-error {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--dn);
  }

  .date-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-1);
  }

  .date-picker-btn {
    padding: 6px 14px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--r);
    cursor: pointer;
    border: 1px solid var(--bd);
    background: var(--bg);
    color: var(--tx);
    transition: filter var(--t-fast);
  }
  .date-picker-btn.is-apply {
    background: var(--ac);
    border-color: var(--ac);
    color: #0b0f14;
  }
  .date-picker-btn:hover {
    filter: brightness(1.05);
  }

  /* Sprint B' 2026-05-14 — calendrier custom (range click-and-click).
     Surcharge .date-picker-popover : largeur élargie, grille mois × jours. */
  .date-picker-popover--calendar {
    width: min(320px, calc(100vw - 2 * var(--space-4)));
  }
  .dp-summary {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--tx);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--bd);
  }
  .dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
  }
  .dp-nav-prev,
  .dp-nav-next {
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 18px;
    border: 1px solid var(--bd);
    border-radius: var(--r);
    background: var(--bg);
    color: var(--tx);
    cursor: pointer;
    padding: 0;
  }
  .dp-nav-prev:hover,
  .dp-nav-next:hover {
    background: var(--bg2);
  }
  .dp-month-label {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--tx);
    text-transform: capitalize;
  }
  .dp-grid {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
  }
  .dp-grid th,
  .dp-grid td {
    text-align: center;
    padding: 4px 0;
    font-weight: 400;
  }
  .dp-grid th {
    color: var(--tx2);
    font-weight: 500;
    padding-bottom: 6px;
  }
  .dp-week,
  .dp-week-h {
    color: var(--tx3);
    font-variant-numeric: tabular-nums;
    font-size: 10px;
  }
  .dp-day {
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--t-fast);
    user-select: none;
  }
  .dp-day:hover:not(.is-disabled) {
    background: var(--bg2);
  }
  .dp-day.is-other-month {
    color: var(--tx3);
    opacity: 0.5;
  }
  .dp-day.is-today {
    outline: 1px dashed var(--ac);
    outline-offset: -2px;
  }
  .dp-day.is-in-range {
    background: color-mix(in srgb, var(--ac) 18%, transparent);
  }
  .dp-day.is-from,
  .dp-day.is-to {
    background: var(--ac);
    color: #0b0f14;
    font-weight: 600;
  }
  .dp-day.is-disabled {
    color: var(--tx3);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.4;
  }

  /* ============================================================
   Locale toggle (FR | EN)
   ============================================================ */
  .locale-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: var(--r);
  }

  .locale-toggle-btn {
    padding: 4px 10px;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--tx2);
    background: transparent;
    border: 0;
    border-radius: calc(var(--r) - 2px);
    cursor: pointer;
    letter-spacing: 0.5px;
    transition:
      color var(--t-fast),
      background var(--t-fast);
  }
  .locale-toggle-btn.is-active {
    color: var(--tx);
    background: var(--bg3);
  }
  .locale-toggle-btn:hover:not(.is-active) {
    color: var(--tx);
  }

  /* Bandeau précision géo limitée */
  .precision-limited-banner {
    padding: var(--space-3);
    font-size: var(--text-sm);
    color: var(--tx2);
    background: var(--bg3);
    border: 1px dashed var(--bd);
    border-radius: var(--r);
    text-align: center;
  }

  /* ============================================================
   View Transitions API — crossfade entre onglets (Chrome ≥111, Safari ≥18)
   Pilote l'animation déclenchée côté JS par layout.js → startViewTransition.
   ============================================================ */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 220ms;
    animation-timing-function: var(--ease);
  }
  ::view-transition-old(root) {
    animation-name: vt-fade-out;
  }
  ::view-transition-new(root) {
    animation-name: vt-fade-in;
  }
  @keyframes vt-fade-out {
    to {
      opacity: 0;
      transform: translateY(-2px);
    }
  }
  @keyframes vt-fade-in {
    from {
      opacity: 0;
      transform: translateY(2px);
    }
  }

  /* ============================================================
   :has() polish — sélecteurs contextuels 2026
   ============================================================ */

  /* Quand un tab-header contient des boutons d'export, on ajuste la
   marge basse pour aérer la zone d'action sans toucher aux autres tabs. */
  .tab-header:has(.tab-export-btn) {
    margin-bottom: var(--space-8);
  }

  /* Body sans tabs-bar visible (mobile) — pas de top sticky offset à gérer.
   Évite d'avoir besoin d'une classe JS quand on rend conditionnellement. */
  body:has(.mobile-nav:not([hidden])) #tab-content {
    padding-bottom: calc(var(--mobilenav-h) + env(safe-area-inset-bottom, 0) + 12px);
  }

  /* ============================================================
   Print styles — export PDF / impression
   On masque la chrome (topbar, tabs, nav mobile, exports), on libère
   le tab-content sur toute la largeur, on neutralise les ombres / sticky.
   ============================================================ */
  @media print {
    .topbar,
    .tabs-bar,
    .mobile-nav,
    .tab-header-exports,
    .tooltip-trigger,
    .tooltip-popover,
    .card-csv-btn {
      display: none !important;
    }

    html,
    body {
      background: #fff !important;
      color: #000 !important;
      overflow: visible !important;
    }

    #tab-content {
      max-width: none;
      padding: 0;
      margin: 0;
    }

    .card,
    .compliance-status-banner,
    .compliance-referentials,
    .modal-panel {
      box-shadow: none !important;
      border-color: #ccc !important;
      page-break-inside: avoid;
      break-inside: avoid;
    }

    .tab-title {
      color: #000 !important;
      font-size: 22px !important;
    }

    /* Stop les pulses, animations, transitions à l'impression. */
    *,
    *::before,
    *::after {
      animation: none !important;
      transition: none !important;
    }
  }

  /* --------------------------------------------------------------
   Demo lock — désactive boutons/forms mutants en mode démo
   -------------------------------------------------------------- */
  .is-demo-locked {
    opacity: 0.55;
    cursor: not-allowed !important;
    filter: grayscale(0.4);
  }
  .is-demo-locked:hover {
    opacity: 0.55 !important;
  }
  .demo-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ac) 18%, transparent);
    color: var(--ac);
    margin-left: var(--space-2);
    vertical-align: middle;
  }

  /* --------------------------------------------------------------
   Demo banner (mode démo seulement)
   --------------------------------------------------------------
   Posé au-dessus de la topbar quand state.isDemoSession() est vrai.
   Deux rangées :
     1. Nav marketing : logo + liens + CTA signup
     2. Bandeau info : "vous regardez la démo publique"
   Aucun visuel pour un user authentifié normal (slot vide).
   -------------------------------------------------------------- */
  .demo-banner {
    border-bottom: 1px solid var(--bd);
    background: var(--bg2);
  }
  .demo-banner-nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-2) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }
  .demo-banner-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--tx);
    text-decoration: none;
    font-size: var(--text-base);
    flex-shrink: 0;
  }
  .demo-banner-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .demo-banner-links {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    flex-wrap: wrap;
  }
  .demo-banner-link {
    color: var(--tx2);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: 6px 0;
    transition: color var(--t-fast);
  }
  .demo-banner-link:hover {
    color: var(--tx);
  }
  .demo-banner-cta {
    color: #fff;
    background: var(--ac);
    border: 1px solid var(--ac);
    border-radius: var(--r);
    padding: 0 var(--space-3);
    height: 32px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: var(--text-sm);
    text-decoration: none;
    white-space: nowrap;
    transition:
      background var(--t-fast),
      border-color var(--t-fast);
  }
  .demo-banner-cta:hover {
    background: color-mix(in srgb, var(--ac) 88%, black);
    border-color: color-mix(in srgb, var(--ac) 88%, black);
  }
  .demo-banner-info {
    background: color-mix(in srgb, var(--ac) 12%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--ac) 25%, transparent);
    padding: 8px var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--tx);
  }
  .demo-banner-info-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ac);
    flex-shrink: 0;
    animation: demo-banner-pulse 2.4s ease-in-out infinite;
  }
  .demo-banner-info-title {
    font-weight: 600;
  }
  .demo-banner-info-body {
    color: var(--tx2);
  }
  @keyframes demo-banner-pulse {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.45;
    }
  }
  @media (max-width: 760px) {
    .demo-banner-nav {
      gap: var(--space-2);
      flex-wrap: wrap;
    }
    .demo-banner-links {
      gap: var(--space-2);
      order: 3;
      width: 100%;
      overflow-x: auto;
      flex-wrap: nowrap;
    }
    .demo-banner-link {
      font-size: 13px;
    }
    .demo-banner-info {
      flex-wrap: wrap;
    }
    .demo-banner-info-body {
      width: 100%;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .demo-banner-info-dot {
      animation: none;
    }
  }
} /* end @layer layout */
