/* ==============================================================================
   TSP12 DRIVE • DESIGN SYSTEM OFFICIEL RAFT & ARCHITECTURE SAAS
   Identité visuelle Tutorat Santé Paris 12 (Héritage Raft / Santé UPEC)
   Conformité WCAG 2.1 AA • Cibles tactiles >= 44x44px • Zéro Overflow-X
   ============================================================================== */

:root {
  /* Palette officielle TSP12 Raft (Mode Clair) */
  --tsp-bg: #fff5e0;               /* Fond crème institutionnel chaleureux */
  --tsp-surface: #ffffff;          /* Cartes, modales, volets */
  --tsp-surface-hover: #fbf3e4;    /* Survol éléments */
  --tsp-navy: #141e46;             /* Bleu nuit UPEC (navigation, contrastes forts) */
  --tsp-emerald: #41b06e;          /* Vert émeraude Santé (accent primaire) */
  --tsp-emerald-hover: #36965d;
  --tsp-mint: #8decb4;             /* Vert menthe clair (surbrillance, pills) */
  --tsp-text-main: #292e29;        /* Anthracite profond (jamais de noir #000) */
  --tsp-text-muted: #5e665e;       /* Secondaire accessible WCAG AA */
  --tsp-border: rgba(20, 30, 70, 0.08); /* Bordures subtiles teintées */
  --tsp-shadow-sm: 0 1px 3px rgba(20, 30, 70, 0.05);
  --tsp-shadow-md: 0 4px 12px rgba(20, 30, 70, 0.08);

  /* Liaison sémantique Drive -> Design System TSP12 */
  --gdrive-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gdrive-bg: var(--tsp-bg);
  --gdrive-surface: var(--tsp-surface);
  --gdrive-border: var(--tsp-border);
  --gdrive-border-subtle: rgba(20, 30, 70, 0.05);
  --gdrive-text: var(--tsp-text-main);
  --gdrive-text-secondary: var(--tsp-text-muted);
  --gdrive-accent: var(--tsp-emerald);
  --gdrive-accent-light: rgba(141, 236, 180, 0.32);
  --gdrive-accent-hover: var(--tsp-emerald-hover);
  --gdrive-focus-ring: rgba(65, 176, 110, 0.38);

  /* Bouton Nouveau style Workspace x TSP12 */
  --gdrive-btn-new-bg: var(--tsp-surface);
  --gdrive-btn-new-shadow: 0 2px 6px rgba(20, 30, 70, 0.08), 0 4px 12px rgba(20, 30, 70, 0.05);
  --gdrive-btn-new-hover-shadow: 0 6px 16px rgba(20, 30, 70, 0.12), 0 8px 24px rgba(65, 176, 110, 0.14);

  /* Cartes dossiers & fichiers */
  --gdrive-card-bg: var(--tsp-surface);
  --gdrive-card-border: rgba(20, 30, 70, 0.09);
  --gdrive-card-hover: var(--tsp-surface-hover);
  --gdrive-card-hover-border: rgba(65, 176, 110, 0.45);
  --gdrive-card-shadow: var(--tsp-shadow-sm);

  /* Dimensions structurantes */
  --gdrive-header-height: 64px;
  --gdrive-bottom-nav-height: 64px;
}

[data-theme="dark"],
html.dark,
.dark {
  /* Palette officielle TSP12 Raft (Mode Sombre synchronisé OS) */
  --tsp-bg: #090d16;               /* Nuit profonde */
  --tsp-surface: #131c2e;          /* Cartes sombres teintées bleu nuit */
  --tsp-surface-hover: #1b273f;
  --tsp-navy: #8decb4;             /* En sombre, inversion de focus */
  --tsp-emerald: #41b06e;          /* Toujours vert Santé */
  --tsp-emerald-hover: #4ec97e;
  --tsp-mint: rgba(141, 236, 180, 0.15);
  --tsp-text-main: #f8fafc;
  --tsp-text-muted: #94a3b8;
  --tsp-border: rgba(255, 255, 255, 0.08);
  --tsp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --tsp-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);

  /* Liaison sémantique Drive Dark */
  --gdrive-bg: var(--tsp-bg);
  --gdrive-surface: var(--tsp-surface);
  --gdrive-border: var(--tsp-border);
  --gdrive-border-subtle: rgba(255, 255, 255, 0.05);
  --gdrive-text: var(--tsp-text-main);
  --gdrive-text-secondary: var(--tsp-text-muted);
  --gdrive-accent: var(--tsp-emerald);
  --gdrive-accent-light: var(--tsp-mint);
  --gdrive-accent-hover: var(--tsp-emerald-hover);

  --gdrive-btn-new-bg: #182338;
  --gdrive-btn-new-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --gdrive-btn-new-hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);

  --gdrive-card-bg: var(--tsp-surface);
  --gdrive-card-border: rgba(255, 255, 255, 0.09);
  --gdrive-card-hover: var(--tsp-surface-hover);
  --gdrive-card-hover-border: rgba(141, 236, 180, 0.35);
  --gdrive-card-shadow: var(--tsp-shadow-sm);
}

/* ==============================================================================
   AXE 1 : ÉRADICATION DU SCROLL HORIZONTAL PARASITE (OVERFLOW-X) & FLEX MIN-W-0
   ============================================================================== */

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

html,
body,
body.gdrive-container,
.drive-container,
.gdrive-container,
.main-content {
  max-width: 100vw;
  overflow-x: hidden;
  overflow-x: clip;
}

body.gdrive-container {
  font-family: var(--gdrive-font);
  color: var(--tsp-text-main);
  background-color: var(--tsp-bg) !important;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sécurité systématique sur les enfants Flex & Grid pour empêcher les débordements */
.gdrive-header > *,
.gdrive-layout > *,
.gdrive-main > *,
.gdrive-toolbar > *,
.gdrive-folder-grid > *,
.gdrive-file-grid > *,
.gdrive-folder-card > *,
.gdrive-file-card > *,
.gdrive-file-info > * {
  min-width: 0;
}

/* Cassure propre des mots longs, titres, badges et chaînes d'URL */
h1, h2, h3, h4,
.gdrive-group-desc,
#gdriveGroupDescription,
.badge,
.break-words {
  word-break: break-word;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  line-height: 1.2;
}

/* Focus visible universel (WCAG 2.1 AA) */
:focus-visible {
  outline: 2px solid var(--tsp-emerald) !important;
  outline-offset: 2px !important;
}

/* Cibles tactiles ergonomiques minimum 44x44px */
.touch-target,
.gdrive-btn-icon,
.gdrive-nav-item,
.gdrive-mobile-nav-btn,
button,
a[role="button"] {
  min-height: 44px;
  touch-action: manipulation;
}

.gdrive-btn-icon,
button[aria-label]:not(.gdrive-nav-item):not(.gdrive-btn-new) {
  min-width: 44px;
  min-height: 44px;
}

/* ==============================================================================
   EN-TÊTE GOOGLE DRIVE (NAVIGATION HAUTE)
   ============================================================================== */
.gdrive-header {
  background-color: var(--tsp-surface);
  border-bottom: 1px solid var(--tsp-border);
  min-height: var(--gdrive-header-height);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: 100vw;
  box-shadow: var(--tsp-shadow-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 768px) {
  .gdrive-header {
    padding: 0 24px;
    gap: 20px;
  }
}

/* Barre de recherche centrale */
.gdrive-search-bar {
  background-color: var(--tsp-bg);
  border: 1.5px solid var(--tsp-border);
  border-radius: 9999px;
  min-height: 44px;
  width: 100%;
  max-width: 620px;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .gdrive-search-bar,
html.dark .gdrive-search-bar {
  background-color: #0e1525;
  border-color: rgba(255, 255, 255, 0.1);
}

.gdrive-search-bar:focus-within {
  background-color: var(--tsp-surface);
  border-color: var(--tsp-emerald);
  box-shadow: 0 2px 12px rgba(65, 176, 110, 0.18);
}

.gdrive-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.4;
  width: 100%;
  min-width: 0;
  color: var(--tsp-text-main);
  text-overflow: ellipsis;
}

.gdrive-search-input::placeholder {
  color: var(--tsp-text-muted);
}

/* ==============================================================================
   LAYOUT PRINCIPAL 2 COLONNES (DESKTOP) ET TIROIR OFF-CANVAS (MOBILE)
   ============================================================================== */
.gdrive-layout {
  display: flex;
  flex: 1;
  position: relative;
  min-height: calc(100vh - var(--gdrive-header-height));
  min-height: calc(100dvh - var(--gdrive-header-height));
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

@media (min-width: 1024px) {
  .gdrive-layout {
    height: calc(100vh - var(--gdrive-header-height));
    height: calc(100dvh - var(--gdrive-header-height));
    overflow: hidden;
  }
}

/* Volet latéral (Sidebar) */
.gdrive-sidebar {
  background-color: var(--tsp-surface);
  border-right: 1px solid var(--tsp-border);
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Desktop layout (>= 1024px) */
@media (min-width: 1024px) {
  .gdrive-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    position: relative;
    transform: none !important;
    z-index: 10;
  }
}

/* Mobile & Tablette off-canvas drawer (< 1024px) */
@media (max-width: 1023px) {
  .gdrive-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 310px;
    max-width: 85vw;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: 0 10px 40px rgba(20, 30, 70, 0.25);
  }

  .gdrive-sidebar.open {
    transform: translateX(0);
  }
}

/* Voile d'arrière-plan du volet mobile */
.gdrive-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 30, 70, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gdrive-sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Bouton Nouveau style Google x TSP12 */
.gdrive-btn-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 24px;
  min-height: 50px;
  background: var(--gdrive-btn-new-bg);
  border: 1.5px solid var(--tsp-border);
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 800;
  color: var(--tsp-navy);
  box-shadow: var(--gdrive-btn-new-shadow);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 20px;
  width: fit-content;
}

[data-theme="dark"] .gdrive-btn-new,
html.dark .gdrive-btn-new {
  color: var(--tsp-text-main);
}

.gdrive-btn-new:hover {
  box-shadow: var(--gdrive-btn-new-hover-shadow);
  background-color: var(--tsp-surface-hover);
  border-color: var(--tsp-emerald);
  transform: translateY(-1px);
}

/* Éléments de navigation latérale */
.gdrive-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--tsp-text-muted);
  background-color: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  margin-bottom: 4px;
}

.gdrive-nav-item:hover {
  background-color: var(--tsp-surface-hover);
  color: var(--tsp-text-main);
}

.gdrive-nav-item.active {
  background-color: var(--gdrive-accent-light) !important;
  color: var(--tsp-navy) !important;
  border-color: rgba(65, 176, 110, 0.3);
  font-weight: 800;
}

[data-theme="dark"] .gdrive-nav-item.active,
html.dark .gdrive-nav-item.active {
  color: #8decb4 !important;
  border-color: rgba(141, 236, 180, 0.25);
}

/* Carte Jauge Quota Serveur */
.gdrive-quota-card {
  padding: 14px;
  border-radius: 16px;
  background-color: var(--tsp-bg);
  border: 1px solid var(--tsp-border);
}

[data-theme="dark"] .gdrive-quota-card,
html.dark .gdrive-quota-card {
  background-color: #0e1525;
}

.gdrive-quota-bar {
  height: 7px;
  width: 100%;
  border-radius: 9999px;
  background-color: rgba(20, 30, 70, 0.1);
  overflow: hidden;
  margin-top: 8px;
}

[data-theme="dark"] .gdrive-quota-bar,
html.dark .gdrive-quota-bar {
  background-color: rgba(255, 255, 255, 0.12);
}

.gdrive-quota-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--tsp-emerald), #10b981);
  transition: width 0.35s ease;
}

/* ==============================================================================
   ZONE PRINCIPALE D'EXPLORATION (DESKTOP DENSE & MOBILE FLUIDE)
   ============================================================================== */
.gdrive-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px calc(92px + env(safe-area-inset-bottom, 0px)) 14px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  .gdrive-main {
    padding: 24px 32px 36px 32px;
  }
}

/* Barre d'outils secondaire */
.gdrive-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--tsp-border);
  flex-wrap: wrap;
  min-width: 0;
}

@media (min-width: 640px) {
  .gdrive-toolbar {
    align-items: center;
    gap: 16px;
  }
}

/* Fil d'Ariane (Mobile First < 640px avec clamp() anti-chevauchement) */
.gdrive-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(1rem, 3.8vw, 1.25rem);
  line-height: 1.25;
  font-weight: 800;
  color: var(--tsp-navy);
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

[data-theme="dark"] .gdrive-breadcrumb,
html.dark .gdrive-breadcrumb {
  color: var(--tsp-text-main);
}

.gdrive-breadcrumb a,
.gdrive-breadcrumb button {
  color: var(--tsp-text-muted);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 8px;
  min-height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gdrive-breadcrumb a:hover,
.gdrive-breadcrumb button:hover {
  color: var(--tsp-emerald);
  background-color: var(--tsp-surface-hover);
}

/* ==============================================================================
   GRILLES DOSSIERS & FICHIERS (DENSITÉ ÉLEVÉE DESKTOP & ERGONOMIE MOBILE)
   ============================================================================== */
.gdrive-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .gdrive-folder-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.gdrive-folder-card {
  background-color: var(--gdrive-card-bg);
  border: 1px solid var(--gdrive-card-border);
  border-radius: 16px;
  padding: 10px 12px;
  min-height: 60px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--gdrive-card-shadow);
  position: relative;
}

.gdrive-folder-card:hover {
  background-color: var(--gdrive-card-hover);
  border-color: var(--gdrive-card-hover-border);
  box-shadow: var(--tsp-shadow-md);
  transform: translateY(-1px);
}

.gdrive-folder-name {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--tsp-text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Champ de renommage inline direct du dossier */
.gdrive-folder-rename-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  z-index: 10;
}

.gdrive-folder-rename-input {
  font-size: 14px;
  font-weight: 700;
  color: var(--tsp-text-main);
  background-color: var(--tsp-surface);
  border: 2px solid var(--tsp-emerald);
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 40px;
  width: 100%;
  min-width: 0;
  outline: none;
  box-shadow: 0 0 0 3px var(--gdrive-focus-ring);
}

/* Grille de Fichiers */
.gdrive-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .gdrive-file-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.gdrive-file-card {
  background-color: var(--tsp-surface);
  border: 1px solid var(--gdrive-card-border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--gdrive-card-shadow);
}

.gdrive-file-card:hover {
  border-color: var(--tsp-emerald);
  box-shadow: var(--tsp-shadow-md);
  transform: translateY(-2px);
}

.gdrive-file-preview {
  min-height: 108px;
  padding: 16px;
  background-color: var(--tsp-surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--tsp-border);
  position: relative;
}

[data-theme="dark"] .gdrive-file-preview,
html.dark .gdrive-file-preview {
  background-color: #182338;
}

.gdrive-file-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.gdrive-file-title {
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--tsp-text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.gdrive-file-meta {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--tsp-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

/* Vue Liste Google Drive */
.gdrive-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.gdrive-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tsp-text-muted);
  background-color: var(--tsp-surface-hover);
  padding: 12px 16px;
  border-bottom: 1px solid var(--tsp-border);
  white-space: nowrap;
}

.gdrive-table td {
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.45;
  border-bottom: 1px solid var(--tsp-border);
  color: var(--tsp-text-main);
  vertical-align: middle;
}

.gdrive-table tr:hover td {
  background-color: var(--tsp-surface-hover);
}

/* ==============================================================================
   MODALES SUR GRAND ÉCRAN VS BOTTOM-SHEETS SUR MOBILE (SAFE AREA INSET)
   ============================================================================== */
.gdrive-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background-color: rgba(20, 30, 70, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 0.25s ease;
}

.gdrive-modal-wrapper.hidden {
  display: none !important;
  opacity: 0;
}

.gdrive-modal-box {
  background-color: var(--tsp-surface);
  color: var(--tsp-text-main);
  border: 1px solid var(--tsp-border);
  box-shadow: 0 20px 44px rgba(20, 30, 70, 0.25);
  width: 100%;
  min-width: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 769px) {
  .gdrive-modal-box {
    border-radius: 28px;
    max-width: 480px;
    padding: 24px;
    transform: scale(1);
  }

  .gdrive-modal-box.modal-wide {
    max-width: 580px;
  }
}

@media (max-width: 768px) {
  .gdrive-modal-wrapper {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .gdrive-modal-box {
    border-radius: 28px 28px 0 0 !important;
    border-bottom: none !important;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 0px)) 18px !important;
    transform: translateY(0);
    animation: slideUpBottomSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .bottom-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 9999px;
    background-color: rgba(20, 30, 70, 0.2);
    margin: 4px auto 14px auto;
    cursor: grab;
  }

  [data-theme="dark"] .bottom-sheet-handle,
  html.dark .bottom-sheet-handle {
    background-color: rgba(255, 255, 255, 0.22);
  }

  /* Éviter le zoom auto indésirable sur iOS Safari */
  input, select, textarea {
    font-size: 16px !important;
  }
}

@keyframes slideUpBottomSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ==============================================================================
   HUB PERSONNEL (PROFIL & SÉCURITÉ)
   ============================================================================== */
.hub-profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--tsp-navy) 0%, var(--tsp-emerald) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(65, 176, 110, 0.25);
  flex-shrink: 0;
}

.strength-meter-bar {
  height: 6px;
  border-radius: 9999px;
  background-color: rgba(20, 30, 70, 0.1);
  overflow: hidden;
  margin-top: 6px;
}

[data-theme="dark"] .strength-meter-bar,
html.dark .strength-meter-bar {
  background-color: rgba(255, 255, 255, 0.12);
}

.strength-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* ==============================================================================
   BARRE DE NAVIGATION BASSE SUR MOBILE (SAFE AREA INSET BOTTOM)
   ============================================================================== */
.gdrive-mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: calc(var(--gdrive-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)) 8px;
  background-color: var(--tsp-surface);
  border-top: 1px solid var(--tsp-border);
  box-shadow: 0 -4px 16px rgba(20, 30, 70, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 35;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 1024px) {
  .gdrive-mobile-bottom-nav {
    display: none !important;
  }
}

.gdrive-mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--tsp-text-muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  background: transparent;
  border: none;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.gdrive-mobile-nav-btn.active,
.gdrive-mobile-nav-btn:hover {
  color: var(--tsp-emerald);
  background-color: var(--tsp-surface-hover);
}

/* ==============================================================================
   VISIONNEUSE PDF PLEIN ÉCRAN
   ============================================================================== */
.gdrive-pdf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-x: clip;
}

.gdrive-pdf-header {
  background-color: #141e46;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 56px;
}

.gdrive-pdf-viewer {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #525659;
}
