/* =========================================================
   NVNC — UI Deep Glass (SaaS & Smooth)
   Feuille CSS optimisée & nettoyée
   ========================================================= */

/* =========================================================
   0) VARIABLES GLOBALES & RESET
   ========================================================= */

/* Google Fonts remplace par self-hosting (Phase 5.3 Securite) - voir /css/fonts.css */

:root {
  /* Palette de base */
  --bg-app: #0a0c10;
  --bg-sidebar: #0f1116;
  --bg-card: rgba(20, 23, 31, 0.65);
  --bg-card-hover: rgba(30, 35, 45, 0.75);

  /* Couleurs de texte */
  --text-main: #e2e8f0;
  --text-muted: #a1b1c4; /* Phase 6.2: WCAG AA 4.5:1 min (avant: #94a3b8 = 4.04:1) */
  --text-dim: #7a8ba0;   /* Phase 6.2: WCAG AA 4.5:1 min (avant: #64748b = 2.94:1) */

  /* Couleurs de marque */
  --primary: #818cf8;
  --primary-glow: rgba(129, 140, 248, 0.25);
  --accent: #c084fc;
  --accent-author: #8b5cf6;
  --danger: #f87171;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  --gold: #fbbf24;
  --bg-surface: #1e293b;
  --bg-inset: #334155;

  /* Bordures & ombres */
  --border-glass: 1px solid rgba(255, 255, 255, 0.06);
  --border-active: 1px solid rgba(129, 140, 248, 0.3);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --glass-blur: blur(12px);

  /* Layout */
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --sidebar-width: 260px;
  --header-height: 64px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset */
* {
  box-sizing: border-box;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(129, 140, 248, 0.03) 0%, transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(192, 132, 252, 0.03) 0%, transparent 25%);
  color: var(--text-main);
  height: 100%;
  overflow-x: hidden;
}

/* =========================================================
   1) TYPOGRAPHIE & LIENS
   ========================================================= */

h1, h2, h3 {
  font-family: 'Lora', serif;
  font-weight: 600;
  color: #fff;
  margin-top: 0;
}

h1 { font-size: 1.85rem; letter-spacing: -0.02em; margin-bottom: 1rem; }
h2 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--text-main); }
h3 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-muted); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--accent); }

.h1-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #fff !important;
  font-family: 'Lora', serif;
  font-size: 2rem;
  font-weight: 600;
  padding: 0;
  width: 100%;
}

.h1-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05) !important;
}
.h1-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* =========================================================
   2) LAYOUT GLOBAL (APP SHELL, SIDEBAR, MAIN)
   ========================================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: var(--border-glass);
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s var(--ease-smooth);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: var(--border-glass);
}

.logo img {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.3));
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.nav-item.active {
  background: rgba(129, 140, 248, 0.1);
  color: var(--primary);
  border: 1px solid rgba(129, 140, 248, 0.15);
}

.sidebar-footer {
  padding: 1rem;
  border-top: var(--border-glass);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  width: calc(100% - var(--sidebar-width));
  max-width: 1800px;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1rem; width: 100%; }

  /* Tables plus compactes sur mobile */
  .table-container th,
  .table-container td { padding: 0.6rem; }

  /* Masque les colonnes secondaires (ex: Aperçu/Arc) sur mobile */
  .hide-mobile { display: none !important; }
}

/* =========================================================
   3) COMPOSANTS GÉNÉRIQUES (CARTES, FORMULAIRES, BOUTONS)
   ========================================================= */

/* Cartes */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover { border-color: rgba(255, 255, 255, 0.1); }
.card h2 { margin-top: 0; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-header h3 { margin: 0; }

/* Inputs */
input, textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
  font-weight: 500;
}

/* Boutons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.25);
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(129, 140, 248, 0.4);
}

button.danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

button.alt, .btn-ghost {
  background: transparent;
  border: var(--border-glass);
  box-shadow: none;
  color: var(--text-muted);
}

button.alt:hover, .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-glass);
  color: var(--text-muted);
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

.badge.active {
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary);
  border-color: rgba(129, 140, 248, 0.3);
}

.badge-purchase { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.badge-ai { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.badge-transfer-in { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.badge-transfer-out { background: rgba(251, 146, 60, 0.2); color: #fb923c; }

/* Inputs spéciaux */
.note-input { width: 100% !important; box-sizing: border-box; min-width: 0; }

.status-select {
  background: rgba(0, 0, 0, 0.3);
  border: var(--border-glass);
  color: #fff;
  border-radius: 6px;
  padding: 5px;
  width: 100%;
  margin-bottom: 10px;
}

.select-sm {
  padding: 0.5rem;
  background: var(--bg-card);
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
}

.date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.date-row input { width: 130px; font-size: 0.8rem; padding: 4px; }

.badge-status {
  font-size: 0.8rem;
  margin-left: 10px;
  font-family: monospace;
  opacity: 0;
  transition: opacity 0.5s ease;
  font-weight: bold;
}

.badge-status.visible { opacity: 1 !important; }

/* =========================================================
   4) TABLES & CONTENEURS SCROLLABLES
   ========================================================= */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-container {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(0, 0, 0, 0.15);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(255, 255, 255, 0.05);
}

.table-container table { width: 100%; border-collapse: collapse; }

.table-container::-webkit-scrollbar { width: 6px; height: 6px; }
.table-container::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
.table-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.table-container th {
  position: sticky;
  top: 0;
  background: #1a1d26;
  z-index: 10;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.table-container td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.table-bordered td:not(:last-child),
.table-bordered th:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Table Transactions */
.table-transactions { width: 100%; border-collapse: collapse; }
.table-transactions thead { position: sticky; top: 0; background: #1a1c2e; z-index: 10; }

.table-transactions th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.table-transactions th.text-right { text-align: right; }
.table-transactions tbody tr { border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.2s ease; }
.table-transactions tbody tr:hover { background: rgba(255,255,255,0.05); }
.table-transactions td { padding: 0.75rem; }
.table-transactions td.text-right { text-align: right; }

/* Full height columns */
@media (min-width: 1024px) {
  .col-stretch {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .card.card-stretch {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
  }

  .card-stretch .table-container {
    flex: 1;
    max-height: none;
    min-height: 0;
    border-bottom: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
}

/* =========================================================
   5) GRIDS, CARTES COVER & MODE ZEN
   ========================================================= */

.grid { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.cover-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8)), var(--bg-card);
  padding: 1.5rem;
  border: var(--border-glass);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cover-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cover-card h3 { margin: 0; color: #fff; z-index: 2; }
.cover-card p { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); z-index: 2; margin-top: 0.5rem; }

/* Mode Zen */
.zen-editor {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.zen-tools {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.zen-tools .card { overflow: hidden; }
.zen-tools input, .zen-tools select, .zen-tools textarea { max-width: 100%; box-sizing: border-box; }

.editor-textarea {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  background: transparent;
  border: none;
  padding: 0;
  resize: vertical;
  min-height: 60vh;
  color: var(--text-main);
}

.editor-textarea:focus { background: transparent; box-shadow: none; outline: none; }
.editor-textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.header-stretch { align-items: stretch !important; }

.col-right-spaced {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

/* =========================================================
   6) UTILITAIRES
   ========================================================= */

.flex { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.text-center { text-align: center; }
.hidden { display: none; }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }

/* =========================================================
   7) RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .zen-editor { grid-template-columns: 1fr; }
  .zen-tools { position: static; }
}

/* =========================================================
   8) TABLE LIENS SIDEBAR (Cartes)
   ========================================================= */

.sidebar-links-table { width: 100%; table-layout: fixed; }
.sidebar-links-table tbody { display: flex; flex-direction: column; gap: 8px; }

.sidebar-links-table tr {
  display: flex;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px;
  position: relative;
  align-items: center;
}

.sidebar-links-table td {
  border: none !important;
  padding: 2px !important;
  display: block;
  word-wrap: break-word;
  white-space: normal;
}

.sidebar-links-table td:nth-child(1) { font-size: 0.7rem; text-transform: uppercase; opacity: 0.6; width: 100%; margin-bottom: 2px; }
.sidebar-links-table td:nth-child(2) { font-weight: 600; font-size: 0.95rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 30px; }
.sidebar-links-table td:nth-child(3), .sidebar-links-table td:nth-child(4) { width: 50%; margin-top: 6px; }
.sidebar-links-table td:nth-child(5) { position: absolute; top: 8px; right: 8px; }

.sidebar-links-table input {
  width: 100% !important;
  min-width: 0;
  font-size: 0.75rem;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================================
   9) CAROUSEL HORIZONTAL
   ========================================================= */

.horizontal-scroller {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
}

.horizontal-scroller::-webkit-scrollbar { height: 6px; }
.horizontal-scroller::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.horizontal-scroller::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.horizontal-scroller .cover-card { min-width: 280px; max-width: 280px; flex: 0 0 auto; }

/* =========================================================
   10) POWER GAUGE (Jauge de Puissance)
   ========================================================= */

/* Section conteneur de la jauge */
.credits-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0.75rem 0.75rem 0.5rem;
}

/* Badge principal de la jauge */
.power-gauge-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: default;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.power-gauge-badge:hover {
  border-color: rgba(79, 195, 247, 0.5);
  box-shadow: 0 0 15px rgba(79, 195, 247, 0.15);
}

/* En-tête de la jauge (icône + valeur) */
.power-gauge-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.power-gauge-icon {
  font-size: 1rem;
}

.power-gauge-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #4fc3f7;
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
}

/* Barre de progression */
.power-gauge-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.power-gauge-bar {
  height: 100%;
  background: linear-gradient(90deg, #4fc3f7, #81d4fa);
  border-radius: 3px;
  transition: width 0.5s ease, background 0.3s ease;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

/* Label du tier d'abonnement */
.power-gauge-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
}

/* Ancien système (compatibilité, sera supprimé) */
.token-badge {
  display: none;
}

/* Carte jauge de puissance (page univers) */
.power-gauge-card {
  padding: 1.25rem;
}

.power-gauge-header-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #fff;
}

.power-gauge-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 0.75rem;
}

.power-gauge-value-large {
  font-size: 3rem;
  font-weight: 700;
  color: #4fc3f7;
  text-shadow: 0 0 20px rgba(79, 195, 247, 0.4);
  line-height: 1;
}

.power-gauge-percent {
  font-size: 1.5rem;
  font-weight: 600;
  color: #4fc3f7;
  opacity: 0.7;
}

.power-gauge-bar-container {
  margin-bottom: 1rem;
}

.power-gauge-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.power-gauge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4fc3f7, #81d4fa);
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s ease;
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

.power-gauge-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Badges de tier d'abonnement */
.tier-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-starter {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.tier-creator {
  background: rgba(79, 195, 247, 0.2);
  color: #4fc3f7;
  border: 1px solid rgba(79, 195, 247, 0.3);
}

.tier-pro {
  background: rgba(192, 132, 252, 0.2);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

/* Bloc info utilisateur dans la sidebar */
.user-info-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0.75rem 1rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.user-info-block:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.user-info-block .user-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info-block .btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-info-block .btn-logout:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
  transform: none;
  box-shadow: none;
}

/* =========================================================
   11) MODALES GLASS
   ========================================================= */

dialog.glass-dialog {
  background: rgba(20, 23, 31, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 0;
  min-width: 400px;
  max-width: 90vw;
}

dialog.glass-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.dialog-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-header h3 { margin: 0; font-size: 1.2rem; color: #fff; }

.dialog-body { padding: 1.5rem; }

.dialog-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.summary-input {
  width: 100%;
  background: #473f3f61;
  border: none;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  padding-left: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  margin-top: 0.5rem;
  transition: all 0.2s;
}

.summary-input:focus { outline: none; background: rgba(0, 0, 0, 0.1); border-left-color: var(--accent); }
.summary-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.summary-input::placeholder { color: rgba(255, 255, 255, 0.4); font-style: italic; }

/* =========================================================
   12) DIFF VIEWER
   ========================================================= */

.diff-change {
  background-color: rgba(163, 230, 53, 0.2);
  color: #a3e635;
  font-weight: bold;
  padding: 0 2px;
  border-radius: 2px;
  text-decoration: underline;
}

.diff-viewer {
  flex: 1;
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =========================================================
   13) ACTIVITÉ RÉCENTE
   ========================================================= */

.activity-logs { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.5rem 0; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease-smooth);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(129, 140, 248, 0.2);
  transform: translateX(2px);
}

.activity-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(129, 140, 248, 0.1);
  border-radius: var(--radius-sm);
}

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-weight: 500; color: var(--text-main); font-size: 0.9rem; margin-bottom: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-summary { color: var(--text-muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.activity-link {
  flex-shrink: 0;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(129, 140, 248, 0.1);
  transition: all 0.2s var(--ease-smooth);
}

.activity-link:hover { background: rgba(129, 140, 248, 0.2); color: var(--accent); transform: translateX(2px); }

/* Éléments supprimés dans l'activité récente */
.activity-item--deleted {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.02);
}
.activity-item--deleted:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}
.activity-deleted-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* =========================================================
   14) CUSTOM CONFIRM DIALOG
   ========================================================= */

.custom-confirm-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 450px;
  width: 90%;
}

.custom-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.custom-confirm-dialog .custom-confirm-box {
  animation: dialogScaleIn 0.3s var(--ease-smooth);
}

.custom-confirm-box {
  background: #1a1c2e;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.custom-confirm-box h3 { color: var(--text-main); font-size: 1.25rem; font-weight: 600; }
.custom-confirm-box p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

@keyframes dialogScaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =========================================================
   15) SCROLLBARS PERSONNALISÉES
   ========================================================= */

#entities-detected-list::-webkit-scrollbar,
#entities-linked-list::-webkit-scrollbar { width: 8px; }

#entities-detected-list::-webkit-scrollbar-track,
#entities-linked-list::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }

#entities-detected-list::-webkit-scrollbar-thumb,
#entities-linked-list::-webkit-scrollbar-thumb { background: rgba(129, 140, 248, 0.3); border-radius: 4px; transition: background 0.2s; }

#entities-detected-list::-webkit-scrollbar-thumb:hover,
#entities-linked-list::-webkit-scrollbar-thumb:hover { background: rgba(129, 140, 248, 0.5); }

#entities-detected-list, #entities-linked-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(129, 140, 248, 0.3) rgba(0, 0, 0, 0.2);
}

/* =========================================================
   16) PAGE ACCOUNT - ONGLETS
   ========================================================= */

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.tab-nav-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  white-space: nowrap;
}

.tab-nav-button:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.02); }
.tab-nav-button.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(129, 140, 248, 0.05); }
.tab-icon { font-size: 1.25rem; }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeInTab 0.3s ease; }

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.stat-card {
  background: var(--bg-card);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s var(--ease-smooth);
}

.stat-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }
.stat-card h3 { font-size: 0.875rem; color: var(--text-muted); margin: 0 0 0.5rem 0; }
.stat-value { font-size: 2.5rem; font-weight: bold; color: var(--primary); margin: 0; }

.stat-green { border-color: rgba(34, 197, 94, 0.3); }
.stat-green .stat-value { color: var(--success); }
.stat-red { border-color: rgba(239, 68, 68, 0.3); }
.stat-red .stat-value { color: var(--danger); }
.stat-blue { border-color: rgba(59, 130, 246, 0.3); }
.stat-blue .stat-value { color: var(--info); }

.stat-item { display: flex; flex-direction: column; padding: 0.75rem; background: rgba(0, 0, 0, 0.2); border-radius: var(--radius-sm); }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.25rem; }

/* Balance Card */
.balance-card-master {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  text-align: center;
}

.balance-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: 0.875rem; opacity: 0.9; }
.balance-amount { font-size: 4rem; font-weight: bold; margin: 1rem 0; }
.balance-desc { font-size: 0.875rem; opacity: 0.8; margin: 0; }

/* Danger Card */
.danger-card { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.05); }
.danger-zone ul { color: var(--text-muted); margin: 1rem 0; }

/* =========================================================
   17) PACKS CRÉDITS
   ========================================================= */

.packs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.packs-category-header { grid-column: 1 / -1; margin-top: 1.5rem; }
.packs-category-header:first-child { margin-top: 0; }
.packs-category-header h3 { font-size: 1.25rem; color: var(--text-muted); margin: 0 0 0.5rem 0; padding-bottom: 0.5rem; border-bottom: 1px solid #334155; }

.pack-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pack-card:hover { border-color: #667eea; transform: translateY(-4px); box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2); }
.pack-card.popular { border-color: #fbbf24; background: linear-gradient(135deg, #1e293b 0%, #2d1f3f 100%); }
.pack-badge { position: absolute; top: -12px; right: 1rem; background: #fbbf24; color: #1e293b; padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; font-weight: bold; }
.pack-name { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; }
.pack-credits { font-size: 2.5rem; font-weight: bold; color: #667eea; margin: 1rem 0; }
.pack-price { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 1rem; }
.pack-desc { color: var(--text-dim); font-size: 0.875rem; margin-bottom: 1.5rem; }

.pack-button {
  width: 100%;
  padding: 0.75rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pack-button:hover { background: #5568d3; }
.pack-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== PLANS D'ABONNEMENT (Account page) ========== */
.plan-tabs { display: flex; justify-content: center; gap: 1rem; margin-bottom: 2rem; }
.plan-tab-btn { padding: 0.75rem 1.5rem; border-radius: 8px; border: 1px solid #334155; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.plan-tab-btn:hover { border-color: #667eea; color: #fff; }
.plan-tab-btn.active { background: #667eea; border-color: #667eea; color: #fff; }

.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.plans-grid.plans-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 700px; margin: 0 auto 2rem; }

.plan-card { background: #1e293b; border: 2px solid #334155; border-radius: 12px; padding: 1.5rem; position: relative; text-align: center; transition: all 0.3s; }
.plan-card:hover { border-color: #667eea; transform: translateY(-2px); }
.plan-card.popular { border-color: #fbbf24; background: linear-gradient(135deg, #1e293b 0%, #2d1f3f 100%); }

.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; }
.plan-badge.free { background: #334155; color: var(--text-muted); }
.plan-badge.popular { background: #fbbf24; color: #1e293b; }

.plan-card h3 { font-size: 1.25rem; margin: 0.5rem 0; }
.plan-price { font-size: 2rem; font-weight: bold; color: #667eea; margin: 0.5rem 0; }
.plan-price span { font-size: 0.875rem; color: var(--text-muted); font-weight: normal; }
.plan-target { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 1rem; }

.plan-features { list-style: none; padding: 0; margin: 0 0 1rem 0; text-align: left; }
.plan-features li { padding: 0.4rem 0; font-size: 0.85rem; color: #cbd5e1; border-bottom: 1px solid rgba(255,255,255,0.05); }
.plan-features li:last-child { border-bottom: none; }
.plan-features li strong { color: #fff; }

.btn-plan { width: 100%; padding: 0.6rem; background: #667eea; color: #fff; border: none; border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.btn-plan:hover:not(:disabled) { background: #5568d3; }
.btn-plan:disabled { background: #334155; color: var(--text-dim); cursor: not-allowed; }

.plan-current { display: block; padding: 0.6rem; background: rgba(74, 222, 128, 0.1); color: #4ade80; border-radius: 6px; font-size: 0.85rem; font-weight: 500; }

.section-separator { margin: 3rem 0 2rem; text-align: center; position: relative; }
.section-separator::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #334155; }
.section-separator span { position: relative; background: #0f172a; padding: 0 1rem; color: var(--text-dim); font-size: 0.9rem; }

@media (max-width: 768px) {
    .plans-grid { grid-template-columns: 1fr; }
    .plans-grid.plans-grid-2 { grid-template-columns: 1fr; }
}

/* Info & FAQ */
.info-section { background: #1e293b; padding: 2rem; border-radius: 12px; margin-bottom: 3rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.info-card { text-align: center; }
.info-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.info-card h4 { margin: 0.5rem 0; }
.info-card p { color: var(--text-muted); font-size: 0.875rem; }

.faq-section { background: #1e293b; padding: 2rem; border-radius: 12px; }
.faq-section details { background: #0f172a; border-radius: 8px; padding: 1rem; margin-bottom: 0.5rem; }
.faq-section summary { cursor: pointer; font-weight: 600; padding: 0.5rem; }
.faq-section details[open] summary { margin-bottom: 1rem; border-bottom: 1px solid #334155; padding-bottom: 1rem; }

/* =========================================================
   18) UNIVERSE CREDITS CARD
   ========================================================= */

.universe-credits-card {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.08) 0%, rgba(192, 132, 252, 0.05) 100%);
  border: 1px solid rgba(129, 140, 248, 0.2);
  padding: 1.5rem;
}

.credits-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.credits-header h3 { margin: 0; font-size: 1.125rem; color: var(--text-main); }

.credits-balance {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.balance-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }
.balance-value { font-size: 2rem; font-weight: 600; color: #10b981; font-family: 'Inter', sans-serif; }

.credits-master-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.credits-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.credits-details { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.credits-details summary { cursor: pointer; color: var(--text-muted); user-select: none; }
.credits-details summary:hover { color: var(--text-main); }

.transfer-info { background: rgba(0, 0, 0, 0.2); padding: 1rem; border-radius: var(--radius-sm); margin-top: 1rem; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.info-row:not(:last-child) { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.info-row span:first-child { color: var(--text-muted); font-size: 0.875rem; }
.info-row span:last-child { color: var(--text-main); font-weight: 600; }

/* =========================================================
   19) ALERTS & MESSAGES
   ========================================================= */

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; }
.alert-error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); color: #fca5a5; }
.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #6ee7b7; }

.message { padding: 1rem; border-radius: 8px; margin-bottom: 2rem; }
.message.success { background: rgba(34, 197, 94, 0.1); border: 1px solid var(--success); color: var(--success); }
.message.error { background: rgba(239, 68, 68, 0.1); border: 1px solid var(--danger); color: var(--danger); }

/* States */
.loading-state, .empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-main); font-size: 0.875rem; font-weight: 500; }

.section-desc { color: var(--text-muted); margin-bottom: 2rem; }

/* =========================================================
   19bis) SYSTÈME DE NOTIFICATIONS GLASS UNIFIÉ
   ========================================================= */

/* --- Container Toast --- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
}

/* --- Toast Glass --- */
.glass-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(20, 23, 31, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  font-size: 0.9rem;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s var(--ease-smooth);
}

.glass-toast.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.glass-toast.toast-exit {
  transform: translateX(120%);
  opacity: 0;
}

.glass-toast .toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.glass-toast .toast-message {
  flex: 1;
  line-height: 1.4;
}

.glass-toast .toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.glass-toast .toast-close:hover {
  opacity: 1;
  color: var(--text-main);
}

/* Toast Types */
.glass-toast-success { border-left: 4px solid var(--success); }
.glass-toast-error { border-left: 4px solid var(--danger); }
.glass-toast-warning { border-left: 4px solid var(--warning); }
.glass-toast-info { border-left: 4px solid var(--info); }

/* --- Modales Glass Unifiées --- */
.glass-confirm-dialog,
.glass-alert-dialog,
.glass-prompt-dialog {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 450px;
  width: 90%;
}

.glass-confirm-dialog::backdrop,
.glass-alert-dialog::backdrop,
.glass-prompt-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.glass-confirm-content,
.glass-alert-content,
.glass-prompt-content {
  background: rgba(20, 23, 31, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: glassDialogIn 0.3s var(--ease-smooth);
}

@keyframes glassDialogIn {
  from {
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Header */
.glass-confirm-header,
.glass-alert-header,
.glass-prompt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.glass-confirm-header h3,
.glass-alert-header h3,
.glass-prompt-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.confirm-icon,
.alert-icon,
.prompt-icon {
  font-size: 1.5rem;
}

/* Body */
.glass-confirm-body,
.glass-alert-body,
.glass-prompt-body {
  padding: 1.5rem;
}

.glass-confirm-body p,
.glass-alert-body p,
.glass-prompt-body p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Footer */
.glass-confirm-footer,
.glass-alert-footer,
.glass-prompt-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn-confirm-ok,
.btn-confirm-cancel,
.btn-alert-ok,
.btn-prompt-ok,
.btn-prompt-cancel {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  border: none;
}

.btn-confirm-ok,
.btn-alert-ok,
.btn-prompt-ok {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.btn-confirm-ok:hover,
.btn-alert-ok:hover,
.btn-prompt-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(129, 140, 248, 0.4);
}

.btn-confirm-cancel,
.btn-prompt-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-confirm-cancel:hover,
.btn-prompt-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

/* Danger Type */
.glass-confirm-danger .glass-confirm-content {
  border-color: rgba(248, 113, 113, 0.3);
}

.glass-confirm-danger .glass-confirm-header {
  background: rgba(248, 113, 113, 0.1);
}

.btn-confirm-ok.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-confirm-ok.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Warning Type */
.glass-confirm-warning .glass-confirm-content {
  border-color: rgba(245, 158, 11, 0.3);
}

.glass-confirm-warning .glass-confirm-header {
  background: rgba(245, 158, 11, 0.1);
}

/* Alert Types */
.glass-alert-success .glass-alert-header { background: rgba(34, 197, 94, 0.1); }
.glass-alert-success .glass-alert-content { border-color: rgba(34, 197, 94, 0.3); }

.glass-alert-error .glass-alert-header { background: rgba(248, 113, 113, 0.1); }
.glass-alert-error .glass-alert-content { border-color: rgba(248, 113, 113, 0.3); }

.glass-alert-warning .glass-alert-header { background: rgba(245, 158, 11, 0.1); }
.glass-alert-warning .glass-alert-content { border-color: rgba(245, 158, 11, 0.3); }

/* Prompt Input */
.prompt-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s;
}

.prompt-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.prompt-input::placeholder {
  color: var(--text-dim);
}

textarea.prompt-input {
  resize: vertical;
  min-height: 100px;
}

/* --- Modale DANGER (Suppression critique) --- */
.glass-danger-dialog {
  background: transparent;
  border: none;
  padding: 0;
  max-width: 520px;
  width: 95%;
}

.glass-danger-dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-danger-content {
  background: rgba(25, 15, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(239, 68, 68, 0.5);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(239, 68, 68, 0.25), 0 0 100px rgba(239, 68, 68, 0.1);
  overflow: hidden;
  animation: dangerDialogIn 0.35s var(--ease-smooth);
}

@keyframes dangerDialogIn {
  from {
    transform: scale(0.85) translateY(-30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.glass-danger-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.15));
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.glass-danger-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fca5a5;
}

.danger-icon {
  font-size: 1.75rem;
  animation: dangerPulse 1.5s ease-in-out infinite;
}

@keyframes dangerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.glass-danger-body {
  padding: 1.5rem;
}

.danger-main-text {
  font-size: 1rem;
  color: var(--text-main);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.danger-main-text strong {
  color: #fca5a5;
}

.danger-consequences {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.danger-subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #fca5a5;
}

.danger-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.danger-list li {
  padding: 6px 0;
  color: #f87171;
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.danger-list li:last-child {
  border-bottom: none;
}

.danger-confirm-zone {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.danger-confirm-label {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.danger-confirm-label strong {
  color: #f87171;
  font-family: monospace;
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.danger-confirm-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 1rem;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.2s;
}

.danger-confirm-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.danger-confirm-input::placeholder {
  color: rgba(248, 113, 113, 0.4);
  font-weight: 400;
  letter-spacing: 3px;
}

.danger-warning {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  padding-top: 0.5rem;
}

.danger-warning strong {
  color: #f87171;
}

.glass-danger-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.btn-danger-cancel {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  transition: all 0.2s;
}

.btn-danger-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.btn-danger-confirm {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: not-allowed;
  border: none;
  background: rgba(127, 29, 29, 0.5);
  color: rgba(252, 165, 165, 0.5);
  transition: all 0.3s;
}

.btn-danger-confirm:disabled {
  opacity: 0.6;
}

.btn-danger-confirm.btn-danger-ready,
.btn-danger-confirm:not(:disabled) {
  cursor: pointer;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.btn-danger-confirm.btn-danger-ready:hover,
.btn-danger-confirm:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.5);
}

/* =========================================================
   20) L'ORACLE DE PULMANDHAR - CHAT IA CONTEXTUEL
   ========================================================= */

/* Toggle Button (Always visible - floating) */
.oracle-toggle-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 0 4px rgba(99, 102, 241, 0.1);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.oracle-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6), 0 0 0 6px rgba(99, 102, 241, 0.15);
}

.oracle-toggle-btn.oracle-btn-active {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

.oracle-icon-btn {
    font-size: 1.75rem;
    line-height: 1;
}

/* Drawer Container */
.oracle-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100vh;
    background: rgba(15, 17, 22, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transition: right 0.35s var(--ease-smooth);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.6);
}

.oracle-drawer.oracle-open {
    right: 0;
}

/* Header */
.oracle-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.oracle-title {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.oracle-icon {
    font-size: 1.25rem;
}

.oracle-context-badge {
    flex: 1;
    text-align: right;
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(192, 132, 252, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(192, 132, 252, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.oracle-context-badge.oracle-context-episode { border-color: rgba(99, 102, 241, 0.3); background: rgba(99, 102, 241, 0.1); color: #818cf8; }
.oracle-context-badge.oracle-context-sheet { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.oracle-context-badge.oracle-context-error { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.1); color: #f87171; }

.oracle-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.oracle-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Threads Section */
.oracle-threads-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.oracle-threads-header {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: background 0.2s ease;
}

.oracle-threads-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.oracle-threads-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.oracle-threads-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.oracle-thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s ease;
    margin-bottom: 0.25rem;
}

.oracle-thread-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.oracle-thread-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-left: 2px solid var(--primary);
}

.oracle-thread-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.oracle-thread-title {
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oracle-thread-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.oracle-thread-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.oracle-thread-item:hover .oracle-thread-actions {
    opacity: 1;
}

.oracle-thread-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.oracle-thread-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.oracle-thread-action-btn.oracle-thread-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.oracle-threads-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.oracle-archive-toggle {
    padding: 0.5rem;
    text-align: center;
}

.oracle-archive-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oracle-archive-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.oracle-new-thread-btn {
    width: calc(100% - 1rem);
    margin: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oracle-new-thread-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Messages Area */
.oracle-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oracle-messages::-webkit-scrollbar {
    width: 6px;
}

.oracle-messages::-webkit-scrollbar-track {
    background: transparent;
}

.oracle-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.oracle-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Welcome Message */
.oracle-welcome {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.oracle-welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.oracle-welcome h3 {
    font-family: 'Lora', serif;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.oracle-welcome p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.oracle-welcome-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 1rem;
}

.oracle-commands-list {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.8;
}

.oracle-commands-list code {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
}

/* Message Bubbles */
.oracle-message {
    max-width: 88%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    animation: oracleMessageIn 0.3s ease-out;
}

@keyframes oracleMessageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oracle-message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.oracle-message-assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.oracle-message-assistant strong {
    color: var(--primary);
}

.oracle-message-assistant em {
    color: var(--accent);
}

.oracle-message-assistant code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.oracle-message-system {
    align-self: center;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--info);
    font-size: 0.8rem;
    text-align: center;
    border-radius: 8px;
    max-width: 100%;
}

.oracle-message-error {
    align-self: center;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
    border-radius: 8px;
    max-width: 100%;
}

.oracle-message-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Bouton TTS (Text-to-Speech) */
.oracle-tts-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.oracle-tts-btn:hover {
    opacity: 1;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.oracle-tts-btn.speaking {
    opacity: 1;
    color: var(--accent);
    animation: oracle-tts-pulse 1s ease-in-out infinite;
}

@keyframes oracle-tts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.oracle-tts-btn svg {
    display: block;
}

.oracle-system-icon,
.oracle-error-icon {
    margin-right: 0.5rem;
}

/* Liens cliquables vers les entités */
.oracle-entity-link {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    margin: 0 0.1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.oracle-entity-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Personnages - couleur chaude */
.oracle-entity-character {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.25), rgba(255, 87, 34, 0.2));
    color: #ffcc80;
    border: 1px solid rgba(255, 152, 0, 0.4);
}
.oracle-entity-character:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.4), rgba(255, 87, 34, 0.35));
    color: #ffe0b2;
}

/* Lieux - couleur froide */
.oracle-entity-place {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25), rgba(3, 169, 244, 0.2));
    color: #90caf9;
    border: 1px solid rgba(33, 150, 243, 0.4);
}
.oracle-entity-place:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.4), rgba(3, 169, 244, 0.35));
    color: #bbdefb;
}

/* Épisodes - couleur violette */
.oracle-entity-episode {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.25), rgba(103, 58, 183, 0.2));
    color: #ce93d8;
    border: 1px solid rgba(156, 39, 176, 0.4);
}
.oracle-entity-episode:hover {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.4), rgba(103, 58, 183, 0.35));
    color: #e1bee7;
}

/* Fiches génériques */
.oracle-entity-sheet {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(56, 142, 60, 0.2));
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.4);
}
.oracle-entity-sheet:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(56, 142, 60, 0.35));
    color: #c8e6c9;
}

/* Saisons - couleur cyan */
.oracle-entity-season {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.25), rgba(0, 151, 167, 0.2));
    color: #80deea;
    border: 1px solid rgba(0, 188, 212, 0.4);
}
.oracle-entity-season:hover {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.4), rgba(0, 151, 167, 0.35));
    color: #b2ebf2;
}

/* Histoires et Univers - couleur dorée */
.oracle-entity-story,
.oracle-entity-universe {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.15));
    color: #ffd54f;
    border: 1px solid rgba(255, 193, 7, 0.4);
}
.oracle-entity-story:hover,
.oracle-entity-universe:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(255, 193, 7, 0.3));
    color: #ffecb3;
}

/* Typing Indicator */
.oracle-typing {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    width: fit-content;
    align-self: flex-start;
}

.oracle-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: oracleTypingBounce 1.4s ease-in-out infinite;
}

.oracle-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.oracle-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes oracleTypingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input Area */
.oracle-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.oracle-commands-hint {
    display: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.oracle-commands-hint.visible {
    display: block;
}

.oracle-command-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s ease;
}

.oracle-command-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.oracle-command-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--primary);
}

.oracle-command-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
}

#oracle-input {
    width: 100%;
    resize: none;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s ease;
}

#oracle-input:focus {
    outline: none;
    border-color: var(--primary);
}
#oracle-input:focus-visible {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

#oracle-input::placeholder {
    color: var(--text-dim);
}

#oracle-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.oracle-send-btn {
    width: 100%;
    padding: 0.65rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.oracle-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.oracle-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.oracle-send-icon {
    font-size: 1rem;
}

/* Loading Spinner */
.oracle-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: oracleSpin 0.8s linear infinite;
}

@keyframes oracleSpin {
    to { transform: rotate(360deg); }
}

/* Footer */
.oracle-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.oracle-version-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    user-select: none;
}

/* =========================================================
   ORACLE QUICK LEVEL SELECTOR (Footer)
   ========================================================= */

.oracle-level-quick-selector {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.oracle-level-quick-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    opacity: 0.5;
}

.oracle-level-quick-btn:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
}

.oracle-level-quick-btn.active {
    opacity: 1;
    background: rgba(129, 140, 248, 0.2);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
}

.oracle-level-quick-btn[data-level="basic"].active {
    background: rgba(96, 165, 250, 0.2);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

.oracle-level-quick-btn[data-level="extended"].active {
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.oracle-level-quick-btn[data-level="full"].active {
    background: rgba(192, 132, 252, 0.2);
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.3);
}

.oracle-level-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 8px;
    align-self: center;
}

/* =========================================================
   ORACLE SETTINGS MODAL & LEVEL SELECTOR
   ========================================================= */

.oracle-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.oracle-settings-content {
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.oracle-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: var(--border-glass);
    background: rgba(0, 0, 0, 0.2);
}

.oracle-settings-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.oracle-settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.oracle-settings-close:hover {
    color: var(--text-main);
}

.oracle-settings-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.oracle-settings-section {
    margin-bottom: 1.5rem;
}

.oracle-settings-section:last-child {
    margin-bottom: 0;
}

.oracle-settings-label {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.oracle-settings-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 0 0.75rem 0;
}

/* Sélecteur de niveau Oracle */
.oracle-level-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.oracle-level-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.oracle-level-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.oracle-level-btn.active {
    background: rgba(129, 140, 248, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.2);
}

.oracle-level-btn .level-icon {
    font-size: 1.5rem;
}

.oracle-level-btn .level-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-main);
}

.oracle-level-btn .level-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.oracle-level-btn.active .level-name {
    color: var(--primary);
}

/* Détails du niveau */
.oracle-level-details {
    margin-top: 0.5rem;
}

.level-detail-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.level-detail-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.level-detail-card p {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.level-detail-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.level-detail-card li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

.level-detail-card li:before {
    margin-right: 0.5rem;
}

/* Couleurs selon niveau */
.level-detail-card.level-none {
    border-color: rgba(248, 113, 113, 0.2);
    background: rgba(248, 113, 113, 0.05);
}

.level-detail-card.level-none h4 {
    color: #f87171;
}

.level-detail-card.level-basic {
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(251, 191, 36, 0.05);
}

.level-detail-card.level-basic h4 {
    color: #fbbf24;
}

.level-detail-card.level-extended {
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(96, 165, 250, 0.05);
}

.level-detail-card.level-extended h4 {
    color: #60a5fa;
}

.level-detail-card.level-full {
    border-color: rgba(192, 132, 252, 0.2);
    background: rgba(192, 132, 252, 0.05);
}

.level-detail-card.level-full h4 {
    color: #c084fc;
}

/* Slider température */
.oracle-settings-section input[type="range"] {
    width: calc(100% - 50px);
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    appearance: none;
    cursor: pointer;
    vertical-align: middle;
}

.oracle-settings-section input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.oracle-settings-section input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.oracle-settings-section #oracle-temp-value {
    display: inline-block;
    width: 40px;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Select profondeur de contexte */
.oracle-settings-section select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.oracle-settings-section select:focus {
    outline: none;
    border-color: var(--primary);
}
.oracle-settings-section select:focus-visible {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.oracle-settings-section select option {
    background: var(--bg-card);
    color: var(--text-main);
}

/* Footer modal */
.oracle-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: var(--border-glass);
    background: rgba(0, 0, 0, 0.15);
}

/* Responsive pour le sélecteur de niveau */
@media (max-width: 500px) {
    .oracle-level-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .oracle-settings-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .oracle-drawer {
        width: 100%;
        right: -100%;
    }

    .oracle-toggle-btn {
        right: 16px;
        bottom: 16px;
        width: 50px;
        height: 50px;
    }

    .oracle-icon-btn {
        font-size: 1.5rem;
    }
}

/* Animation d'entrée du drawer */
@keyframes oracleSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =========================================================
   ORACLE FEEDBACK SYSTEM
   ========================================================= */

/* Boutons de feedback dans les messages */
.oracle-feedback-btns {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.oracle-feedback-label {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.oracle-feedback-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.oracle-feedback-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.oracle-feedback-positive:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

.oracle-feedback-negative:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
}

.oracle-feedback-done {
    color: var(--success);
    font-size: 0.75rem;
    font-style: italic;
}

/* État en attente - feedback en cours d'envoi */
.oracle-feedback-btns.feedback-pending {
    opacity: 0.5;
    pointer-events: none;
}

.oracle-feedback-btns.feedback-pending .oracle-feedback-btn {
    cursor: wait;
}

/* État soumis - empêcher tout clic */
.oracle-feedback-btns.feedback-submitted {
    pointer-events: none;
}

/* Boutons désactivés */
.oracle-feedback-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.oracle-tokens-info,
.oracle-credits-info {
    opacity: 0.7;
}

.oracle-credits-info {
    color: #fbbf24;
}

/* Modale de feedback négatif */
.oracle-feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.oracle-feedback-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.oracle-feedback-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oracle-feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.oracle-feedback-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.oracle-feedback-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.oracle-feedback-modal-close:hover {
    color: var(--text-main);
}

.oracle-feedback-modal-body {
    padding: 1.25rem;
}

.oracle-feedback-reasons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.oracle-feedback-reason {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.oracle-feedback-reason:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.oracle-feedback-reason input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.oracle-feedback-reason span {
    color: var(--text-main);
    font-size: 0.9rem;
}

.oracle-feedback-comment label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.oracle-feedback-comment textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

.oracle-feedback-comment textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.oracle-feedback-comment textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.oracle-feedback-comment textarea::placeholder {
    color: var(--text-dim);
}

.oracle-feedback-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
}

.oracle-feedback-cancel {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oracle-feedback-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.oracle-feedback-submit {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oracle-feedback-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* =========================================================
   ORACLE - Confirm Modal (Archive/Delete)
   ========================================================= */

.oracle-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.oracle-confirm-modal.visible {
    opacity: 1;
}

.oracle-confirm-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.oracle-confirm-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.oracle-confirm-modal.visible .oracle-confirm-modal-content {
    transform: translateY(0);
}

.oracle-confirm-modal-header {
    padding: 1.25rem 1.25rem 0.75rem;
}

.oracle-confirm-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
}

.oracle-confirm-modal-body {
    padding: 0 1.25rem 1.25rem;
}

.oracle-confirm-modal-body p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.oracle-confirm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
}

.oracle-confirm-cancel {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oracle-confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.oracle-confirm-ok {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oracle-confirm-ok:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.oracle-confirm-ok:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.oracle-confirm-ok.danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.oracle-confirm-ok.danger:hover {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.oracle-confirm-ok.danger:focus {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.5);
}

/* =========================================================
   CARNET DE BORD - Modal & Components
   ========================================================= */

/* Modal Container */
.carnet-dialog {
    max-width: 90vw;
    width: 1000px;
    max-height: 90vh;
    height: auto;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255,255,255,0.15);
    background: var(--bg-sidebar);
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}

.carnet-dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.carnet-dialog[open] {
    animation: carnetFadeIn 0.3s ease-out;
}

@keyframes carnetFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.carnet-container {
    display: flex;
    flex-direction: column;
    height: 85vh;
    max-height: 85vh;
}

/* Header */
.carnet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.carnet-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.carnet-icon {
    font-size: 1.5rem;
}

.carnet-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.carnet-entity-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    background: rgba(129, 140, 248, 0.2);
    color: var(--primary);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carnet-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Tabs Navigation */
.carnet-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow-x: auto;
    flex-shrink: 0;
}

.carnet-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.carnet-tab:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.carnet-tab.active {
    background: rgba(129, 140, 248, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Content Area */
.carnet-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.carnet-panel {
    display: none;
}

.carnet-panel.active {
    display: block;
    animation: panelFadeIn 0.2s ease-out;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.carnet-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.carnet-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.carnet-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.label-icon {
    font-size: 1.1rem;
}

.label-hint {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-left: auto;
}

/* Form Elements */
.carnet-input,
.carnet-select,
.carnet-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.carnet-input:focus,
.carnet-select:focus,
.carnet-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0,0,0,0.4);
}
.carnet-input:focus-visible,
.carnet-select:focus-visible,
.carnet-textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.carnet-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.6;
}

.carnet-textarea.large {
    min-height: 200px;
}

/* Tone Selector */
.tone-selector,
.weather-selector,
.time-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tone-option,
.weather-option,
.time-option {
    cursor: pointer;
}

.tone-option input,
.weather-option input,
.time-option input {
    display: none;
}

.tone-card,
.weather-card,
.time-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.tone-card:hover,
.weather-card:hover,
.time-card:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
}

.tone-option input:checked + .tone-card,
.weather-option input:checked + .weather-card,
.time-option input:checked + .time-card {
    border-color: var(--primary);
    background: rgba(129, 140, 248, 0.15);
}

.tone-emoji,
.weather-emoji,
.time-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.tone-name,
.weather-name,
.time-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Emotion Tags */
.emotion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 40px;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
}

.emotion-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(129, 140, 248, 0.2);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary);
}

.emotion-tag .remove-tag {
    cursor: pointer;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.emotion-tag .remove-tag:hover {
    opacity: 1;
}

.emotion-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.emotion-preset {
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emotion-preset:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

/* Themes Container */
.themes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 40px;
}

.theme-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(192, 132, 252, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--accent);
}

.theme-tag.secondary {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.theme-tag .remove-theme {
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.9rem;
}

.theme-tag .remove-theme:hover {
    opacity: 1;
}

.theme-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.theme-input-row .carnet-input {
    flex: 1;
}

.theme-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.suggestion-label {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.theme-suggestion {
    padding: 0.25rem 0.6rem;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-suggestion:hover {
    border-style: solid;
    border-color: var(--accent);
    color: var(--accent);
}

/* Pitch Helpers */
.pitch-helpers {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.pitch-helper {
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pitch-helper:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Structure Section */
.structure-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.structure-placeholder span {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.structure-acts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.act-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.act-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.act-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
}

/* Keypoints Grid */
.keypoints-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .keypoints-grid {
        grid-template-columns: 1fr;
    }
}

.keypoint-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.keypoint-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.keypoint-icon {
    font-size: 1.25rem;
}

.keypoint-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Character Arcs */
.character-arc-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.character-arc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.character-arc-name {
    font-weight: 600;
    color: var(--text-main);
}

.character-arc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .character-arc-grid {
        grid-template-columns: 1fr;
    }
}

/* Todos */
#carnet-todos {
    margin-bottom: 0.75rem;
}

.carnet-todo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.carnet-todo-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.carnet-todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-dim);
}

.todo-text {
    flex: 1;
    color: var(--text-main);
}

.todo-delete {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.carnet-todo-item:hover .todo-delete {
    opacity: 1;
}

.todo-delete:hover {
    color: var(--danger);
}

.todo-input-row {
    display: flex;
    gap: 0.5rem;
}

.todo-input-row .carnet-input {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .carnet-dialog {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .carnet-container {
        height: 100vh;
        max-height: 100vh;
    }

    .carnet-tabs {
        padding: 0.5rem;
    }

    .carnet-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .tone-selector,
    .weather-selector,
    .time-selector {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* =========================================================
   PAGE ACCOUNT - Jauge & Abonnements
   ========================================================= */

/* Carte Jauge Account */
.power-gauge-card-account {
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.power-gauge-card-account .gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.power-gauge-card-account .gauge-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.power-gauge-card-account .gauge-icon {
    font-size: 1.3rem;
}

.power-gauge-card-account .gauge-display {
    margin-bottom: 0.75rem;
}

.power-gauge-card-account .gauge-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.power-gauge-card-account .gauge-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    min-width: 80px;
    text-align: right;
}

.power-gauge-card-account .gauge-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Subscription Status Card */
.subscription-status-card {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(192, 132, 252, 0.05));
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.subscription-header h3 {
    margin: 0;
    color: #fff;
}

.status-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.status-free {
    background: rgba(100, 116, 139, 0.3);
    color: var(--text-muted);
}

.status-badge.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.subscription-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.subscription-plan-info .plan-name-display {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.subscription-plan-info .plan-name-display > span:first-child {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

.plan-price-display {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
}

.plan-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.subscription-gauge-mini {
    text-align: right;
}

.subscription-gauge-mini .gauge-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.subscription-gauge-mini .power-gauge-track.mini {
    height: 8px;
    margin-bottom: 0.5rem;
}

.subscription-gauge-mini .gauge-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.subscription-renewal {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Plans Grid - 3 columns */
.plans-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Plans Grid - 4 columns */
.plans-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Info Grid - 4 columns */
.info-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Oracle level cards */
.info-card.oracle-none { border-left: 3px solid #f87171; }
.info-card.oracle-restreint { border-left: 3px solid #fbbf24; }
.info-card.oracle-basique { border-left: 3px solid #60a5fa; }
.info-card.oracle-etendu { border-left: 3px solid #c084fc; }

.info-intro {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Plan badge Pro */
.plan-badge.pro {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

/* Usage Period Card */
.usage-period-card {
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.usage-period-card .period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.usage-period-card .period-header h3 {
    margin: 0;
}

.period-dates {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* Stats cards colors */
.stat-card.stat-purple {
    border-left: 3px solid #a855f7;
}

.stat-card.stat-purple .stat-value {
    color: #a855f7;
}

/* Info Section compact */
.info-section.compact {
    margin-top: 2rem;
    padding: 1.25rem;
}

.info-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Usage history badges */
.badge-light {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-standard {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-premium {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .subscription-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .subscription-gauge-mini {
        text-align: left;
    }

    .plans-grid-3 {
        grid-template-columns: 1fr;
    }

    .plans-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-grid-2 {
        grid-template-columns: 1fr;
    }

    .info-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .plans-grid-4 {
        grid-template-columns: 1fr;
    }

    .info-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   TABLEAU PRÉSENCES & CO-PRÉSENCES (sheet.php)
   ========================================================= */

.appearances-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.appearances-table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* En-têtes colorés par type d'entité */
.appearances-table .col-characters { color: #60a5fa; }
.appearances-table .col-places { color: #34d399; }
.appearances-table .col-artifacts { color: #c084fc; }
.appearances-table .col-creatures { color: #f97316; }

/* Cellules avec bordure gauche colorée */
.appearances-table td.cell-characters,
.appearances-table td.cell-places,
.appearances-table td.cell-artifacts,
.appearances-table td.cell-creatures {
    border-left: 3px solid transparent;
    padding: 0.75rem 0.5rem;
    vertical-align: top;
}

.appearances-table td.cell-characters { border-left-color: rgba(96, 165, 250, 0.4); }
.appearances-table td.cell-places { border-left-color: rgba(52, 211, 153, 0.4); }
.appearances-table td.cell-artifacts { border-left-color: rgba(192, 132, 252, 0.4); }
.appearances-table td.cell-creatures { border-left-color: rgba(249, 115, 22, 0.4); }

/* Liste d'entités avec espacement */
.entity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 1.5rem;
}

/* Pills stylisées par type */
.entity-list a.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.entity-list-characters a.pill {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.25);
}
.entity-list-characters a.pill:hover {
    background: rgba(96, 165, 250, 0.25);
    transform: translateY(-1px);
}

.entity-list-places a.pill {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.25);
}
.entity-list-places a.pill:hover {
    background: rgba(52, 211, 153, 0.25);
    transform: translateY(-1px);
}

.entity-list-artifacts a.pill {
    background: rgba(192, 132, 252, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(192, 132, 252, 0.25);
}
.entity-list-artifacts a.pill:hover {
    background: rgba(192, 132, 252, 0.25);
    transform: translateY(-1px);
}

.entity-list-creatures a.pill {
    background: rgba(249, 115, 22, 0.15);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.25);
}
.entity-list-creatures a.pill:hover {
    background: rgba(249, 115, 22, 0.25);
    transform: translateY(-1px);
}

/* Pill de l'entité courante (grisée) */
.entity-list a.pill.current {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
    border-color: rgba(100, 116, 139, 0.3);
    cursor: default;
    opacity: 0.7;
}
.entity-list a.pill.current:hover {
    transform: none;
}

/* Responsive */
@media (max-width: 900px) {
    .appearances-table thead th {
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
    }
    .entity-list {
        gap: 0.25rem;
    }
    .entity-list a.pill {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}


/* =========================================
   FIX: Checkbox CGU/CGV (Centrage & Couleurs)
========================================= */

/* 1. Le conteneur Flex : CENTRAGE VERTICAL */
.form-group.checkbox-group {
    display: flex;
    align-items: center; /* <--- C'est ici ! La case sera centrée par rapport au texte */
    gap: 15px; /* Un peu plus d'espace pour aérer */
    margin-top: 25px;
    margin-bottom: 25px;
    padding-left: 5px;
}

/* 2. La Checkbox (Le Carré) */
.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px; /* Un tout petit peu plus grand */
    height: 24px;
    border: 2px solid var(--border-subtle, rgba(255,255,255,0.3));
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    flex-shrink: 0; /* Empêche la case de s'écraser */
    position: relative;
    transition: all 0.3s ease;
}

/* Checkbox au survol */
.checkbox-group input[type="checkbox"]:hover {
    border-color: #60a5fa; /* Bleu clair au survol */
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.2);
}

/* Checkbox COCHÉE */
.checkbox-group input[type="checkbox"]:checked {
    background-color: #60a5fa; /* Fond Bleu */
    border-color: #60a5fa;
}

/* La coche (✔️) */
.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 16px;
    font-weight: 800;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 3. Le Texte du label */
.checkbox-group label {
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

/* 4. Les Liens (CGU / CGV) en BLEU LUMINEUX */
.checkbox-group label a {
    color: #60a5fa !important; /* Force le bleu clair (Tailwind Blue-400) */
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted rgba(96, 165, 250, 0.5); /* Soulignement discret */
    transition: all 0.2s;
}

/* Liens au survol */
.checkbox-group label a:hover {
    color: #ffffff !important; /* Blanc pur au survol */
    border-bottom-color: #ffffff;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.6); /* Petit effet néon */
}

/* Fix pour les miniatures de lecture */
.reading-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Coupe l'image proprement sans la déformer */
    border-radius: 6px; /* Suit l'arrondi du conteneur */
}

/* =========================================================
   NAVIGATION MOBILE (V2.26)
   Bouton hamburger, overlay et animations
   ========================================================= */

/* Bouton Hamburger - Cache sur desktop */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: var(--bg-card, rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--bg-elevated, rgba(51, 65, 85, 0.95));
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Lignes du hamburger */
.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent-primary, #8b5cf6);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mode Lecteur : couleur verte */
.sidebar-toggle-reader .hamburger-line {
    background: var(--accent-reader, #10b981);
}

/* Animation hamburger -> X quand ouvert */
.sidebar-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.sidebar-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Overlay sombre derriere la sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 49;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    opacity: 1;
}

/* Mobile : Afficher le bouton et configurer la sidebar */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }

    .sidebar-overlay.visible {
        pointer-events: auto;
    }

    /* Sidebar mobile - Cache par defaut, glisse depuis la gauche */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height pour iOS */
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Sidebar ouverte */
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4);
    }

    /* Main content - Pleine largeur sur mobile */
    .main-content {
        margin-left: 0 !important;
        padding: 70px 1rem 1rem 1rem; /* Espace pour le bouton hamburger */
        width: 100%;
    }

    /* Ajuster l'Oracle drawer sur mobile quand sidebar ouverte */
    .sidebar.open ~ .main-content .oracle-toggle-btn {
        opacity: 0.3;
        pointer-events: none;
    }
}

/* Safe area pour les telephones avec notch */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        .sidebar-toggle {
            top: calc(16px + env(safe-area-inset-top));
            left: calc(16px + env(safe-area-inset-left));
        }

        .sidebar {
            padding-top: env(safe-area-inset-top);
        }

        .main-content {
            padding-top: calc(70px + env(safe-area-inset-top));
        }
    }
}

/* ============================================
   OFFRE FOUNDER — Styles unifiés
   ============================================ */

/* Animation shine commune */
@keyframes founderShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Carte Founder (compte + landing) */
.founder-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.08));
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
}

.founder-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.05), transparent);
  animation: founderShine 4s infinite;
  pointer-events: none;
}

/* Variante compacte pour la landing page */
.founder-card--compact {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 1.25rem 1.5rem;
}

/* Effet shine (variante explicite) */
.founder-shine {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.05), transparent);
  animation: founderShine 4s infinite;
  pointer-events: none;
}

/* Header (page compte) */
.founder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Badge Founder (utilisé partout) */
.founder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f59e0b;
}

.founder-limit {
  font-size: 0.85rem;
  color: #fbbf24;
}

/* Body */
.founder-body {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.founder-subtitle {
  color: var(--text-main);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.founder-info {
  text-align: center;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 1.25rem;
}

/* Tiers en grille (page compte) */
.founder-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Tiers en ligne (landing) */
.founder-tiers-inline {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.founder-tier {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.founder-tier-gold {
  border-color: rgba(245, 158, 11, 0.5);
}

.founder-tier-silver {
  border-color: rgba(148, 163, 184, 0.4);
}

.founder-tier-badge {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.founder-tier-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.founder-tier-desc {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Labels tiers en ligne */
.founder-tier-label {
  font-weight: 600;
}

.founder-tier-label--gold {
  color: #fbbf24;
}

.founder-tier-label--silver {
  color: #cbd5e1;
}

/* Prix */
.founder-price-old {
  text-decoration: line-through;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0.25rem;
}

.founder-price-new {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f59e0b;
}

.founder-price-new--gold {
  font-size: 1.2rem;
  color: #f59e0b;
}

.founder-price-new--silver {
  font-size: 1.2rem;
  color: #fbbf24;
}

.founder-tier-silver .founder-price-new {
  color: #fbbf24;
}

/* Bouton Founder */
.founder-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.founder-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
}

/* Variante inline pour landing */
.founder-btn--inline {
  display: inline-block;
  width: auto;
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 8px;
}

@media (max-width: 480px) {
  .founder-tiers {
    grid-template-columns: 1fr;
  }
}