.t3sg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}.t3sg-toolbar a,.t3sg-toolbar .button,.t3sg-toolbar .et_pb_button {
  display: inline-flex;
  align-items: center;
  margin: 0 !important;
  position: static !important;
  width: auto !important;
}.t3sg-accordion--presentation .t3sg-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media(max-width:980px){.t3sg-accordion--presentation .t3sg-form-grid {
  grid-template-columns: 1fr;
}}.t3sg-style-title,.t3sg-style-grid {
  grid-column: 1;
}

@media(max-width:1024px){#t3sg-file-table thead {
  display: none;
}#t3sg-file-table tbody tr {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}#t3sg-file-table td:nth-child(1) {
  grid-column: 1;
}#t3sg-file-table td:nth-child(2) {
  grid-column: 1;
}#t3sg-file-table td:nth-child(3) {
  display: none;
}#t3sg-file-table td:last-child {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}#t3sg-file-table .t3sg-thumb {
  max-width: 48px;
}
}

@media(max-width:1024px){.t3sg-approval-table thead {
  display: none;
}
}
@media(max-width:480px){.t3sg-approval-table tbody tr {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
}.t3sg-approval-table td:nth-child(1) {
  grid-column: 1;
}.t3sg-approval-table td:nth-child(2) {
  grid-column: 1;
}.t3sg-approval-table td:nth-child(3) {
  display: none;
}.t3sg-approval-table td:last-child {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}.t3sg-approval-table .t3sg-thumb {
  max-width: 44px !important;
}
}

@media(max-width:1024px){.t3sg-comments-table thead {
  display: none;
} }
@media(max-width:980px){.t3sg-comments-table tbody tr {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}.t3sg-comments-table td:last-child {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
}
@media(max-width:480px){.t3sg-comments-table td:nth-child(3) {
  display: none;
}
}.t3sg-toolbar {
  justify-content: flex-end;
}.t3sg-toolbar a, .t3sg-toolbar .button, .t3sg-toolbar .et_pb_button {
  margin: 0 !important;
  position: static !important;
}

@media (max-width:980px){.t3sg-comments-table thead {
  display: none;
}.t3sg-comments-table tbody tr {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "author actions"
      "content actions"
      "date actions"
      "status actions";
  align-items: start;
  row-gap: 8px;
  column-gap: 12px;
}.t3sg-comments-table td {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}.t3sg-comments-table td:nth-child(1) {
  grid-area: author;
}.t3sg-comments-table td:nth-child(2) {
  grid-area: content;
}.t3sg-comments-table td:nth-child(3) {
  grid-area: date;
}.t3sg-comments-table td:nth-child(4) {
  grid-area: status;
}.t3sg-comments-table td:nth-child(5) {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
}

@media (max-width:480px){.t3sg-comments-table tbody tr {
  row-gap: 10px;
}
}

@media (max-width:980px){#t3sg-comments-table thead {
  display: none;
}#t3sg-comments-table tbody tr {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "author actions"
      "content actions"
      "date actions"
      "status actions";
  align-items: start;
  row-gap: 8px;
  column-gap: 12px;
}#t3sg-comments-table td {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}#t3sg-comments-table td:nth-child(1) {
  grid-area: author;
}#t3sg-comments-table td:nth-child(2) {
  grid-area: content;
}#t3sg-comments-table td:nth-child(3) {
  grid-area: date;
}#t3sg-comments-table td:nth-child(4) {
  grid-area: status;
}#t3sg-comments-table td:nth-child(5) {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
}
@media (max-width:480px){#t3sg-comments-table tbody tr {
  row-gap: 10px;
}
}

@media (max-width:980px){#t3sg-comments-table thead {
  display: none;
}#t3sg-comments-table tbody tr {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-areas: "author actions"
      "content actions"
      "date actions"
      "status actions";
  align-items: start;
  row-gap: 10px;
  column-gap: 12px;
}#t3sg-comments-table td {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}#t3sg-comments-table td:nth-child(1) {
  grid-area: author;
}#t3sg-comments-table td:nth-child(2) {
  grid-area: content;
}#t3sg-comments-table td:nth-child(3) {
  grid-area: date;
  white-space: nowrap;
}#t3sg-comments-table td:nth-child(4) {
  grid-area: status;
  white-space: nowrap;
}#t3sg-comments-table td:nth-child(5) {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-content: flex-start;
}
}
@media (max-width:480px){#t3sg-comments-table tbody tr {
  row-gap: 12px;
}
}

@media (max-width:980px){#t3sg-comments-table thead {
  display: none;
}#t3sg-comments-table tbody tr {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: transparent;
}#t3sg-comments-table td {
  box-sizing: border-box;
  width: 50%;
  padding: 4px 6px;
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}#t3sg-comments-table td:nth-child(5) {
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
}
@media (max-width:480px){#t3sg-comments-table tbody tr {
  padding: 10px;
  border-radius: 10px;
}#t3sg-comments-table td {
  padding: 4px 6px;
}
}#t3sg-comments-table td,
#t3sg-comments-table th {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}#t3sg-comments-table td:nth-child(3),
#t3sg-comments-table td:nth-child(4) {
  white-space: nowrap;
}.t3sg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}.t3sg-toolbar a,
.t3sg-toolbar .button,
.t3sg-toolbar .et_pb_button {
  margin: 0 !important;
  position: static !important;
}.t3sg-gallery-wrapper,
.t3sg-frontend-editor,
.t3sg-auth-wrapper,
.t3sg-profile,
.t3sg-myfiles {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}.t3sg-table th, .t3sg-table td,
#t3sg-comments-table th, #t3sg-comments-table td,
#t3sg-file-table th, #t3sg-file-table td,
.t3sg-approval-table th, .t3sg-approval-table td {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}#t3sg-comments-table td:nth-child(3),
#t3sg-comments-table td:nth-child(4) {
  white-space: normal !important;
}.t3sg-accordion--presentation .t3sg-form-grid {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 16px;
  grid-auto-flow: row;
}.t3sg-accordion--presentation .t3sg-row {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 12px;
}.t3sg-accordion--presentation .t3sg-grid-2 {
  grid-template-columns: 1fr !important;
}.t3sg-accordion--presentation .t3sg-form-grid .t3sg-field:has(#t3sg_intro_youtube) {
  order: 999;
}.t3sg-accordion--presentation .t3sg-youtube-wrap {
  max-width: 100% !important;
}


/* === T3SG Mobile File List Fix (2025-09-29) ===
   Make rows use CSS grid so the delete button never overlaps the thumbnail.
   Applies to both "Mes fichiers" and "Organisation & suppression" lists. */
@media (max-width: 768px) {
  #t3sg-file-table thead { display: none; }
  #t3sg-file-table tbody tr {
    display: grid !important;
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "check name"
      "thumb actions";
    gap: 8px;
    align-items: center;
  }
  #t3sg-file-table td { padding: 8px 10px; }
  #t3sg-file-table td:nth-child(1) { grid-area: check; }
  #t3sg-file-table td:nth-child(2) { grid-area: thumb; }
  #t3sg-file-table td:nth-child(3) {
    grid-area: name;
    display: block !important; /* keep filename visible on mobile */
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  #t3sg-file-table td:last-child {
    grid-area: actions;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }
  #t3sg-file-table .t3sg-thumb {
    max-width: 48px;
    height: auto;
    display: block;
  }
}
/* Slightly wider phones / small tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  #t3sg-file-table thead { display: none; }
  #t3sg-file-table tbody tr {
    display: grid !important;
    grid-template-columns: 64px 1fr auto;
    grid-template-areas: "thumb name actions";
    gap: 12px;
    align-items: center;
  }
  #t3sg-file-table td:nth-child(1) { display: none; } /* hide bulk checkbox to save space */
  #t3sg-file-table td:nth-child(2) { grid-area: thumb; }
  #t3sg-file-table td:nth-child(3) { grid-area: name; display: block !important; }
  #t3sg-file-table td:last-child { grid-area: actions; display: flex !important; justify-content: flex-end; gap: 8px; }
  #t3sg-file-table .t3sg-thumb { max-width: 56px; height: auto; }
}


/* === T3SG Mobile - force delete action to the right === */
@media (max-width: 768px) {
  .t3sg-frontend-editor #t3sg-file-table td:last-child {
    grid-area: actions;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center;
    text-align: right !important;
  }
  .t3sg-frontend-editor #t3sg-file-table td:last-child .t3sg-delete-image,
  .t3sg-frontend-editor #t3sg-file-table td:last-child a {
    margin-left: auto !important; /* push to the right in flex */
  }
}

/* Linkage clarity: put checkbox next to thumbnail and highlight checked row */
@media (max-width: 768px) {
  #t3sg-file-table tbody tr {
    grid-template-columns: 28px 56px 1fr;
    grid-template-areas:
      "check thumb actions"
      "name  name  actions";
  }
  #t3sg-file-table td:nth-child(1){ grid-area: check; }
  #t3sg-file-table td:nth-child(2){ grid-area: thumb; }
  #t3sg-file-table td:nth-child(3){ grid-area: name; }
  #t3sg-file-table td:last-child{ grid-area: actions; }
  #t3sg-file-table .t3sg-thumb-label{ display:inline-block; }
}
/* Visual feedback when selected */
#t3sg-file-table tbody tr:has(.t3sg-checkbox:checked){
  background: rgba(34,113,177,0.08);
  outline: 2px solid #2271b1;
  border-radius: 8px;
}

/* === T3SG Mobile - hide filename, keep checkbox + thumbnail + delete === */
@media (max-width: 768px) {
  #t3sg-file-table td:nth-child(3),
  #t3sg-file-table th:nth-child(3) {
    display: none !important;
  }
  #t3sg-file-table tbody tr {
    display: grid !important;
    grid-template-columns: 28px 56px 1fr;
    grid-template-areas: "check thumb actions";
    gap: 10px;
    align-items: center;
  }
  #t3sg-file-table td:nth-child(1){ grid-area: check; }
  #t3sg-file-table td:nth-child(2){ grid-area: thumb; }
  #t3sg-file-table td:last-child { grid-area: actions; display:flex !important; justify-content:flex-end !important; }
}

/* === Desktop (>=1025px) — ensure Action column is visible & aligned right === */
@media (min-width: 1025px) {
  .t3sg-frontend-editor #t3sg-file-table td:last-child,
  .t3sg-frontend-editor .t3sg-front-order td:last-child {
    display: table-cell !important;
    text-align: right;
    width: auto;
    white-space: nowrap;
    visibility: visible;
  }
  .t3sg-frontend-editor #t3sg-file-table td:last-child a,
  .t3sg-frontend-editor .t3sg-front-order td:last-child a {
    display: inline-flex !important;
    align-items: center;
  }
}

/* === Desktop hard reset for file table (buttons off-screen fix) === */
@media (min-width: 1025px) {
  .t3sg-frontend-editor #t3sg-file-table { table-layout: auto !important; width: 100% !important; }
  .t3sg-frontend-editor #t3sg-file-table thead { display: table-header-group !important; }
  .t3sg-frontend-editor #t3sg-file-table tbody { display: table-row-group !important; }
  .t3sg-frontend-editor #t3sg-file-table tr { display: table-row !important; }
  .t3sg-frontend-editor #t3sg-file-table th,
  .t3sg-frontend-editor #t3sg-file-table td { display: table-cell !important; }
  .t3sg-frontend-editor #t3sg-file-table th:last-child,
  .t3sg-frontend-editor #t3sg-file-table td:last-child {
    text-align: right !important;
    white-space: nowrap;
    visibility: visible !important;
  }
}

/* Ensure action column header is visible */
.t3sg-frontend-editor #t3sg-file-table th:last-child { display: table-cell !important; }

/* === Desktop (>=1025px): keep filename from growing infinitely === */
@media (min-width: 1025px) {
  /* Use fixed table layout so columns respect explicit widths */
  .t3sg-frontend-editor #t3sg-file-table { table-layout: fixed !important; width: 100% !important; }
  /* Checkbox */
  .t3sg-frontend-editor #t3sg-file-table th:nth-child(1),
  .t3sg-frontend-editor #t3sg-file-table td:nth-child(1) { width: 36px !important; }
  /* Thumbnail */
  .t3sg-frontend-editor #t3sg-file-table th:nth-child(2),
  .t3sg-frontend-editor #t3sg-file-table td:nth-child(2) { width: 110px !important; }
  /* Action column reserved space (button width) */
  .t3sg-frontend-editor #t3sg-file-table th:last-child,
  .t3sg-frontend-editor #t3sg-file-table td:last-child { width: 140px !important; text-align: right; white-space: nowrap; }
  /* Filename: take remaining width but clip/ellipsis instead of expanding */
  .t3sg-frontend-editor #t3sg-file-table th:nth-child(3),
  .t3sg-frontend-editor #t3sg-file-table td:nth-child(3) {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}


/* =========================================
   T3SG - Mobile overflow guards for accordions
   Prevent admin/editor accordion content from exceeding viewport width
========================================= */
@media (max-width: 768px){
  .t3sg-accordion,
  .t3sg-accordion-content,
  .t3sg-accordion-body,
  .t3sg-accordion-panel{
    max-width: 100%;
    box-sizing: border-box;
  }

  .t3sg-accordion-content{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .t3sg-accordion-content *{
    max-width: 100%;
    box-sizing: border-box;
  }

  .t3sg-accordion-content table{
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .t3sg-accordion-content pre,
  .t3sg-accordion-content code{
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .t3sg-accordion-content input[type="text"],
  .t3sg-accordion-content input[type="url"],
  .t3sg-accordion-content input[type="email"],
  .t3sg-accordion-content input[type="password"],
  .t3sg-accordion-content input[type="number"],
  .t3sg-accordion-content select,
  .t3sg-accordion-content textarea{
    width: 100%;
    max-width: 100%;
  }

  .t3sg-accordion-content iframe,
  .t3sg-accordion-content video,
  .t3sg-accordion-content img{
    max-width: 100%;
    height: auto;
  }
}
