/* Postiz mobile overlay v16 — Wash&Go
   Calendrier scroll + création post mobile | Agent input | docks
*/
html {
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden !important;
  }

  .min-h-screen.min-w-screen {
    padding: 8px !important;
    padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .flex-1.flex.gap-\[8px\] {
    flex-direction: column !important;
    gap: 6px !important;
  }

  .blurMe {
    filter: none !important;
  }

  /* ========== BOTTOM NAV — dock flottant arrondi ========== */
  .flex.flex-col.bg-newBgColorInner.w-\[80px\],
  .flex.flex-col.bg-newBgColorInner.w-\[64px\] {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: calc(100% - 24px) !important;
    max-width: 420px !important;
    height: auto !important;
    z-index: 60 !important;
    flex-direction: row !important;
    border-radius: 22px !important;
    padding: 4px 6px !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    justify-content: center !important;
    align-items: center !important;
    background: rgba(28, 27, 27, 0.92) !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .fixed.h-full.w-\[64px\],
  .fixed.h-full.w-\[80px\] {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    padding-top: 0 !important;
  }

  .flex.flex-col.h-full.gap-\[32px\] {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    height: auto !important;
  }

  #left-menu > div > svg,
  #left-menu svg.min-w-\[60px\],
  #left-menu svg[width="60"] {
    display: none !important;
  }

  /* Single centered nav row (main + settings merged by JS) */
  .flex.flex-1.flex-col.minCustom\:gap-\[16px\] {
    flex-direction: row !important;
    flex: 1 1 auto !important;
    gap: 0 !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Empty settings column after move */
  .flex.flex-col.minCustom\:gap-\[20px\].wg-nav-slot-empty,
  .wg-nav-slot-empty {
    display: none !important;
  }

  .flex.flex-col.minCustom\:gap-\[20px\]:not(.wg-nav-slot-empty) {
    display: none !important;
  }

  /* Hide Médias / Plugs / Intégrations from bar */
  a.wg-nav-hide {
    display: none !important;
  }

  a.group.w-full.minCustom\:h-\[54px\] {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 4px 2px !important;
    gap: 2px !important;
    justify-content: center !important;
    align-items: center !important;
  }

  a.group.w-full.minCustom\:h-\[54px\] svg,
  a.group.w-full.minCustom\:h-\[54px\] img {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
  }

  a.group.w-full.minCustom\:h-\[54px\] span {
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    text-align: center !important;
  }

  /* Center + FAB */
  .wg-fab {
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    margin: 0 2px !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #612bd3 !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 16px rgba(97, 43, 211, 0.45);
    cursor: pointer;
    z-index: 2;
  }
  .wg-fab svg {
    width: 24px !important;
    height: 24px !important;
  }

  /* ========== SHARED CONTENT SHELL ========== */
  .flex-1.bg-newBgLineColor.rounded-\[12px\].overflow-hidden.flex.flex-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  .flex.flex-1.gap-\[1px\] {
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* ========== TOP BAR — fixe, flottante ========== */
  .flex.bg-newBgColorInner.h-\[80px\] {
    position: fixed !important;
    top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 16px) !important;
    max-width: 720px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 10px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    overflow: hidden !important;
    z-index: 55 !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    background: rgba(28, 27, 27, 0.94) !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .wg-home-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #2a2a2a !important;
    color: #fff !important;
    cursor: pointer !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
  }
  .wg-home-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .text-\[24px\].font-\[600\] {
    font-size: 15px !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .flex.gap-\[20px\].text-textItemBlur {
    gap: 10px !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  .flex.gap-\[20px\].text-textItemBlur > .w-\[1px\] {
    display: none !important;
  }

  .flex.gap-\[20px\].text-textItemBlur svg {
    width: 20px !important;
    height: 20px !important;
  }

  .flex.gap-\[20px\].text-textItemBlur .rounded-full.h-\[22px\].w-\[22px\] {
    width: 20px !important;
    height: 20px !important;
  }

  /* Channel / side strips */
  .sidebar.w-\[100px\],
  .trz.sidebar,
  .trz.group.sidebar,
  .bg-newBgColorInner.p-\[20px\].flex.flex-col.gap-\[15px\].sidebar,
  .bg-newBgColorInner.p-\[20px\].flex.flex-1.flex-col.gap-\[15px\].sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 56px !important;
    height: auto !important;
    max-height: 72px !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    position: relative !important;
  }

  .trz.sidebar > .absolute,
  .sidebar > .absolute {
    position: static !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: max-content !important;
  }

  .trz.sidebar h2,
  .sidebar h2 {
    display: none !important;
  }

  .trz.sidebar .flex.flex-col.gap-\[15px\],
  .sidebar .flex.gap-\[12px\].flex-col,
  .sidebar .flex.flex-col.gap-\[12px\],
  .trz.sidebar .flex.flex-col.gap-\[15px\] {
    flex-direction: row !important;
    gap: 10px !important;
    width: max-content !important;
  }

  /* ========== CALENDAR CHANNELS ========== */
  html[data-page="launches"] .wg-sidebar-hidden,
  html[data-page="analytics"] .wg-sidebar-hidden {
    display: none !important;
  }

  html[data-page="launches"] .wg-canaux-btn,
  html[data-page="analytics"] .wg-canaux-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: #612bd3;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Calendar toolbar: une ligne sous le header */
  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row > .flex.flex-grow {
    flex: 0 0 auto !important;
    gap: 6px !important;
  }

  html[data-page="launches"] .border.h-\[42px\] {
    height: 32px !important;
  }

  html[data-page="launches"] .min-w-\[200px\] {
    min-width: 0 !important;
    width: auto !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .h-\[42px\],
  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .flex.h-\[42px\] {
    height: 32px !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .text-\[14px\] {
    font-size: 11px !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .w-\[74px\] {
    width: 52px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .w-\[34px\] {
    width: 28px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .p-\[4px\] {
    padding: 2px !important;
    flex: 0 0 auto !important;
  }

  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .flex-1.text-\[14px\] {
    flex: 0 0 auto !important;
  }

  /* Sheets */
  .wg-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 80;
  }
  .wg-sheet.open {
    display: block;
  }
  .wg-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
  }
  .wg-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78dvh, 640px);
    background: #1a1919;
    color: #fff;
    border-radius: 18px 18px 0 0;
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .wg-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: #3a3a3a;
    margin: 2px auto 4px;
  }
  .wg-sheet-title {
    font-size: 16px;
    font-weight: 600;
    padding: 2px 2px 6px;
  }
  .wg-sheet-list {
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 48dvh;
    -webkit-overflow-scrolling: touch;
  }
  .wg-sheet-empty {
    opacity: 0.7;
    font-size: 14px;
    padding: 16px 4px;
  }
  .wg-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 12px;
    background: #242424;
    color: #fff;
    padding: 12px 14px;
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
  }
  .wg-sheet-item:active {
    background: #2e2e2e;
  }
  .wg-sheet-item small {
    margin-left: auto;
    opacity: 0.45;
    font-size: 12px;
    font-weight: 400;
  }
  .wg-sheet-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
  }
  .wg-sheet-avatar > img:first-child,
  .wg-sheet-fallback {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: #333;
    display: block;
  }
  .wg-sheet-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 2px solid #1a1919;
    background: #111;
  }
  .wg-sheet-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .wg-sheet-meta strong {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wg-sheet-meta small {
    font-size: 12px;
    opacity: 0.65;
    text-transform: capitalize;
    margin-left: 0;
  }
  .wg-sheet-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }
  .wg-sheet-icon svg {
    width: 18px;
    height: 18px;
  }
  .wg-sheet-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 4px;
  }
  .wg-sheet-action {
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .wg-sheet-action.primary {
    background: #612bd3;
  }

  /* ========== CALENDAR / PLANNING ========== */
  html[data-page="launches"] .flex.flex-1.gap-\[1px\] {
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  html[data-page="launches"] .bg-newBgColorInner.flex-1.flex-col.flex.p-\[20px\] {
    padding: 6px !important;
    gap: 6px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Bouton Ajouter dans la toolbar calendrier */
  html[data-page="launches"] .wg-add-post-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    height: 32px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: #612bd3 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  /* Flèches jour plus grandes */
  html[data-page="launches"] .text-textColor.flex.flex-col.md\:flex-row .cursor-pointer.px-\[9px\] {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 10px !important;
  }

  /* Zone de scroll unique — vertical prioritaire pour l’aperçu */
  html[data-page="launches"] .flex-1.relative,
  html[data-page="launches"] .wg-cal-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior: contain !important;
    position: relative !important;
  }

  /* ===== SEMAINE: 7 jours visibles d’un coup ===== */
  html[data-page="launches"] div.grid[class*="136px_repeat"] {
    grid-template-columns: 28px repeat(7, minmax(0, 1fr)) !important;
    gap: 2px !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }

  html[data-page="launches"] div.grid[class*="136px_repeat"] > .bg-newTableHeader.h-\[62px\] {
    height: 40px !important;
    min-height: 40px !important;
    padding: 2px 1px !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
  }

  html[data-page="launches"] div.grid[class*="136px_repeat"] > .bg-newTableHeader.h-\[62px\] .text-\[14px\],
  html[data-page="launches"] div.grid[class*="136px_repeat"] > .bg-newTableHeader {
    font-size: 9px !important;
  }

  /* Heures: compactes dans la gouttière */
  html[data-page="launches"] div.grid[class*="136px_repeat"] > .text-\[14px\].text-newTableText {
    font-size: 8px !important;
    padding: 0 1px !important;
    line-height: 1 !important;
  }

  /* ===== MOIS: grille égale, mois entier visible ===== */
  html[data-page="launches"] div.grid.grid-cols-7.grid-rows-\[62px_auto\] {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-template-rows: 28px repeat(6, minmax(0, 1fr)) !important;
    gap: 2px !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  html[data-page="launches"] div.grid.grid-cols-7 > .bg-newTableHeader.h-\[62px\],
  html[data-page="launches"] div.grid.grid-cols-7 > .h-\[62px\] {
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 2px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
  }

  html[data-page="launches"] div.grid.grid-cols-7 .repeated-strip {
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 2px !important;
  }

  html[data-page="launches"] div.grid.grid-cols-7 .repeated-strip .text-\[14px\],
  html[data-page="launches"] div.grid.grid-cols-7 .repeated-strip [class*="text-"] {
    font-size: 11px !important;
  }

  /* En-têtes commun (jour/semaine) */
  html[data-page="launches"] .bg-newTableHeader.h-\[62px\] {
    height: 40px !important;
    padding: 2px 4px !important;
  }

  html[data-page="launches"] .bg-newTableHeader .text-\[14px\] {
    font-size: 10px !important;
  }

  html[data-page="launches"] .flex.flex-col.gap-\[10px\].flex-1.relative {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    gap: 6px !important;
  }

  /* ===== JOUR: agenda dense, aperçu du jour ===== */
  html[data-page="launches"][data-cal-view="day"] .absolute.start-0.top-0.w-full.h-full.flex.flex-col {
    gap: 0 !important;
    padding: 4px 2px 80px !important;
    justify-content: flex-start !important;
  }

  html[data-page="launches"][data-cal-view="day"] .text-center.text-\[14px\].min-h-\[21px\] {
    font-size: 12px !important;
    font-weight: 600 !important;
    min-height: 18px !important;
    padding: 4px 0 2px !important;
    color: #c4b5fd !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    background: rgba(18, 18, 18, 0.92) !important;
  }

  html[data-page="launches"][data-cal-view="day"] .min-h-\[60px\].rounded-\[10px\] {
    min-height: 72px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    padding: 6px !important;
    background: rgba(255, 255, 255, 0.03) !important;
  }

  html[data-page="launches"][data-cal-view="day"] .min-h-\[60px\].rounded-\[10px\] > * {
    flex: 0 0 auto !important;
  }

  /* ========== CREATE POST MODAL (mobile sheet compact) ========== */
  .bg-popup.fixed {
    z-index: 70 !important;
    background: rgba(0, 0, 0, 0.72) !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Dock masqué pendant la création */
  body:has(.bg-popup.fixed) .wg-fab,
  body:has(.bg-popup) #wg-fab {
    display: none !important;
  }

  .bg-popup .flex.relative.flex-1,
  .bg-popup .flex.flex-1 {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
  }

  /* Conteneur Postiz forcé à 80% en inline → plein écran */
  .bg-popup .w-full.h-full.flex-1,
  .bg-popup .w-full.h-full.flex-1.p-\[40px\] {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100% !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .bg-popup .p-\[40px\] {
    padding: 0 !important;
    padding-bottom: 0 !important;
    flex-direction: column !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Carte principale = bottom sheet */
  .bg-popup .flex.flex-1.bg-newBgColorInner,
  .bg-popup .flex.flex-1.bg-newBgColorInner.rounded-\[20px\] {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100dvh - env(safe-area-inset-top, 0px)) !important;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px)) !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .bg-popup .flex-1.flex {
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  /* Colonne éditeur */
  .bg-popup .flex.flex-col.flex-1.border-e {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    border-inline-end: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Header titre compact */
  .bg-popup .bg-newBgColor.h-\[65px\] {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 12px !important;
    gap: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 16px 16px 0 0 !important;
    flex: 0 0 44px !important;
  }

  .bg-popup .bg-newBgColor.h-\[65px\] .text-\[20px\],
  .bg-popup .text-\[20px\].font-\[600\] {
    font-size: 15px !important;
  }

  /* Zone scroll contenu */
  .bg-popup .flex-1.flex.flex-col.gap-\[16px\],
  .bg-popup .flex-1.relative {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    gap: 0 !important;
  }

  .bg-popup .gap-\[32px\].flex.flex-col {
    gap: 10px !important;
    padding: 8px 10px 12px !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 auto !important;
  }

  /* Canaux: strip horizontal compact (plus de pile verticale) */
  .bg-popup .innerComponent.flex-1.flex,
  .bg-popup .innerComponent {
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
    height: auto !important;
  }

  .bg-popup .flex.w-full > .flex.flex-1,
  .bg-popup .flex.w-full {
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
  }

  .bg-popup .flex.flex-wrap.gap-\[12px\].flex-1 {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    max-height: 44px !important;
    min-height: 44px !important;
    align-items: center !important;
    padding: 2px 0 !important;
  }

  .bg-popup .flex.flex-wrap.gap-\[12px\].flex-1 > .flex.gap-\[8px\].items-center {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
  }

  .bg-popup .cursor-pointer.border-\[2px\].rounded-full {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .bg-popup .cursor-pointer.border-\[2px\].rounded-full img {
    width: 32px !important;
    height: 32px !important;
  }

  /* Onglets / preset strip */
  .bg-popup .select-none.left-0.absolute.w-full.z-\[100\] {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    padding: 0 !important;
    height: 36px !important;
  }

  /* Éditeur: pleine largeur, densifié */
  .bg-popup .flex.flex-1.gap-\[6px\].flex-col,
  .bg-popup .relative.flex-col.gap-\[20px\].flex-1.flex,
  .bg-popup .relative.flex.flex-col.gap-\[20px\].flex-1,
  .bg-popup .flex.gap-\[5px\].flex-1.w-full,
  .bg-popup .flex.flex-col.gap-\[20px\].flex-1,
  .bg-popup .flex-1.flex.w-full,
  .bg-popup .relative.cursor-text.flex.flex-1.flex-col {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
    height: auto !important;
  }

  .bg-popup .relative.flex-1.px-\[12px\].pt-\[12px\].pb-\[12px\] {
    padding: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .bg-popup .px-\[10px\].pt-\[10px\].bg-newBgColorInner {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px !important;
    border-radius: 10px !important;
  }

  .bg-popup textarea,
  .bg-popup [contenteditable="true"],
  .bg-popup .ProseMirror {
    font-size: 15px !important;
    min-height: 88px !important;
    max-height: 28vh !important;
    width: 100% !important;
    min-width: 0 !important;
    line-height: 1.4 !important;
  }

  /* Dropzone média compacte */
  .bg-popup [class*="border-dashed"],
  .bg-popup .b1.flex.flex-col.gap-\[8px\] {
    min-height: 0 !important;
    padding: 8px !important;
    gap: 4px !important;
    font-size: 12px !important;
  }

  /* Toolbar éditeur */
  .bg-popup .flex.py-\[10px\].b2 {
    padding: 4px 0 !important;
    height: auto !important;
    min-height: 36px !important;
  }

  /* Aperçu: masqué sur mobile (trop gros / inutile au draft) */
  .bg-popup .w-\[580px\] {
    display: none !important;
  }

  /* Footer actions: barre sticky compacte */
  .bg-popup .select-none.h-\[84px\].py-\[20px\].border-t {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(18, 18, 18, 0.96) !important;
  }

  /* Tag / Répéter: ligne d’icônes compacte */
  .bg-popup .select-none.h-\[84px\] > .cursor-pointer.flex.gap-\[4px\],
  .bg-popup .select-none.h-\[84px\] > .cursor-pointer:not(.pe-\[20px\]) {
    font-size: 11px !important;
    max-width: 48% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    opacity: 0.75 !important;
    height: auto !important;
    margin: 0 !important;
    left: auto !important;
    position: relative !important;
  }

  .bg-popup .pe-\[20px\].flex.items-center.justify-end {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    justify-content: stretch !important;
    align-items: stretch !important;
  }

  /* Date pleine largeur au-dessus des boutons */
  .bg-popup .pe-\[20px\] > .px-\[16px\].border {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    height: 40px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    justify-content: flex-start !important;
  }

  .bg-popup .pe-\[20px\] > button,
  .bg-popup .pe-\[20px\] > .group.cursor-pointer,
  .bg-popup .pe-\[20px\] > .group.cursor-pointer > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 42px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
  }

  .bg-popup .pe-\[20px\] .text-\[15px\].font-\[600\],
  .bg-popup .btnSub .text-\[15px\] {
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .bg-popup button {
    max-width: 100% !important;
  }

  /* Assistant Copilot: masqué dans le modal (encombre) */
  .bg-popup .copilotKitPopup,
  .bg-popup .copilotKitWindow,
  .bg-popup .copilotKitButton {
    display: none !important;
  }

  /* Bouton “Ajouter un commentaire” trop large */
  .bg-popup .select-none.cursor-pointer.h-\[34px\] {
    height: 32px !important;
    font-size: 11px !important;
    padding-inline: 8px !important;
    max-width: 100% !important;
  }

  /* ========== AGENT (mobile chat utilisable) ========== */
  html[data-page="agents"] .flex.flex-1.gap-\[1px\] {
    flex-direction: column !important;
    height: calc(100dvh - 130px) !important;
    max-height: calc(100dvh - 130px) !important;
    gap: 4px !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* Channels strip — compact */
  html[data-page="agents"] .flex.flex-1.gap-\[1px\] > .trz.sidebar {
    order: 1 !important;
    width: 100% !important;
    max-height: 40px !important;
    min-height: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    border-radius: 10px !important;
    padding: 4px 8px !important;
    gap: 6px !important;
  }

  html[data-page="agents"] .trz.sidebar img,
  html[data-page="agents"] .trz.sidebar .group\/profile img,
  html[data-page="agents"] .sidebar img {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 7px !important;
  }

  html[data-page="agents"] .trz.sidebar .group\/profile,
  html[data-page="agents"] .sidebar .group\/profile {
    gap: 4px !important;
    padding: 0 !important;
  }

  /* Threads strip */
  html[data-page="agents"] .flex.flex-1.gap-\[1px\] > .trz.w-\[260px\] {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 36px !important;
    max-height: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  html[data-page="agents"] .trz.w-\[260px\] > .absolute {
    position: static !important;
    padding: 4px 8px !important;
    height: 36px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }

  html[data-page="agents"] .trz.w-\[260px\] .mb-\[15px\] {
    margin: 0 !important;
    flex: 0 0 auto !important;
  }

  html[data-page="agents"] .trz.w-\[260px\] .mb-\[15px\] a {
    min-height: 28px !important;
    max-height: 28px !important;
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  html[data-page="agents"] .trz.w-\[260px\] .mb-\[15px\] a > div.flex-1 {
    display: none !important;
  }

  html[data-page="agents"] .trz.w-\[260px\] .flex.flex-col.gap-\[1px\] {
    flex-direction: row !important;
    gap: 4px !important;
    width: max-content !important;
  }

  html[data-page="agents"] .trz.w-\[260px\] .flex.flex-col.gap-\[1px\] a {
    max-width: 110px !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    min-height: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Chat panel */
  html[data-page="agents"] .flex.flex-1.gap-\[1px\] > .bg-newBgColorInner.flex.flex-1 {
    order: 3 !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  html[data-page="agents"] .trz.agent {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  html[data-page="agents"] .trz.agent > .absolute {
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  html[data-page="agents"] .copilotKitChat {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    width: 100% !important;
  }

  html[data-page="agents"] .copilotKitMessages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 13px !important;
  }

  html[data-page="agents"] .copilotKitMessagesContainer {
    padding: 8px 10px 12px !important;
  }

  html[data-page="agents"] .copilotKitMessage,
  html[data-page="agents"] .copilotKitAssistantMessage,
  html[data-page="agents"] .copilotKitUserMessage {
    padding: 4px 8px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    min-width: 0 !important;
    max-width: 94% !important;
  }

  html[data-page="agents"] .copilotKitMarkdown,
  html[data-page="agents"] .copilotKitMarkdown p,
  html[data-page="agents"] .copilotKitMarkdown li {
    font-size: 13px !important;
    line-height: 1.35 !important;
    margin: 0 0 6px !important;
  }

  html[data-page="agents"] .copilotKitMarkdown p:last-child,
  html[data-page="agents"] .copilotKitMarkdown li:last-child {
    margin-bottom: 0 !important;
  }

  html[data-page="agents"] .copilotKitMarkdown ul,
  html[data-page="agents"] .copilotKitMarkdown ol {
    margin: 4px 0 6px !important;
    padding-left: 18px !important;
  }

  html[data-page="agents"] .copilotKitMessage button,
  html[data-page="agents"] .copilotKitAssistantMessage button {
    min-height: 28px !important;
    width: 28px !important;
    height: 28px !important;
    padding: 4px !important;
  }

  html[data-page="agents"] .copilotKitMessage button svg,
  html[data-page="agents"] .copilotKitAssistantMessage button svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* Input zone — TOUJOURS visible et utilisable */
  html[data-page="agents"] .copilotKitInputContainer,
  html[data-page="agents"] .copilotKitInputContainer.poweredByContainer {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    padding: 8px 10px 10px !important;
    gap: 6px !important;
    min-height: 56px !important;
    background: #1a1919 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 5 !important;
  }

  html[data-page="agents"] .copilotKitInput {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 6px !important;
    min-height: 48px !important;
  }

  html[data-page="agents"] .copilotKitInput textarea,
  html[data-page="agents"] textarea[placeholder*="message"],
  html[data-page="agents"] textarea[placeholder*="Message"] {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    padding: 10px 12px !important;
    min-height: 44px !important;
    height: 44px !important;
    max-height: 120px !important;
    resize: none !important;
    overflow-y: auto !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: #242424 !important;
    color: #fff !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html[data-page="agents"] .copilotKitInputControls {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-height: 36px !important;
  }

  html[data-page="agents"] .copilotKitInputControlButton,
  html[data-page="agents"] .copilotKitInputControls button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 6px !important;
    border-radius: 12px !important;
    flex: 0 0 auto !important;
  }

  html[data-page="agents"] .copilotKitInputControlButton:not([disabled]) {
    background: #612bd3 !important;
    color: #fff !important;
  }

  html[data-page="agents"] .copilotKitMessagesFooter {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
  }

  /* Ne cacher QUE le branding, pas le conteneur input (poweredByContainer) */
  html[data-page="agents"] .copilotKitPoweredBy,
  html[data-page="agents"] a.poweredBy,
  html[data-page="agents"] .poweredBy:not(.copilotKitInputContainer):not(.poweredByContainer) {
    display: none !important;
  }

  /* ========== ANALYTICS ========== */
  html[data-page="analytics"] .flex.flex-1.gap-\[1px\] {
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
    gap: 6px !important;
  }

  html[data-page="analytics"] .bg-newBgColorInner.flex-1,
  html[data-page="analytics"] .bg-newBgColorInner.p-\[20px\] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important;
    gap: 8px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    min-height: 0 !important;
  }

  html[data-page="analytics"] .grid,
  html[data-page="analytics"] [class*="grid-cols"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  html[data-page="analytics"] .max-w-\[200px\] {
    max-width: 140px !important;
    height: 36px !important;
    font-size: 12px !important;
  }

  html[data-page="analytics"] .text-\[24px\],
  html[data-page="analytics"] .text-\[20px\] {
    font-size: 15px !important;
  }

  html[data-page="analytics"] .text-\[36px\],
  html[data-page="analytics"] .text-\[48px\] {
    font-size: 22px !important;
    line-height: 1.1 !important;
  }

  html[data-page="analytics"] .h-\[120px\] {
    height: 56px !important;
  }

  html[data-page="analytics"] .p-\[20px\] {
    padding: 10px !important;
  }

  html[data-page="analytics"] .rounded-\[16px\],
  html[data-page="analytics"] .rounded-\[12px\] {
    border-radius: 10px !important;
  }

  /* ========== SETTINGS + MINI-PAGES ========== */
  html[data-page="settings"] .flex.flex-1.gap-\[1px\],
  html[data-page="plugs"] .flex.flex-1.gap-\[1px\],
  html[data-page="integrations"] .flex.flex-1.gap-\[1px\],
  html[data-page="media"] .flex.flex-1.gap-\[1px\] {
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* Settings: menu → horizontal chips */
  html[data-page="settings"] .bg-newBgColorInner.p-\[20px\].flex.flex-col.transition-all.w-\[260px\],
  html[data-page="settings"] .w-\[260px\] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 8px 10px !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  html[data-page="settings"] .w-\[260px\] .flex.flex-1.flex-col.gap-\[15px\],
  html[data-page="settings"] .wg-settings-nav-row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    flex: 0 0 auto !important;
    padding-bottom: 2px !important;
  }

  html[data-page="settings"] .w-\[260px\] .cursor-pointer.flex.items-center,
  html[data-page="settings"] .wg-settings-chip {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    gap: 8px !important;
  }

  html[data-page="settings"] .w-\[260px\] .cursor-pointer.flex.items-center svg,
  html[data-page="settings"] .w-\[260px\] .cursor-pointer.flex.items-center img {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
  }

  html[data-page="settings"] .wg-settings-logout {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 10px 8px !important;
    margin-top: 4px !important;
    font-size: 13px !important;
    flex: 0 0 auto !important;
  }

  /* Settings content panel */
  html[data-page="settings"] .bg-newBgColorInner.flex-1.flex-col.flex.p-\[20px\],
  html[data-page="plugs"] .bg-newBgColorInner.flex-1.flex-col.flex.p-\[20px\],
  html[data-page="integrations"] .bg-newBgColorInner.flex-1.flex-col.flex.p-\[20px\],
  html[data-page="media"] .bg-newBgColorInner.flex-1.flex-col.flex.p-\[20px\],
  html[data-page="media"] .bg-newBgColorInner.p-\[20px\].flex.flex-1 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    gap: 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    max-height: calc(100dvh - 160px) !important;
  }

  html[data-page="settings"] select,
  html[data-page="settings"] input:not([type="checkbox"]):not([type="radio"]),
  html[data-page="settings"] textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html[data-page="settings"] .flex.items-center.justify-between,
  html[data-page="settings"] .flex.justify-between {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  html[data-page="settings"] label,
  html[data-page="settings"] .text-\[14px\],
  html[data-page="settings"] .text-\[16px\] {
    max-width: 100% !important;
  }

  /* Tables / wide rows in settings */
  html[data-page="settings"] table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
  }

  /* Plugs: 1 column cards */
  html[data-page="plugs"] .grid.grid-cols-3,
  html[data-page="plugs"] .grid[class*="grid-cols"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  html[data-page="plugs"] .grid > * {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Integrations: 1 column cards on mobile */
  html[data-page="integrations"] .grid.grid-cols-4,
  html[data-page="integrations"] .grid[class*="grid-cols"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    justify-items: stretch !important;
  }

  html[data-page="integrations"] .grid > * {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Channel strip on plugs / shared sidebars */
  html[data-page="plugs"] .trz.sidebar,
  html[data-page="plugs"] .sidebar,
  html[data-page="plugs"] .bg-newBgColorInner.p-\[20px\].flex.flex-col.gap-\[15px\] {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    max-height: 64px !important;
    height: auto !important;
    flex-direction: row !important;
    padding: 8px 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  /* Media empty state / upload */
  html[data-page="media"] .absolute {
    max-width: 100% !important;
  }

  html[data-page="media"] button,
  html[data-page="integrations"] button,
  html[data-page="plugs"] button {
    max-width: 100% !important;
  }

  /* Shared: title sizes on mini pages */
  html[data-page="settings"] .text-\[24px\],
  html[data-page="plugs"] .text-\[24px\],
  html[data-page="integrations"] .text-\[24px\],
  html[data-page="media"] .text-\[24px\] {
    font-size: 17px !important;
  }

  html[data-page="settings"] .text-\[20px\],
  html[data-page="plugs"] .text-\[20px\],
  html[data-page="integrations"] .text-\[20px\] {
    font-size: 16px !important;
  }

  .text-\[36px\],
  .text-\[48px\] {
    font-size: 24px !important;
    line-height: 1.15 !important;
  }

  .h-\[120px\] {
    height: 64px !important;
  }

  textarea,
  input,
  select,
  [contenteditable="true"] {
    font-size: 16px !important;
  }

  [role="dialog"],
  [data-radix-dialog-content] {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 6px !important;
  }

  button,
  [role="button"] {
    min-height: 36px;
  }
}
