/* ============================================================
   KAEDRIA CAPTURE — Onyx & Or
   Layout glassmorphism plein écran, Tao en background
============================================================ */

/* ---------- Reset + variables brand ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Palette Kaedria Onyx & Or */
  --onyx:        #0E0E10;
  --onyx-soft:   #1a1a1d;
  --graphite:    #3D3D40;
  --gold:        #B08D57;
  --gold-bright: #d4a96d;
  --gold-deep:   #8a6d40;
  --ivoire:      #F4EDE4;
  --bordeaux:    #6B1D2A;

  /* Typo */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--onyx);
  color: var(--ivoire);
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYER 1 — TAO PLEIN ÉCRAN
   La translation horizontale est gérée par la classe sur <body>
   pour positionner Tao différemment selon la vue active
============================================================ */
.tao-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  transition: transform 700ms cubic-bezier(.4, 0, .2, 1);
  transform-origin: center bottom;
  will-change: transform;
  /* Mask radial doux : Tao fade-out en douceur sur les bords gauche/droite
     pour éviter les "lignes nettes" entre la zone Tao et le fond noir */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 8%,
    black 22%,
    black 78%,
    rgba(0, 0, 0, 0.6) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(to right,
    transparent 0%,
    rgba(0, 0, 0, 0.6) 8%,
    black 22%,
    black 78%,
    rgba(0, 0, 0, 0.6) 92%,
    transparent 100%
  );
}

/* ============================================================
   Positions de Tao selon la vue active (PROGRESSIVE)
   Principe : grand ecran = Tao decale (laisse place aux cards).
   Plus l'ecran retrecit, plus Tao se re-centre + s'estompe progressivement.
   Sur mobile : Tao en watermark (cf. media queries plus bas).
   Le translate ne pousse JAMAIS Tao hors de l'ecran.
============================================================ */
/* pose1-idle (vue home) est cadree a GAUCHE du 16:9 (photo refaite 02/07,
   face_x ~19% vs ~50% avant) : shift +31pt vs avant pour compenser et
   garder Tao a droite des cards. pose2-pointe/pose5-bureau restent cadrees
   a droite, donc nouveau/biblio n'ont pas besoin du meme ajustement. */
body.view-home    .tao-stage { transform: translateX(46%); }
body.view-nouveau .tao-stage { transform: translateX(-15%) scale(0.85); transform-origin: left bottom; }
body.view-biblio  .tao-stage { transform: translateX(18%); }

.tao-pose {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(.4, 0, .2, 1);
  /* Respiration subtile : pulse 4s très léger */
  animation: tao-breathe 5s ease-in-out infinite;
}

.tao-pose-active {
  opacity: 1;
}

@keyframes tao-breathe {
  0%, 100% { transform: scale(1.0); }
  50%      { transform: scale(1.012); }
}

/* ============================================================
   LAYER 2 — MESH GRADIENT ANIMÉ (overlay subtle)
   Donne une ambiance "scène" avec des spots de lumière qui bougent
============================================================ */
.mesh-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* Sans mix-blend-mode pour éviter d'éclaircir le noir des zones vides (= bandes plus claires)
     Intensités augmentées pour rester visibles malgré la suppression du blend */
  background:
    radial-gradient(ellipse at 22% 28%, rgba(176, 141, 87, 0.13) 0%, transparent 42%),
    radial-gradient(ellipse at 78% 72%, rgba(107, 29, 42, 0.11) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 105%, rgba(176, 141, 87, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 10%, rgba(212, 169, 109, 0.06) 0%, transparent 35%);
  animation: mesh-drift 22s ease-in-out infinite alternate;
  will-change: transform, background-position;
}

@keyframes mesh-drift {
  0%   { transform: scale(1)    translate(0,   0);   }
  50%  { transform: scale(1.04) translate(2%,  -1%); }
  100% { transform: scale(1.02) translate(-2%, 2%);  }
}

/* ============================================================
   LAYER 3 — PARTICULES DORÉES
   Petites poussières d'or qui flottent en arrière-plan léger
============================================================ */
.particles {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-bright);
  opacity: 0;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-110vh) translateX(var(--drift, 0px)); opacity: 0; }
}

/* ============================================================
   LAYER 4 — UI GLASSMORPHISM
============================================================ */
.ui-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 32px 48px;
  pointer-events: none; /* on remet pointer-events sur les enfants interactifs */
}

.ui-layer > *,
.ui-layer button,
.ui-layer .glass,
.ui-layer .back-btn {
  pointer-events: auto;
}

/* ---------- En-tête brand ---------- */
.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.brand-mark {
  font-size: 24px;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(212, 169, 109, 0.55);
}
.brand-name { color: var(--gold-bright); }
.brand-sep  { color: var(--graphite); margin: 0 2px; font-size: 26px; }
.brand-product {
  color: var(--ivoire);
  font-style: italic;
  letter-spacing: 0.05em;
  text-transform: none;
  font-size: 28px;
  font-weight: 400;
}

/* ---------- Glassmorphism base ---------- */
.glass {
  background: rgba(14, 14, 16, 0.55);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  border: 1px solid rgba(176, 141, 87, 0.22);
  border-radius: 20px;
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(244, 237, 228, 0.06);
  transition: border-color 300ms, box-shadow 300ms;
}

.glass:hover {
  border-color: rgba(176, 141, 87, 0.5);
  box-shadow:
    0 28px 70px -18px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(176, 141, 87, 0.25),
    inset 0 1px 0 rgba(244, 237, 228, 0.10);
}

/* ============================================================
   VUES (accueil + stubs)
============================================================ */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms, transform 400ms;
}

.view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  animation: view-fade-in 600ms cubic-bezier(.4, 0, .2, 1);
}

@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   VUE HOME — Welcome + 2 boutons d'action
============================================================ */
.welcome-card {
  max-width: 540px;
  padding: 42px 44px 38px;
  margin-bottom: 36px;
  margin-left: 0;
}

.greeting-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--gold-bright);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.greeting-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.1;
  color: var(--ivoire);
  margin-bottom: 18px;
  letter-spacing: -0.005em;
}

.greeting-sub {
  font-size: 14px;
  font-weight: 300;
  color: rgba(244, 237, 228, 0.7);
  line-height: 1.55;
  max-width: 420px;
}

/* ---------- 2 boutons d'action ---------- */
.actions {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 240px;
  padding: 28px 26px 24px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.action-icon {
  font-size: 26px;
  color: var(--gold-bright);
  margin-bottom: 14px;
  display: block;
  text-shadow: 0 0 12px rgba(212, 169, 109, 0.4);
}

.action-label {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ivoire);
  margin-bottom: 4px;
  letter-spacing: 0.005em;
}

.action-hint {
  font-size: 12px;
  font-weight: 300;
  color: rgba(244, 237, 228, 0.55);
  letter-spacing: 0.02em;
}

/* ============================================================
   VUES STUB (Nouveau / Biblio)
   Position de la card adaptée à où Tao "regarde" / pointe
============================================================ */
.stub-card {
  max-width: 480px;
  padding: 44px 44px 38px;
  text-align: center;
}

/* Nouveau webinaire : Tao est décalé à gauche et pointe vers la droite
   → la card prend place à droite, centrée verticalement pour qu'elle ne déborde pas
   même quand elle est étendue (formulaire + progress + bouton Nouvelle capture) */
.view-nouveau {
  justify-content: center;
  align-items: flex-end;
  padding: 20px 60px 30px 0;
}

/* Bibliothèque : Tao est assis à droite avec son MacBook
   → la card prend place à gauche, à hauteur du visage de Tao */
.view-biblio {
  justify-content: center;
  align-items: flex-start;
  padding-left: 40px;
}

.stub-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  color: var(--gold-bright);
  margin-bottom: 18px;
  letter-spacing: 0.005em;
}

.stub-text {
  font-size: 15px;
  color: rgba(244, 237, 228, 0.75);
  line-height: 1.65;
  margin-bottom: 32px;
}

.back-btn {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 100px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--gold-bright);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 200ms;
}

.back-btn:hover {
  border-color: var(--gold-bright);
  background: rgba(176, 141, 87, 0.12);
  color: var(--ivoire);
}

/* ============================================================
   FORMULAIRE (Nouveau webinaire)
============================================================ */
.form-card {
  width: 480px;
  max-width: 90vw;
  max-height: 86vh;        /* limite la hauteur pour rester dans l'ecran */
  overflow-y: auto;        /* scroll interne si le contenu deborde */
  padding: 36px 38px 32px;
}
.form-card::-webkit-scrollbar { width: 5px; }
.form-card::-webkit-scrollbar-track { background: transparent; }
.form-card::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, 0.3); border-radius: 3px; }
.form-card::-webkit-scrollbar-thumb:hover { background: rgba(176, 141, 87, 0.55); }

.form-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--gold-bright);
  margin-bottom: 22px;
  letter-spacing: 0.01em;
}

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 237, 228, 0.55);
  margin-bottom: 8px;
  font-weight: 400;
}

.form-row { display: flex; gap: 10px; }

.form-input {
  flex: 1;
  background: rgba(14, 14, 16, 0.5);
  border: 1px solid rgba(176, 141, 87, 0.28);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ivoire);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 200ms, background 200ms, box-shadow 200ms;
  width: 100%;
}

.form-input:focus {
  border-color: var(--gold-bright);
  background: rgba(14, 14, 16, 0.7);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.12);
}

.form-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6) sepia(1) saturate(3) hue-rotate(-10deg) brightness(1.1);
  cursor: pointer;
}

/* ---------- Combobox custom (série) ---------- */
.combo { position: relative; }
.combo-input { padding-right: 42px; }
.combo-arrow {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--gold-bright);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 200ms, transform 250ms;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
}
.combo-arrow:hover { background: rgba(176, 141, 87, 0.15); }
.combo[data-open="true"] .combo-arrow {
  transform: translateY(-50%) rotate(180deg);
}
.combo-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(14, 14, 16, 0.96);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border: 1px solid rgba(176, 141, 87, 0.32);
  border-radius: 10px;
  z-index: 100;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(244, 237, 228, 0.06);
  animation: fade-in-up 220ms cubic-bezier(.4, 0, .2, 1);
}
.combo-list::-webkit-scrollbar { width: 5px; }
.combo-list::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, 0.35); border-radius: 3px; }
.combo-list-item {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ivoire);
  cursor: pointer;
  transition: background 150ms, color 150ms;
  border-bottom: 1px solid rgba(176, 141, 87, 0.06);
}
.combo-list-item:last-child { border-bottom: none; }
.combo-list-item:hover,
.combo-list-item.focused {
  background: rgba(176, 141, 87, 0.18);
  color: var(--gold-bright);
}
.combo-list-empty {
  padding: 16px;
  font-size: 12px;
  font-style: italic;
  color: rgba(244, 237, 228, 0.55);
  text-align: center;
}

.form-hint {
  font-size: 12px;
  font-style: italic;
  color: rgba(244, 237, 228, 0.65);
  margin-top: 8px;
  min-height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold-bright));
  color: var(--onyx);
  border: none;
  border-radius: 100px;
  padding: 12px 26px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
  box-shadow: 0 6px 20px -8px rgba(176, 141, 87, 0.6);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -8px rgba(212, 169, 109, 0.8);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-bright);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 200ms;
  white-space: nowrap;
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(176, 141, 87, 0.12);
  border-color: var(--gold-bright);
}
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Lecteurs Vimeo verrouilles : scan + selection ---------- */
.btn-probe { display: block; width: 100%; margin-top: 10px; }
.locked-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.locked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(26, 26, 29, 0.6);
  border: 1px solid rgba(176, 141, 87, 0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 180ms;
}
.locked-item:hover { border-color: var(--gold-bright); background: rgba(176, 141, 87, 0.1); }
.locked-item.selected {
  border-color: var(--gold-bright);
  background: rgba(176, 141, 87, 0.18);
  box-shadow: inset 0 0 0 1px rgba(212, 169, 109, 0.4);
}
.locked-item-label { font-size: 13px; color: var(--ivoire); font-weight: 500; }
.locked-item.selected .locked-item-label { color: var(--gold-bright); }
.locked-item-meta { font-size: 12px; font-style: italic; color: rgba(244, 237, 228, 0.6); white-space: nowrap; }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

/* ============================================================
   PROGRESS (capture en cours)
============================================================ */
.progress-zone {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(176, 141, 87, 0.15);
}
.progress-step {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--gold-bright);
  margin-bottom: 10px;
}
.progress-bar {
  height: 6px;
  background: rgba(244, 237, 228, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  border-radius: 3px;
  transition: width 600ms ease-out;
  box-shadow: 0 0 12px rgba(212, 169, 109, 0.55);
}

/* Mode "indéterminé" pendant Whisper (pas de % réel, on anime un shimmer) */
.progress-fill.indeterminate {
  background: linear-gradient(90deg,
    var(--gold-deep) 0%,
    var(--gold-bright) 30%,
    rgba(244, 237, 228, 0.6) 50%,
    var(--gold-bright) 70%,
    var(--gold-deep) 100%);
  background-size: 220% 100%;
  animation: shimmer-progress 1.8s linear infinite;
}
@keyframes shimmer-progress {
  0%   { background-position: 220% 0; }
  100% { background-position: -120% 0; }
}
.progress-status {
  font-size: 11px;
  font-family: 'Consolas', 'SF Mono', monospace;
  color: rgba(244, 237, 228, 0.5);
  margin-top: 10px;
  word-break: break-all;
  line-height: 1.4;
}

.progress-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  animation: fade-in-up 500ms cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BIBLIOTHÈQUE
============================================================ */
.lib-card {
  width: 580px;
  max-width: 92vw;
  max-height: 78vh;
  padding: 30px 0 20px;
  display: flex;
  flex-direction: column;
}

.lib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px 18px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.14);
  gap: 14px;
}
.lib-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 0.01em;
}
.lib-header-actions { display: flex; gap: 10px; align-items: center; }
.btn-icon {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--gold-bright);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms;
  font-weight: 500;
}
.btn-icon:hover {
  background: rgba(176, 141, 87, 0.15);
  border-color: var(--gold-bright);
  transform: rotate(180deg);
}

.lib-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 36px 0;
}
.lib-content::-webkit-scrollbar { width: 6px; }
.lib-content::-webkit-scrollbar-track { background: transparent; }
.lib-content::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, 0.25); border-radius: 3px; }
.lib-content::-webkit-scrollbar-thumb:hover { background: rgba(176, 141, 87, 0.55); }

.lib-empty {
  text-align: center;
  font-style: italic;
  color: rgba(244, 237, 228, 0.55);
  padding: 36px 16px;
  font-size: 14px;
  line-height: 1.7;
}

.lib-serie { margin-bottom: 24px; }
.lib-serie:last-child { margin-bottom: 4px; }

.lib-serie-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ivoire);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.lib-count {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgba(244, 237, 228, 0.4);
  font-style: italic;
  white-space: nowrap;
}

.lib-entries { display: flex; flex-direction: column; gap: 8px; }

.lib-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(244, 237, 228, 0.03);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 200ms, border-color 200ms;
}
.lib-entry:hover {
  background: rgba(244, 237, 228, 0.06);
  border-color: rgba(176, 141, 87, 0.2);
}
.lib-entry-info { flex: 1; min-width: 0; }
.lib-date {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--gold-bright);
  margin-bottom: 4px;
}
.lib-files { font-size: 12px; color: rgba(244, 237, 228, 0.7); }
.lib-video { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.lib-badges { display: flex; gap: 6px; margin-top: 4px; }
.badge {
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(176, 141, 87, 0.2);
  color: var(--gold-bright);
  font-weight: 500;
}

.btn-open {
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: 6px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--gold-bright);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 200ms;
  flex-shrink: 0;
}
.btn-open:hover {
  background: rgba(176, 141, 87, 0.15);
  border-color: var(--gold-bright);
}

/* ============================================================
   FICHIER LOCAL — séparateur "ou" + bouton pleine largeur
============================================================ */
.local-group { margin-top: -4px; }
.local-group .btn-local { width: 100%; }
.or-sep {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 2px 0 12px;
}
.or-sep::before, .or-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 141, 87, 0.45), transparent);
}
.or-sep span {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
  opacity: 0.7;
}

/* ============================================================
   RESPONSIVE — Tablette + Mobile
   Sur mobile, on bascule Tao en watermark sous l'UI (lisibilité prime),
   les cards prennent toute la largeur, boutons touch-friendly.
============================================================ */

/* ---------- Desktop moyen (1400-1700px) : translate reduit ---------- */
@media (max-width: 1700px) {
  body.view-home    .tao-stage { transform: translateX(41%); }
  body.view-nouveau .tao-stage { transform: translateX(-10%) scale(0.82); transform-origin: left bottom; }
  body.view-biblio  .tao-stage { transform: translateX(12%); }
}

/* ---------- Desktop compact (1100-1400px) : Tao plus proche du centre + leger fade ---------- */
@media (max-width: 1400px) {
  body.view-home    .tao-stage { transform: translateX(36%); opacity: 0.85; }
  body.view-nouveau .tao-stage { transform: translateX(-5%) scale(0.78); opacity: 0.85; }
  body.view-biblio  .tao-stage { transform: translateX(6%); opacity: 0.85; }
}

/* ---------- Tablette (max ~1100px) : Tao centre + fade plus marque ---------- */
@media (max-width: 1100px) {
  .brand-header     { font-size: 24px; gap: 10px; }
  .brand-mark       { font-size: 20px; }
  .brand-product    { font-size: 22px; }
  .greeting-title   { font-size: 40px; }
  .welcome-card     { padding: 32px 32px 28px; max-width: 480px; }
  .form-card        { width: 440px; }
  .lib-card         { width: 540px; }

  /* Tao centre, scale reduit, opacite reduite pour ne pas concurrencer les cards.
     view-home garde un leger decalage : pose1-idle est cadree a gauche, sans
     translateX son visage se retrouve coupe par la card (visage a moitie cache). */
  body.view-home    .tao-stage {
    transform: translateX(38%) scale(0.85);
    transform-origin: center bottom;
    opacity: 0.65;
  }
  body.view-nouveau .tao-stage,
  body.view-biblio  .tao-stage {
    transform: scale(0.85);
    transform-origin: center bottom;
    opacity: 0.65;
  }
}

/* ---------- Mobile (max 720px) : layout vertical, Tao en watermark ---------- */
@media (max-width: 720px) {
  /* Brand plus petit, centré */
  .brand-header {
    font-size: 18px;
    gap: 8px;
    letter-spacing: 0.08em;
    justify-content: center;
    width: 100%;
  }
  .brand-mark    { font-size: 14px; }
  .brand-product { font-size: 17px; }
  .brand-sep     { font-size: 16px; }

  /* Tao en watermark : opacity réduite, scale fixed, derrière l'UI */
  .tao-stage {
    transform: none !important;
    opacity: 0.35;
    /* mask plus permissif sur mobile (image full) */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
  }

  /* UI prend toute la largeur, scroll vertical autorisé */
  html, body { overflow-y: auto; height: auto; min-height: 100%; }
  .ui-layer {
    position: relative;
    padding: 18px 14px 24px;
    min-height: 100vh;
  }

  /* Toutes les vues : scroll naturel, cards full-width */
  .view {
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  .welcome-card, .form-card, .lib-card, .actions {
    width: 100%;
    max-width: none;
  }
  .welcome-card { margin: 18px 0 22px; padding: 26px 22px; }
  .greeting-title { font-size: 30px; line-height: 1.15; }
  .greeting-eyebrow { font-size: 18px; }

  /* Boutons d'action : pleine largeur, empilés, touch-friendly */
  .actions { flex-direction: column; gap: 12px; }
  .action-card { width: 100%; padding: 22px 22px 20px; }
  .action-label { font-size: 22px; }

  /* Form : full width */
  .form-card { padding: 26px 22px 24px; max-height: none; overflow-y: visible; }
  .form-title { font-size: 28px; margin-bottom: 18px; }
  .form-input { font-size: 16px; /* iOS/Android : 16px évite le zoom auto au focus */ }
  .form-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .form-actions .back-btn,
  .form-actions .btn-primary { width: 100%; }

  /* Biblio : full width */
  .lib-card { padding: 22px 0 18px; max-height: 80vh; }
  .lib-header { padding: 0 22px 14px; }
  .lib-title { font-size: 26px; }
  .lib-content { padding: 14px 22px 0; }
  .lib-entry { flex-direction: column; align-items: stretch; gap: 10px; }
  .btn-open { width: 100%; padding: 10px 14px; font-size: 13px; }

  /* Combo : dropdown qui ne déborde pas sous le clavier mobile */
  .combo-list { max-height: 180px; }
}

/* ---------- Très petits écrans (< 380px) ---------- */
@media (max-width: 380px) {
  .greeting-title { font-size: 26px; }
  .form-title, .lib-title, .stub-title { font-size: 24px; }
  .brand-product { font-size: 15px; }
}

/* ============================================================
   SYNTHÈSE D'APPRENTISSAGE — badge, boutons, fenêtre de lecture
============================================================ */
.lib-entry-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  flex: 0 0 auto;
}
.badge-synth {
  background: rgba(107, 29, 42, 0.25);
  color: #e8b9a0;
  border: 1px solid rgba(176, 141, 87, 0.35);
}

/* Bouton synthèse = action principale de l'entrée (plus visible que "Ouvrir") */
.btn-synth {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--onyx);
  cursor: pointer;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: filter 180ms, transform 120ms;
}
.btn-synth:hover:not(:disabled) { filter: brightness(1.12); }
.btn-synth:active:not(:disabled) { transform: translateY(1px); }
.btn-synth:disabled { opacity: 0.65; cursor: progress; }
/* Variante "générer" (pas encore de fiche) : contour, moins plein */
.btn-synth-gen {
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid rgba(176, 141, 87, 0.55);
}
.btn-synth-gen:hover:not(:disabled) {
  background: rgba(176, 141, 87, 0.12);
  filter: none;
}

/* ---------- Fenêtre de lecture (overlay plein écran) ---------- */
.synth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 8, 10, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.synth-overlay[hidden] { display: none; }
.synth-modal {
  width: min(900px, 100%);
  height: min(92vh, 100%);
  display: flex;
  flex-direction: column;
  background: var(--ivoire);
  border: 1px solid rgba(176, 141, 87, 0.5);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.synth-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--onyx);
  border-bottom: 1px solid rgba(176, 141, 87, 0.35);
}
.synth-bar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.synth-bar-actions { display: flex; align-items: center; gap: 10px; }
.synth-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: var(--ivoire);
}

@media (max-width: 600px) {
  .synth-overlay { padding: 0; }
  .synth-modal { height: 100%; width: 100%; border-radius: 0; }
  .synth-bar-title { font-size: 16px; }
  .lib-entry-actions { flex-direction: row; flex-wrap: wrap; }
  .btn-synth { flex: 1; padding: 11px 14px; font-size: 14px; }
}
