/* =============================================================================
   La Banque de Fer — Surcouche UX/UI Paperclip (Option C, prototype isolé)
   Fichier : /workspace/paperclip-prototype/ux/tokens-overlay.css
   Date    : 3 décembre 2026 (Europe/Paris)

   Objectif : habiller Paperclip sans fork. Aucune règle ne remplace la
   structure native ; on ne fait qu’ajouter des tokens, des mappings et des
   classes opt-in (bannière lab, états sémantiques, grilles 390/1440).

   Intégration (voir SPEC-UX-UI.md §7) :
     - Injecter cette feuille APRÈS le CSS Paperclip (proxy nginx `theme`,
       comme `theme/ibf-theme.css`). En cas de coexistence, charger
       `tokens-overlay.css` en dernier : elle est la source de vérité.
     - Thème sombre par défaut. Le mode clair n’est actif que si
       `data-theme="light"` est posé sur `<html>` (à synchroniser avec le
       basculeur natif / la classe `.dark` de Paperclip).
     - Couleurs issues du médaillon `/workspace/banque-de-fer-logo.png`.
     - Contrastes texte visés WCAG AA (≥ 4,5:1) en clair et en sombre.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap");

@layer bdf-overlay {
  /* --------------------------------------------------------------------------
     1. Tokens de marque (--bdf-*) + mapping générique et Paperclip/shadcn
     -------------------------------------------------------------------------- */

  :root,
  [data-theme="dark"],
  .dark {
    color-scheme: dark;

    /* Fond & surfaces — obsidienne mate, anthracite, ardoise */
    --bdf-bg: #0a0b0e;
    --bdf-bg-deep: #07080a;
    --bdf-surface: #12141a;
    --bdf-surface-2: #181b22;
    --bdf-surface-3: #1e222b;
    --bdf-inset: #0d0e12;

    /* Textes */
    --bdf-text: #ece7dc;
    --bdf-text-muted: #b8b0a4;
    --bdf-text-subtle: #9a9285;
    --bdf-text-inverse: #0a0b0e;

    /* Or vieilli, champagne, bronze, ambre (logo) */
    --bdf-gold: #c9a24d;
    --bdf-gold-bright: #f2d88a;
    --bdf-bronze: #7a5c24;
    --bdf-amber: #f59e0b;
    --bdf-amber-hot: #ff8c1a;
    --bdf-amber-dim: #2a2216;

    /* Traits & focus */
    --bdf-border: #2a2e38;
    --bdf-border-strong: #3d4452;
    --bdf-ring: #f59e0b;
    --bdf-divider-gold: #c9a24d;

    /* Sémantique (couleur = renfort ; jamais le seul signal) */
    --bdf-danger: #e5534b;
    --bdf-danger-dim: #3a1614;
    --bdf-ok: #c9a24d;
    --bdf-ok-dim: #231c0e;
    --bdf-info: #b8b0a4;
    --bdf-info-dim: #1a1c22;

    --bdf-banner-bg: #120e08;
    --bdf-banner-fg: #f2d88a;
    --bdf-banner-border: #7a5c24;
    --bdf-banner-height: 2.25rem;
    --bdf-ns-height: 2.75rem;
    --bdf-header-height: 3.5rem;
    --bdf-nav-bottom-height: 3.75rem;
    --bdf-touch-min: 44px;
    --bdf-radius: 0.625rem;
    --bdf-radius-sm: 0.375rem;

    --bdf-font-serif: "Cinzel", "Palatino Linotype", Palatino, "Times New Roman", Georgia, serif;
    --bdf-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --bdf-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, Consolas, monospace;

    --bdf-shadow: 0 1px 0 rgba(242, 216, 138, 0.06), 0 12px 32px rgba(0, 0, 0, 0.45);
    --bdf-glow-amber: 0 0 0 1px rgba(245, 158, 11, 0.35), 0 0 24px rgba(255, 140, 26, 0.12);

    /* ---- Mapping générique ---- */
    --bg-canvas: var(--bdf-bg);
    --bg-deep: var(--bdf-bg-deep);
    --bg-inset: var(--bdf-inset);
    --surface-1: var(--bdf-surface);
    --surface-2: var(--bdf-surface-2);
    --surface-3: var(--bdf-surface-3);
    --text-primary: var(--bdf-text);
    --text-secondary: var(--bdf-text-muted);
    --text-tertiary: var(--bdf-text-subtle);
    --text-inverse: var(--bdf-text-inverse);
    --border-subtle: var(--bdf-border);
    --border-strong: var(--bdf-border-strong);
    --accent-gold: var(--bdf-gold);
    --accent-gold-bright: var(--bdf-gold-bright);
    --accent-bronze: var(--bdf-bronze);
    --accent-amber: var(--bdf-amber);
    --accent-amber-hot: var(--bdf-amber-hot);
    --status-a-arbitrer: var(--bdf-amber);
    --status-en-cours: var(--bdf-gold-bright);
    --status-bloque: var(--bdf-danger);
    --status-valide: var(--bdf-ok);
    --status-info: var(--bdf-info);
    --status-prototype-isole: var(--bdf-gold);

    /* ---- Mapping Paperclip / shadcn / Tailwind v4 (ibf-theme.css) ---- */
    --background: var(--bdf-bg);
    --foreground: var(--bdf-text);
    --card: var(--bdf-surface);
    --card-foreground: var(--bdf-text);
    --popover: var(--bdf-surface-2);
    --popover-foreground: var(--bdf-text);
    --primary: var(--bdf-gold);
    --primary-foreground: var(--bdf-text-inverse);
    --secondary: var(--bdf-surface-2);
    --secondary-foreground: var(--bdf-text);
    --muted: var(--bdf-surface-3);
    --muted-foreground: var(--bdf-text-muted);
    --accent: var(--bdf-amber-dim);
    --accent-foreground: var(--bdf-gold-bright);
    --destructive: var(--bdf-danger);
    --destructive-foreground: var(--bdf-text);
    --border: var(--bdf-border);
    --input: var(--bdf-border);
    --ring: var(--bdf-ring);
    --radius: var(--bdf-radius);
  }

  /* Mode clair : ivoire / parchemin minéral, encre obsidienne, bronze lisible.
     Ambre approfondi à #9A4E00 (≥ 4,5:1 sur #F4EFE6). Or #8A6A2F (thème
     historique) n’atteint que 4,38:1 : on le réserve aux titres ≥ 18 px / 14 px
     gras, et on utilise --bdf-bronze / --bdf-gold pour le texte courant. */
  [data-theme="light"] {
    color-scheme: light;

    --bdf-bg: #f4efe6;
    --bdf-bg-deep: #ebe4d6;
    --bdf-surface: #fbf7f0;
    --bdf-surface-2: #fffaf3;
    --bdf-surface-3: #ece6da;
    --bdf-inset: #e4dccf;

    --bdf-text: #0a0b0e;
    --bdf-text-muted: #5f574b;
    --bdf-text-subtle: #6b5340;
    --bdf-text-inverse: #f4efe6;

    --bdf-gold: #7a5c24;
    --bdf-gold-bright: #9a4e00;
    --bdf-bronze: #5c451c;
    --bdf-amber: #9a4e00;
    --bdf-amber-hot: #7a3d00;
    --bdf-amber-dim: #f3e3c0;

    --bdf-border: #ded6c7;
    --bdf-border-strong: #c4b8a4;
    --bdf-ring: #9a4e00;
    --bdf-divider-gold: #7a5c24;

    --bdf-danger: #b3261e;
    --bdf-danger-dim: #f6e4e2;
    --bdf-ok: #7a5c24;
    --bdf-ok-dim: #efe4cc;
    --bdf-info: #5f574b;
    --bdf-info-dim: #efeae1;

    --bdf-banner-bg: #efe4cc;
    --bdf-banner-fg: #5c451c;
    --bdf-banner-border: #7a5c24;

    --bdf-shadow: 0 1px 0 rgba(122, 92, 36, 0.12), 0 10px 28px rgba(20, 17, 13, 0.08);
    --bdf-glow-amber: 0 0 0 1px rgba(154, 78, 0, 0.35);

    --bg-canvas: var(--bdf-bg);
    --bg-deep: var(--bdf-bg-deep);
    --bg-inset: var(--bdf-inset);
    --surface-1: var(--bdf-surface);
    --surface-2: var(--bdf-surface-2);
    --surface-3: var(--bdf-surface-3);
    --text-primary: var(--bdf-text);
    --text-secondary: var(--bdf-text-muted);
    --text-tertiary: var(--bdf-text-subtle);
    --text-inverse: var(--bdf-text-inverse);
    --border-subtle: var(--bdf-border);
    --border-strong: var(--bdf-border-strong);
    --accent-gold: var(--bdf-gold);
    --accent-gold-bright: var(--bdf-gold-bright);
    --accent-bronze: var(--bdf-bronze);
    --accent-amber: var(--bdf-amber);
    --accent-amber-hot: var(--bdf-amber-hot);
    --status-a-arbitrer: var(--bdf-amber);
    --status-en-cours: var(--bdf-gold-bright);
    --status-bloque: var(--bdf-danger);
    --status-valide: var(--bdf-ok);
    --status-info: var(--bdf-info);
    --status-prototype-isole: var(--bdf-gold);

    --background: var(--bdf-bg);
    --foreground: var(--bdf-text);
    --card: var(--bdf-surface);
    --card-foreground: var(--bdf-text);
    --popover: var(--bdf-surface-2);
    --popover-foreground: var(--bdf-text);
    --primary: var(--bdf-gold);
    --primary-foreground: var(--bdf-text-inverse);
    --secondary: var(--bdf-surface-3);
    --secondary-foreground: var(--bdf-text);
    --muted: var(--bdf-surface-3);
    --muted-foreground: var(--bdf-text-muted);
    --accent: var(--bdf-amber-dim);
    --accent-foreground: var(--bdf-bronze);
    --destructive: var(--bdf-danger);
    --destructive-foreground: var(--bdf-text-inverse);
    --border: var(--bdf-border);
    --input: var(--bdf-border);
    --ring: var(--bdf-ring);
    --radius: var(--bdf-radius);
  }

  /* --------------------------------------------------------------------------
     2. Typographie de base (surcouche légère, pas de reset agressif)
     -------------------------------------------------------------------------- */

  body {
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--bdf-font-sans);
  }

  .bdf-brand,
  .bdf-title,
  h1.bdf-title,
  h2.bdf-title {
    font-family: var(--bdf-font-serif);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .bdf-slogan {
    font-family: var(--bdf-font-serif);
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--accent-gold);
  }

  .bdf-mono,
  .bdf-id,
  .bdf-timestamp,
  .bdf-dragons,
  code.bdf-mono {
    font-family: var(--bdf-font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "ss01" 0;
    letter-spacing: 0.01em;
  }

  /* --------------------------------------------------------------------------
     3. États sémantiques — couleur + glyphe + bordure + libellé obligatoire
     Styles de bordure distincts : double, tirets, plein, pointillé.
     -------------------------------------------------------------------------- */

  .bdf-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.75rem;
    padding: 0.15rem 0.65rem;
    border-radius: var(--bdf-radius-sm);
    border-width: 2px;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--bdf-font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
  }

  .bdf-status__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    flex: 0 0 1rem;
    font-family: var(--bdf-font-mono);
    font-weight: 600;
    speak: never;
  }

  .bdf-status__glyph::before {
    content: var(--bdf-status-glyph, "·");
  }

  .bdf-status__label {
    display: inline;
  }

  /* À arbitrer — double trait, glyphe balance */
  .bdf-status--a-arbitrer {
    --bdf-status-glyph: "⚖";
    border-style: double;
    border-width: 3px;
    border-color: var(--status-a-arbitrer);
    color: var(--status-a-arbitrer);
    background: var(--bdf-amber-dim);
  }

  /* En cours — tirets, glyphe losange (comme le séparateur du logo) */
  .bdf-status--en-cours {
    --bdf-status-glyph: "◈";
    border-style: dashed;
    border-color: var(--status-en-cours);
    color: var(--status-en-cours);
  }

  /* Bloqué — plein épais, glyphe stop */
  .bdf-status--bloque {
    --bdf-status-glyph: "▣";
    border-style: solid;
    border-width: 3px;
    border-color: var(--status-bloque);
    color: var(--status-bloque);
    background: var(--bdf-danger-dim);
  }

  /* Validé — plein fin, glyphe coche */
  .bdf-status--valide {
    --bdf-status-glyph: "✓";
    border-style: solid;
    border-color: var(--status-valide);
    color: var(--status-valide);
    background: var(--bdf-ok-dim);
  }

  /* Info — pointillé, glyphe i */
  .bdf-status--info {
    --bdf-status-glyph: "ℹ";
    border-style: dotted;
    border-color: var(--status-info);
    color: var(--text-secondary);
    background: var(--bdf-info-dim);
  }

  /* Prototype isolé — tirets + filet intérieur, glyphe isolation */
  .bdf-status--prototype-isole {
    --bdf-status-glyph: "⬡";
    border-style: dashed;
    border-color: var(--status-prototype-isole);
    color: var(--status-prototype-isole);
    box-shadow: inset 0 0 0 1px var(--status-prototype-isole);
  }

  /* Badges de provenance / délégation (chemin Gouvernant vs La Main) */
  .bdf-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .bdf-tag--prepare {
    border-style: dashed;
    border-color: var(--accent-gold);
    color: var(--accent-gold);
  }

  .bdf-tag--delegation {
    border-style: dotted;
    border-color: var(--accent-amber);
    color: var(--accent-amber);
  }

  .bdf-tag--reserve {
    border-style: double;
    border-width: 3px;
    border-color: var(--accent-amber);
    color: var(--accent-amber);
    font-weight: 700;
  }

  .bdf-tag--fictif {
    border-style: dashed;
    border-color: var(--border-strong);
    color: var(--text-secondary);
  }

  /* --------------------------------------------------------------------------
     4. Bannière permanente « prototype isolé » + rappel Note de service (R5)
        Non bloquante : n’empêche jamais d’ouvrir Bloqué / À arbitrer (R7).
     -------------------------------------------------------------------------- */

  .bdf-banner-lab,
  body.bdf-lab::before {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--bdf-banner-height);
    padding: 0.25rem 0.75rem;
    background: var(--bdf-banner-bg);
    color: var(--bdf-banner-fg);
    border-bottom: 1px solid var(--bdf-banner-border);
    font-family: var(--bdf-font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    box-sizing: border-box;
  }

  body.bdf-lab::before {
    content: "Prototype isolé — Option C  ·  Zéro accès prod/financier";
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
  }

  .bdf-ns-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--bdf-ns-height);
    padding: 0.35rem 1rem;
    background: var(--bdf-amber-dim);
    color: var(--text-primary);
    border-bottom: 2px double var(--accent-amber);
    font-size: 0.85rem;
  }

  .bdf-ns-reminder__id {
    font-family: var(--bdf-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--accent-amber);
  }

  .bdf-ns-reminder a,
  .bdf-ns-reminder .bdf-btn {
    flex: 0 0 auto;
    min-height: var(--bdf-touch-min);
    min-width: var(--bdf-touch-min);
  }

  /* --------------------------------------------------------------------------
     5. En-tête, logo, boutons, focus, cibles tactiles
     -------------------------------------------------------------------------- */

  .bdf-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--bdf-header-height);
    padding: 0 1rem;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border-subtle);
  }

  .bdf-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex: 0 0 36px;
  }

  .bdf-logo--guard {
    width: min(72vw, 280px);
    height: auto;
  }

  .bdf-btn,
  .bdf-touch {
    min-height: var(--bdf-touch-min);
    min-width: var(--bdf-touch-min);
    padding: 0.5rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: var(--bdf-radius-sm);
    font-family: var(--bdf-font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    cursor: pointer;
  }

  .bdf-btn--primary {
    background: var(--accent-gold);
    color: var(--text-inverse);
    border: 1px solid var(--accent-gold);
  }

  .bdf-btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
  }

  .bdf-btn--danger {
    background: transparent;
    color: var(--status-bloque);
    border: 2px solid var(--status-bloque);
  }

  .bdf-skip {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    z-index: 1100;
    background: var(--surface-2);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    min-height: var(--bdf-touch-min);
  }

  .bdf-skip:focus {
    top: 0.5rem;
  }

  :focus-visible,
  .bdf-btn:focus-visible,
  .bdf-status:focus-visible,
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* --------------------------------------------------------------------------
     6. Responsive — mobile 390 px / desktop 1440 px
     -------------------------------------------------------------------------- */

  /* Mobile (référence 390 px, jusqu’à tablette) : empilement, nav basse. */
  .bdf-shell {
    min-height: 100dvh;
    background: var(--bg-canvas);
    color: var(--text-primary);
  }

  .bdf-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .bdf-nav-side {
    display: none;
  }

  .bdf-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.75rem;
    padding-bottom: calc(var(--bdf-nav-bottom-height) + 1rem);
  }

  .bdf-proof {
    display: none;
  }

  .bdf-proof.is-open,
  .bdf-proof[data-open="true"] {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 900;
    max-height: 78dvh;
    overflow: auto;
    background: var(--surface-1);
    border-top: 2px solid var(--accent-gold);
    border-radius: var(--bdf-radius) var(--bdf-radius) 0 0;
    padding: 1rem;
    padding-bottom: calc(var(--bdf-nav-bottom-height) + 1rem);
    box-shadow: var(--bdf-shadow);
  }

  .bdf-home-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .bdf-home-block {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--bdf-radius);
    padding: 0.75rem;
  }

  .bdf-home-block__title {
    font-family: var(--bdf-font-serif);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
  }

  .bdf-nav-bottom {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    min-height: var(--bdf-nav-bottom-height);
    background: var(--bg-deep);
    border-top: 1px solid var(--border-subtle);
    padding: 0 0.25rem env(safe-area-inset-bottom, 0);
  }

  .bdf-nav-bottom a,
  .bdf-nav-bottom button {
    flex: 1 1 0;
    min-height: var(--bdf-touch-min);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: 0;
  }

  .bdf-nav-bottom [aria-current="page"],
  .bdf-nav-bottom .is-active {
    color: var(--accent-gold);
  }

  .bdf-drawer {
    display: none;
  }

  .bdf-drawer.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 980;
    background: color-mix(in srgb, var(--bg-deep) 80%, transparent);
  }

  .bdf-drawer__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85dvh;
    overflow: auto;
    background: var(--surface-1);
    border-top: 1px solid var(--accent-gold);
    border-radius: var(--bdf-radius) var(--bdf-radius) 0 0;
    padding: 1rem;
    padding-bottom: calc(var(--bdf-nav-bottom-height) + 1rem);
  }

  .bdf-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    min-height: var(--bdf-touch-min);
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--bdf-radius-sm);
    background: var(--surface-2);
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .bdf-item:hover,
  .bdf-item:focus-visible {
    border-color: var(--accent-gold);
    box-shadow: var(--bdf-glow-amber);
  }

  /* Desktop référence 1440 px : grille 12 colonnes, nav latérale + preuve. */
  @media (min-width: 1440px) {
    .bdf-nav-bottom,
    .bdf-drawer {
      display: none !important;
    }

    .bdf-nav-side {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      padding: 1rem 0.75rem;
      background: var(--bg-deep);
      border-right: 1px solid var(--border-subtle);
    }

    .bdf-nav-side a,
    .bdf-nav-side button {
      min-height: var(--bdf-touch-min);
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0 0.75rem;
      border-radius: var(--bdf-radius-sm);
      color: var(--text-secondary);
      text-decoration: none;
      background: none;
      border: 0;
      font-weight: 500;
      text-align: left;
    }

    .bdf-nav-side [aria-current="page"],
    .bdf-nav-side .is-active {
      color: var(--accent-gold);
      background: var(--bdf-amber-dim);
    }

    .bdf-layout {
      display: grid;
      grid-template-columns: repeat(12, minmax(0, 1fr));
      grid-template-rows: auto 1fr;
      gap: 0;
      min-height: calc(100dvh - var(--bdf-banner-height) - var(--bdf-header-height));
    }

    .bdf-nav-side {
      grid-column: 1 / 3;
      grid-row: 1 / -1;
    }

    .bdf-main {
      grid-column: 3 / 10;
      padding: 1.25rem 1.5rem;
      padding-bottom: 1.5rem;
    }

    .bdf-proof,
    .bdf-proof.is-open,
    .bdf-proof[data-open="true"] {
      display: block;
      position: static;
      grid-column: 10 / 13;
      grid-row: 1 / -1;
      max-height: none;
      overflow: auto;
      border: 0;
      border-left: 1px solid var(--border-subtle);
      border-radius: 0;
      padding: 1.25rem 1rem;
      box-shadow: none;
    }

    .bdf-home-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-areas:
        "arbitrer encours"
        "bloque   resultats";
      gap: 1rem;
    }

    .bdf-home-block--arbitrer { grid-area: arbitrer; }
    .bdf-home-block--encours { grid-area: encours; }
    .bdf-home-block--bloque { grid-area: bloque; }
    .bdf-home-block--resultats { grid-area: resultats; }

    .bdf-home-block--bloque {
      border-color: var(--status-bloque);
      border-style: solid;
      border-width: 1px 1px 1px 3px;
    }

    .bdf-home-block--arbitrer {
      border-color: var(--status-a-arbitrer);
      border-style: solid;
      border-width: 1px 1px 1px 3px;
    }
  }

  /* Écran de garde (branding, avant session) */
  .bdf-guard {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--bdf-bg-deep, #0a0b0e);
    color: var(--bdf-text, #ece7dc);
    text-align: center;
    padding: 2rem 1rem;
  }

  .bdf-guard .bdf-title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: var(--accent-gold-bright, #f2d88a);
    margin: 0;
  }

  .bdf-diamond {
    width: 0.65rem;
    height: 0.65rem;
    background: var(--accent-amber);
    transform: rotate(45deg);
    margin: 0.25rem auto;
  }

  /* Séparation visuelle « données fictives / supervision seule » */
  .bdf-fictive-panel {
    border: 2px dashed var(--border-strong);
    border-radius: var(--bdf-radius);
    padding: 1rem;
    background: var(--surface-1);
  }

  .bdf-fictive-panel::before {
    content: "Données fictives / Supervision seule — Phase 1";
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }
}
