/* ==========================================================================
   TText - Traitement de textes simplifié pour enfants
   Ecole de l'Enfant-Jésus Morlanwelz
   ========================================================================== */

:root {
  --ttext-primary: #3b82f6;
  --ttext-primary-hover: #2563eb;
  --ttext-primary-light: #eff6ff;
  --ttext-accent: #f59e0b;
  --ttext-accent-hover: #d97706;
  --ttext-success: #10b981;
  --ttext-danger: #ef4444;
  --ttext-bg-desk: #e2e8f0;
  --ttext-paper-white: #ffffff;
  --ttext-text-main: #1e293b;
  --ttext-border: #cbd5e1;
  --ttext-toolbar-bg: #f8fafc;
  --ttext-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Pleine page pour l'application TText (100% de la fenêtre, sans scroll global) */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--ttext-bg-desk);
  font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ttext-wrapper {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--ttext-bg-desk);
  color: var(--ttext-text-main);
  box-sizing: border-box;
}

/* Bouton Retour au site */
.btn-back-site {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1e3a8a !important;
  font-weight: 800 !important;
  border: 1px solid white !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-back-site:hover {
  background: white !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   Bannière supérieure du document (Header fixe)
   -------------------------------------------------------------------------- */
.ttext-top-bar {
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border-radius: 0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.ttext-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}

.ttext-logo-badge {
  background: #facc15;
  color: #1e293b;
  font-weight: 800;
  font-size: 15px;
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.ttext-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  vertical-align: middle;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ttext-doc-name-input {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: white;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  min-width: 200px;
  max-width: 340px;
  transition: all 0.2s;
}

.ttext-doc-name-input:focus {
  background: white;
  color: #1e293b;
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.3);
}

.ttext-doc-name-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.ttext-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ttext-pill-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  user-select: none;
  text-decoration: none !important;
}

.ttext-pill-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: white !important;
  transform: translateY(-1px);
}

.ttext-top-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.35);
  margin: 0 4px;
  flex-shrink: 0;
}

.ttext-pill-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.ttext-pill-btn.btn-accent {
  background: #facc15;
  color: #1e293b;
  border-color: #facc15;
}

.ttext-pill-btn.btn-accent:hover {
  background: #fde047;
}

/* --------------------------------------------------------------------------
   Bandeau d'aide interactif au survol (Hint Bar)
   -------------------------------------------------------------------------- */
.ttext-hint-bar {
  flex-shrink: 0;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  min-height: 30px;
  box-sizing: border-box;
  font-size: 13px;
  color: #334155;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ttext-hint-bar.has-hint {
  background: #eff6ff;
  border-bottom-color: #bfdbfe;
}

.ttext-hint-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.ttext-hint-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.ttext-hint-bar.has-hint .ttext-hint-badge {
  background: #2563eb;
  color: white;
}

.ttext-hint-text {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ttext-hint-bar.has-hint .ttext-hint-text {
  color: #1e293b;
}

.ttext-hint-text strong {
  color: #1d4ed8;
  font-size: 13.5px;
  font-weight: 800;
  margin-right: 4px;
}

/* --------------------------------------------------------------------------
   Barre d'outils principale (Toolbar) & Groupes avec étiquettes
   -------------------------------------------------------------------------- */
.ttext-toolbar {
  flex-shrink: 0;
  background: var(--ttext-toolbar-bg);
  border-bottom: 1px solid var(--ttext-border);
  padding: 6px 16px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  user-select: none;
  z-index: 90;
}

/* Unité de groupe avec étiquette au-dessus */
.ttext-tool-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ttext-unit-label {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.ttext-tool-group {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ttext-tool-separator {
  width: 1px;
  height: 26px;
  background: #e2e8f0;
  margin: 0 2px;
}

.ttext-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #1e293b;
  min-width: 36px;
  height: 36px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.12s ease;
  position: relative;
}

.ttext-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f6cbd;
}

.ttext-btn:active {
  background: #e2e8f0;
  transform: translateY(1px);
}

.ttext-btn.active {
  background: #cde6fd !important;
  color: #0f6cbd !important;
  border: 1px solid #70b3f5 !important;
  box-shadow: inset 0 1px 2px rgba(15, 108, 189, 0.1);
}

.btn-tool-orientation {
  min-width: 96px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.ttext-zoom-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.btn-zoom-action {
  min-width: 32px;
  height: 36px;
  padding: 4px 6px;
  font-size: 12.5px;
  font-weight: 700;
}

.ttext-btn svg {
  display: block;
}

/* Icônes spécifiques Microsoft Word */
.word-icon-bold {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 900;
  font-size: 17px;
  color: inherit;
  line-height: 1;
}

.word-icon-italic {
  font-family: 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  color: inherit;
  line-height: 1;
}

.word-icon-underline {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  color: inherit;
  line-height: 1;
}

/* Bouton Couleur de Police Word (Lettre A avec barre colorée) */
.word-font-color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.word-letter-a {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #1e293b;
  line-height: 1.1;
}

.word-color-bar {
  display: block;
  width: 20px;
  height: 4px;
  border-radius: 1px;
  background-color: #dc2626; /* Rouge Word par défaut */
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Bouton Surlignage Word (feutre ab avec barre) */
.word-highlight-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.word-highlight-bar {
  display: block;
  width: 20px;
  height: 4px;
  border-radius: 1px;
  background-color: #facc15; /* Jaune fluo Word par défaut */
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Sélecteur de Taille Word (Menu déroulant numérique) */
.ttext-size-select {
  background: white;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  min-width: 52px;
  text-align: center;
}

.ttext-size-select:hover, .ttext-size-select:focus {
  border-color: #0f6cbd;
}

.ttext-font-select {
  background: white;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  max-width: 155px;
}

.ttext-font-select:hover, .ttext-font-select:focus {
  border-color: #0f6cbd;
}

.ttext-font-select option {
  padding: 6px 8px;
  font-size: 14px;
}

/* Palette Popover */
.ttext-palette-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  width: 210px;
}

.ttext-palette-popover.show {
  display: block;
  animation: popoverFadeIn 0.15s ease-out;
}

/* Menu de choix du format d'enregistrement */
.save-menu-popover {
  width: 270px;
  left: 0;
  transform: none;
  padding: 8px;
}

.ttext-save-split-group {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.ttext-btn-split-arrow {
  padding: 0 4px !important;
  min-width: 18px !important;
  margin-left: -2px;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.save-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.save-option-btn:last-child {
  margin-bottom: 0;
}

.save-option-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.save-option-btn.active-format {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.save-fmt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 6px;
  color: white;
  min-width: 40px;
  letter-spacing: 0.5px;
}

.odt-badge {
  background: linear-gradient(135deg, #185abd, #0284c7);
}

.ttext-badge {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.html-badge {
  background: linear-gradient(135deg, #ea580c, #f97316);
}

.txt-badge {
  background: linear-gradient(135deg, #475569, #64748b);
}

.save-fmt-text {
  display: flex;
  flex-direction: column;
}

.save-fmt-text strong {
  font-size: 13px;
  color: #1e293b;
  display: block;
}

.save-fmt-text small {
  font-size: 11px;
  color: #64748b;
  display: block;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.palette-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
  text-align: center;
}

.palette-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  justify-items: center;
}

.swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.swatch-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--ttext-primary);
}

.custom-color-row {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.custom-color-input {
  width: 30px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

/* --------------------------------------------------------------------------
   Zone Bureau & Feuille A4 (Canvas de rédaction)
   -------------------------------------------------------------------------- */
.ttext-workspace {
  flex: 1;
  min-height: 0;
  background: var(--ttext-bg-desk);
  padding: 30px 20px 60px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: auto;
}

.ttext-paper-container {
  position: relative;
  transition: transform 0.2s ease;
  transform-origin: top center;
}

.ttext-paper {
  background-color: var(--ttext-paper-white);
  width: 780px;
  min-height: 720px;
  padding: 60px 65px;
  border-radius: 4px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  outline: none;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: #1e293b;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Placeholder stylé pour la feuille */
.ttext-paper:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-style: italic;
  pointer-events: none;
  display: block;
}


/* Orientation Paysage (Horizontal) */
.ttext-paper.orientation-landscape {
  width: 1020px;
  min-height: 560px;
  padding: 50px 60px;
}

/* Paragraphes ou blocs encadrés */
.ttext-boxed-block {
  border: 2px solid #3b82f6;
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 12px 18px;
  margin: 14px 0;
  position: relative;
  transition: border-color 0.2s;
}

.ttext-boxed-block:hover {
  border-color: #1d4ed8;
}

/* Images insérées dans la feuille */
.ttext-paper img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: grab;
  transition: outline 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  vertical-align: middle;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.ttext-paper img:hover {
  outline: 2px dashed #93c5fd;
}

.ttext-paper img:active {
  cursor: grabbing;
}

.ttext-paper img.ttext-selected-img {
  outline: 3px solid #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.ttext-paper img.ttext-img-dragging {
  opacity: 0.45;
  outline: 3px dashed #2563eb !important;
  cursor: grabbing;
}

/* Indicateur visuel lors du glisser-déposer de l'image */
#ttext-img-drop-indicator {
  position: absolute;
  width: 4px;
  background: #2563eb;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.85), 0 0 2px #1d4ed8;
  pointer-events: none;
  z-index: 1000;
  display: none;
  animation: dropIndicatorPulse 0.8s infinite ease-in-out;
  transition: top 0.05s ease, left 0.05s ease;
}

@keyframes dropIndicatorPulse {
  0%, 100% { opacity: 0.85; transform: scaleX(1); }
  50% { opacity: 1; transform: scaleX(1.3); }
}

/* Habillage d'image : flottement et alignement */
.ttext-paper img.ttext-img-float-left {
  float: left;
  margin: 6px 18px 12px 0;
}

.ttext-paper img.ttext-img-float-right {
  float: right;
  margin: 6px 0 12px 18px;
}

.ttext-paper img.ttext-img-center {
  display: block;
  margin: 16px auto;
  float: none;
  clear: both;
}

.ttext-paper img.ttext-img-inline {
  display: inline-block;
  vertical-align: middle;
  margin: 0 6px;
  float: none;
}

/* --------------------------------------------------------------------------
   Barre d'état inférieure (Status Bar)
   -------------------------------------------------------------------------- */
.ttext-status-bar {
  flex-shrink: 0;
  background: white;
  border-top: 1px solid var(--ttext-border);
  border-radius: 0;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  z-index: 80;
  min-height: 42px;
  box-sizing: border-box;
  white-space: nowrap;
}

.status-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.status-stats::-webkit-scrollbar {
  display: none;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stat-number {
  color: #0f172a;
  font-weight: 800;
}

/* Badge compteur pour l'objectif de 500 caractères */
.stat-char-badge {
  padding: 3px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.stat-char-badge.warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 800;
}
.stat-char-badge.warning .stat-number {
  color: #b45309;
}

.stat-char-badge.exceeded {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  font-weight: 800;
}
.stat-char-badge.exceeded .stat-number {
  color: #b91c1c;
}

.status-badge {
  background: #f1f5f9;
  color: #334155;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge.highlight {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.status-school-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  user-select: none;
  flex-shrink: 0;
}

.status-school-logo {
  height: 20px;
  width: auto;
  max-width: 50px;
  object-fit: contain;
  vertical-align: middle;
}

.status-school-copy {
  letter-spacing: 0.2px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .status-school-copy {
    display: none;
  }
}

@media (max-width: 992px) {
  .status-school-brand {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Modales d'aide & de modèles
   -------------------------------------------------------------------------- */
.ttext-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.ttext-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ttext-modal-card {
  background: white;
  border-radius: 20px;
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.ttext-modal-overlay.active .ttext-modal-card {
  transform: scale(1);
}

.ttext-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-radius: 20px 20px 0 0;
}

.ttext-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ttext-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.ttext-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ttext-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}


.tips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--ttext-primary);
}

.tip-icon {
  font-size: 24px;
  line-height: 1;
}

.tip-text h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.tip-text p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}

/* Notification Toast */
.ttext-toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #1e293b;
  color: white;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ttext-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Impression propre (Feuille A4 seule, multi-pages sans barres de défilement)
   -------------------------------------------------------------------------- */
@page {
  size: A4 portrait;
  margin: 15mm;
}

@page landscape-page {
  size: A4 landscape;
  margin: 15mm;
}

@media print {
  /* Débloquer la hauteur fixe (100vh) et l'overflow:hidden de l'application */
  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  body.print-landscape {
    page: landscape-page;
  }

  /* Masquer tous les éléments du site et de l'interface */
  #haut, #menu, .header-actions, #filrouge, .centered-text, #bas, footer,
  .ttext-top-bar, .ttext-toolbar, .ttext-status-bar, .ttext-modal-overlay, .ttext-toast,
  .ttext-hint-bar, #ttext-spell-drawer, .ttext-spell-drawer, .image-floating-toolbar,
  .table-floating-toolbar, #ttext-img-drop-indicator, .ttext-palette-popover, .save-menu-popover,
  .ttext-page-guides-overlay, .ttext-auto-page-guide {
    display: none !important;
  }

  .ttext-wrapper,
  .ttext-workspace,
  .ttext-paper-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: white !important;
    overflow: visible !important;
    transform: none !important;
    box-shadow: none !important;
  }

  .ttext-paper,
  .ttext-paper.orientation-landscape {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    box-shadow: none !important;
    padding: 5mm !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: white !important;
    background-image: none !important; /* Pas de réglure à l'impression */
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .ttext-paper img {
    max-width: 100% !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .ttext-paper blockquote,
  .ttext-boxed-block,
  .ttext-academic-cartouche {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* --------------------------------------------------------------------------
   Responsive Mobile & Tablette
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .ttext-paper {
    width: 95vw;
    padding: 35px 25px;
  }

  .ttext-toolbar {
    gap: 6px;
    padding: 8px;
  }

  .ttext-btn {
    min-width: 32px;
    height: 32px;
    font-size: 14px;
    padding: 2px 6px;
  }
}

/* --------------------------------------------------------------------------
   Pinceau de mise en forme (Format Painter)
   -------------------------------------------------------------------------- */
#btn-format-painter.active {
  background: #dbeafe !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: inset 0 2px 4px rgba(37, 99, 235, 0.2);
}

body.format-painter-active #ttext-editor {
  cursor: crosshair !important;
}

/* --------------------------------------------------------------------------
   Barre d'outils flottante pour les images
   -------------------------------------------------------------------------- */
.image-floating-toolbar {
  position: absolute;
  z-index: 1000;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: calc(100vw - 20px);
  gap: 8px;
  background: #1e293b;
  color: white;
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  user-select: none;
  animation: ttextToolbarPop 0.15s ease-out;
}

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

.img-tool-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.img-tool-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 2px;
}

.img-tool-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.img-tool-btn:hover {
  background: #475569;
  color: white;
}

.img-tool-btn.active {
  background: #2563eb;
  color: white;
}

.img-tool-divider {
  width: 1px;
  height: 18px;
  background: #475569;
  margin: 0 4px;
}

.img-tool-delete {
  background: #dc2626;
  color: white;
}

.img-tool-delete:hover {
  background: #b91c1c;
}

/* Bouton insertion d'image dans la toolbar */
.btn-insert-image-toolbar {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

.btn-insert-image-toolbar:hover {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
}

/* --------------------------------------------------------------------------
   Modale Image & Stickers scolaires
   -------------------------------------------------------------------------- */
.image-modal-card {
  max-width: 580px;
}

.image-upload-zone {
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-upload-zone:hover {
  background: #dbeafe;
  border-color: #2563eb;
}

.image-upload-zone.dragover {
  background: #bfdbfe;
  border-color: #1d4ed8;
  transform: scale(1.02);
}

.upload-icon {
  font-size: 34px;
  margin-bottom: 6px;
}

.upload-title {
  font-size: 15px;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.upload-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.modal-divider-text {
  text-align: center;
  position: relative;
  margin: 20px 0 16px;
}

.modal-divider-text::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e2e8f0;
  z-index: 1;
}

.modal-divider-text span {
  position: relative;
  background: white;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  z-index: 2;
}

.stickers-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.sticker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sticker-card:hover {
  background: white;
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.sticker-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 6px;
}

.sticker-card span {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

/* ==========================================================================
   MODULE SECONDAIRE (S1 - S3 / FMTTN)
   Commutateur, Styles sémantiques, Tableaux, Sommaire, Cartouche, Citations
   ========================================================================== */

/* 1. Commutateur de Mode (Discret et ultra-lisible dans la barre d'état) */
.status-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: #cbd5e1;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.status-mode-label {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px 0 6px;
  user-select: none;
}

.status-mode-btn {
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.status-mode-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.4);
}

/* État actif : contraste fort et pastille verte lumineuse pour lever toute ambiguïté */
.status-mode-btn.active {
  background: #1e3a8a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.status-mode-btn.active::before {
  content: '●';
  color: #4ade80; /* Pastille verte vive */
  font-size: 10px;
  margin-right: 2px;
}

/* 2. Gestion de la visibilité Primaire / Secondaire */
.secondary-only {
  display: none !important;
}

body.mode-secondaire .secondary-only {
  display: inline-flex !important;
}

body.mode-secondaire .primaire-only {
  display: none !important;
}

body.mode-secondaire .ttext-status-bar {
  flex-wrap: nowrap !important;
}

body.mode-secondaire .status-stats {
  flex-wrap: nowrap !important;
  gap: 10px;
}

body.mode-secondaire .ttext-top-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

/* 3. Sélecteur de Styles Sémantiques (FMTTN) */
.ttext-style-select {
  font-weight: 700;
  color: #1e3a8a;
  background-color: #eff6ff;
  border-color: #bfdbfe;
  min-width: 155px;
}

.ttext-style-select option {
  font-weight: normal;
  padding: 6px 10px;
}

.ttext-style-select option[value="h1"] { font-size: 16px; font-weight: 800; color: #1e3a8a; }
.ttext-style-select option[value="h2"] { font-size: 14.5px; font-weight: 700; color: #2563eb; }
.ttext-style-select option[value="h3"] { font-size: 13.5px; font-weight: 700; color: #3b82f6; }
.ttext-style-select option[value="blockquote"] { font-style: italic; color: #475569; }

/* 4. Rendu typographique des balises sémantiques dans la feuille */
.ttext-paper h1 {
  font-size: 24pt;
  line-height: 1.25;
  color: #1e3a8a;
  margin: 22px 0 10px 0;
  font-weight: 800;
  border-bottom: 2px solid #bfdbfe;
  padding-bottom: 4px;
}

.ttext-paper h2 {
  font-size: 18pt;
  line-height: 1.3;
  color: #1d4ed8;
  margin: 18px 0 8px 0;
  font-weight: 700;
}

.ttext-paper h3 {
  font-size: 15pt;
  line-height: 1.35;
  color: #2563eb;
  margin: 14px 0 6px 0;
  font-weight: 700;
}

.ttext-paper blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 4px solid #3b82f6;
  background: #f8fafc;
  color: #334155;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.ttext-paper a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s;
}

.ttext-paper a:hover {
  color: #1d4ed8;
}

/* 5. Table des matières automatique (Sommaire) */
.ttext-toc {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0 24px 0;
  font-size: 13.5px;
  user-select: text;
}

.ttext-toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 800;
  color: #1e3a8a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.ttext-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ttext-toc-item {
  margin: 4px 0;
  line-height: 1.4;
}

.ttext-toc-item.level-1 { font-weight: 700; color: #1e3a8a; }
.ttext-toc-item.level-2 { padding-left: 18px; font-weight: 600; color: #2563eb; }
.ttext-toc-item.level-3 { padding-left: 36px; font-size: 12.5px; color: #475569; }

.ttext-toc-link {
  color: inherit !important;
  text-decoration: none !important;
  display: inline-block;
  transition: transform 0.15s ease;
}

.ttext-toc-link:hover {
  text-decoration: underline !important;
  transform: translateX(2px);
}

/* 6. Tableaux simples pour sciences / géographie / math */
.ttext-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
}

.ttext-paper table.ttext-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: white;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ttext-paper table.ttext-table th,
.ttext-paper table.ttext-table td {
  border: 1.5px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  min-width: 60px;
}

.ttext-paper table.ttext-table th {
  background: #f1f5f9;
  font-weight: 800;
  color: #1e293b;
}

.ttext-paper table.ttext-table tr:nth-child(even) td {
  background: #f8fafc;
}

.ttext-paper table.ttext-table td:focus,
.ttext-paper table.ttext-table th:focus {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  background: #eff6ff !important;
}

/* Popover de création de tableau */
.table-popover {
  width: 230px;
  padding: 12px;
}

.table-grid-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #334155;
  font-weight: 700;
}

.table-grid-inputs label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-grid-inputs input {
  width: 55px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

.table-quick-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tbl-preset-btn {
  flex: 1;
  padding: 5px 0;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}

.tbl-preset-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.tbl-insert-confirm-btn {
  width: 100%;
  padding: 7px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.tbl-insert-confirm-btn:hover {
  background: #1d4ed8;
}

/* Barre flottante contextuelle pour les tableaux */
.table-floating-toolbar {
  position: fixed;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 5px 8px;
  z-index: 1050;
  animation: popoverFadeIn 0.15s ease-out;
}

.tbl-tool-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tbl-tool-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #64748b;
  margin-right: 4px;
}

.tbl-tool-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.tbl-tool-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.tbl-tool-btn.tbl-delete-btn {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.tbl-tool-btn.tbl-delete-btn:hover {
  background: #fee2e2;
}

.tbl-tool-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 4px;
}

/* 7. Cartouche / En-tête académique officiel */
.ttext-academic-cartouche {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: #f8fafc;
  font-size: 13.5px;
  color: #1e293b;
  user-select: text;
}

.cartouche-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.cartouche-field {
  padding: 2px 6px;
  border-bottom: 1.5px dashed #94a3b8;
  outline: none;
  min-width: 60px;
  display: inline-block;
  background: white;
  border-radius: 3px;
}

.cartouche-field:focus {
  border-bottom-color: #2563eb;
  background: #eff6ff;
}

/* 8. Saut de page explicite (avec marges de bas et de haut de page visibles) */
.ttext-page-break {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 60px -65px;
  height: 32px;
  padding: 0 12px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  text-align: center;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: var(--ttext-bg-desk, #cbd5e1);
  box-shadow: inset 0 4px 6px rgba(15, 23, 42, 0.1), inset 0 -4px 6px rgba(15, 23, 42, 0.1);
  user-select: none;
  break-after: page;
  page-break-after: always;
}

.ttext-paper.orientation-landscape .ttext-page-break {
  margin: 50px -60px;
}

.ttext-page-break::before {
  content: "↕ Marge de bas de page";
  position: absolute;
  top: -58px;
  left: 65px;
  right: 65px;
  height: 56px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}

.ttext-page-break::after {
  content: "↕ Marge de haut de page";
  position: absolute;
  bottom: -58px;
  left: 65px;
  right: 65px;
  height: 56px;
  border-bottom: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}

/* 9. Notes de bas de page */
sup.ttext-footnote-ref a {
  color: #2563eb;
  font-weight: 800;
  font-size: 11px;
  text-decoration: none;
  padding: 0 2px;
}

.ttext-footnotes-section {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1.5px solid #cbd5e1;
  font-size: 12.5px;
  color: #475569;
}

.ttext-footnotes-section ol {
  margin: 8px 0 0 20px;
  padding: 0;
}

.ttext-footnotes-section li {
  margin: 4px 0;
  line-height: 1.4;
}

/* 10. Bouton d'objectif & Badges de statistiques secondaires */
.stat-goal-btn {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stat-goal-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.stat-goal-btn.goal-reached {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.stat-detail-badge {
  font-size: 12.5px;
  color: #475569;
}

/* 11. Badges PDF et DOCX dans le menu de sauvegarde */
.pdf-badge {
  background: #dc2626;
  color: white;
}

.pdf-save-btn:hover {
  border-color: #ef4444;
  background: #fef2f2;
}

.docx-badge {
  background: #1d4ed8;
  color: white;
}

.docx-save-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

/* 11b. Repères visuels automatiques des pages A4 (avec marges de bas et de haut de page) */
.ttext-page-guides-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.ttext-auto-page-guide {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.ttext-guide-margin-bottom {
  box-sizing: border-box;
  margin: 0 65px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
}

.ttext-guide-margin-top {
  box-sizing: border-box;
  margin: 0 65px;
  border-bottom: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
}

.ttext-guide-cut-bar {
  position: relative;
  height: 32px;
  background: var(--ttext-bg-desk, #cbd5e1);
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: inset 0 4px 6px rgba(15, 23, 42, 0.1), inset 0 -4px 6px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ttext-guide-cut-bar::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  border-top: 2px dashed #94a3b8;
  z-index: 1;
}

.ttext-auto-page-guide-label {
  position: relative;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
}

/* 12. Ajustements d'impression pour PDF et mode secondaire */
@media print {
  .table-floating-toolbar,
  #link-modal,
  .ttext-mode-toggle,
  .ttext-toc-title button,
  .ttext-page-break::before,
  .ttext-page-break::after {
    display: none !important;
  }

  .ttext-page-break {
    border: none !important;
    background: transparent !important;
    color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    box-shadow: none !important;
    break-after: page !important;
    page-break-after: always !important;
  }

  .ttext-paper table.ttext-table {
    box-shadow: none !important;
    break-inside: auto;
  }

  .ttext-paper table.ttext-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .ttext-academic-cartouche {
    border: 1.5px solid #000 !important;
    background: white !important;
  }

  .ttext-paper a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}

