/* Translator Styles - Integrati con gestionale */
.main-translator-container {
  background: #f8f9fa;
  min-height: calc(100vh - 200px);
  padding: 20px 0;
}

.translator-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Breadcrumb personalizzato */
.breadcrumb {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #e9ecef;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: #6c757d;
  font-weight: bold;
}

.breadcrumb-item a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: #2980b9;
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #495057;
  font-weight: 600;
}

.translator-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #e3e6f0;
  transition: all 0.3s ease;
  padding: 40px;
  margin-bottom: 0 !important; /* Remove bottom margin to eliminate gap */
  position: relative;
  overflow: hidden;
}

.translator-header {
  text-align: center;
  margin-bottom: 30px;
}

.translator-title {
  color: #2c3e50;
  font-weight: 600;
  font-size: 2rem;
  margin-bottom: 10px;
}

.translator-subtitle {
  color: #7f8c8d;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.language-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.lang-select {
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  min-width: 120px;
  transition: all 0.3s ease;
}

.lang-select:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.lang-detect-label {
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
  font-size: 1rem;
  min-width: 120px;
  color: #6c757d;
  text-align: center;
  font-weight: 500;
}

.lang-detect {
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  transition: all 0.3s ease;
}

.clear-btn {
  background: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  background: #2980b9;
  transform: rotate(180deg);
}

.translator-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.input-section, .output-section {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

.section-title h4 {
  margin: 0;
  font-size: 0.95rem;
}

.section-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: #6c757d;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn:hover {
  background: #e9ecef;
  color: #495057;
  border-color: #dee2e6;
}

.action-btn:active {
  background: #dee2e6;
  transform: scale(0.98);
}

.action-btn.success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.action-btn i {
  font-size: 0.8rem;
}

/* Quill container styling */
.quill-container {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: border-color 0.3s ease;
  min-height: 200px;
}

.quill-container:focus-within {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Quill editor specific styling */
.ql-editor {
  min-height: 160px !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
}

.ql-toolbar {
  border-bottom: 1px solid #e9ecef !important;
  background: #f8f9fa !important;
}

/* Output quill styling - sfondo bianco come input */
.output-quill .ql-toolbar {
  background: #f8f9fa !important;
  border-bottom: 1px solid #e9ecef !important;
}

/* Nessun cursore durante streaming - solo testo pulito */
.output-quill .ql-editor {
  caret-color: transparent !important;
}

/* Cursore normale solo quando utente clicca */
.output-quill .ql-editor:focus {
  caret-color: #2c3e50 !important;
}

/* Nessun cursore durante streaming */
.streaming .ql-editor {
  caret-color: transparent !important;
}

/* STREAMING ADDITIONS */
/* Streaming indicator */
.streaming-indicator {
  display: none;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 10px;
  animation: pulse-stream 1.5s infinite;
  text-align: center;
}

.streaming-indicator.active {
  display: block;
}

@keyframes pulse-stream {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.98); }
}

.streaming-indicator i {
  margin-right: 6px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Typing cursor for streaming */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: #3498db;
  animation: blink 1s infinite;
  margin-left: 2px;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Progress bar per streaming */
.streaming-progress {
  width: 100%;
  height: 4px;
  background: #ecf0f1;
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0;
  display: none;
}

.streaming-progress.active {
  display: block;
}

.streaming-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2980b9);
  width: 0%;
  transition: width 0.3s ease;
}

/* IMPORTANTE: Assicurati che i termini evidenziati funzionino DENTRO Quill */
.ql-editor .term-db {
  background: linear-gradient(120deg, #27ae60 0%, #2ecc71 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  border-left: 3px solid #16a085 !important;
  box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  cursor: help !important;
  transition: all 0.2s ease !important;
}

.ql-editor .term-db:hover {
  background: linear-gradient(120deg, #2ecc71 0%, #27ae60 100%) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4) !important;
}

.ql-editor .term-marian {
  background: linear-gradient(120deg, #f39c12 0%, #e67e22 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  border-left: 3px solid #d35400 !important;
  box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  cursor: help !important;
  transition: all 0.2s ease !important;
}

.ql-editor .term-marian:hover {
  background: linear-gradient(120deg, #e67e22 0%, #f39c12 100%) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 3px 10px rgba(243, 156, 18, 0.4) !important;
}

.ql-editor .terms-highlight.fixed-term {
  background: linear-gradient(120deg, #e74c3c 0%, #c0392b 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  border-left: 3px solid #a93226 !important;
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  cursor: help !important;
}

.ql-editor .terms-highlight.fixed-term:hover {
  background: linear-gradient(120deg, #c0392b 0%, #e74c3c 100%) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4) !important;
}

.ql-editor .terms-highlight {
  background: linear-gradient(120deg, #3498db 0%, #2980b9 100%) !important;
  color: white !important;
  font-weight: 500 !important;
  padding: 2px 4px !important;
  border-radius: 4px !important;
  cursor: help !important;
  transition: all 0.2s ease !important;
}

.ql-editor .terms-highlight:hover {
  transform: scale(1.03) !important;
}

/* Termini dal dizionario fisso - priorità massima (ROSSO) */
.terms-highlight.fixed-term {
  background: linear-gradient(120deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  font-weight: 700;
  border-left: 3px solid #a93226;
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: help;
}

.terms-highlight.fixed-term:hover {
  background: linear-gradient(120deg, #c0392b 0%, #e74c3c 100%);
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
}

/* Termini dal database - priorità normale (VERDE) */
.term-db {
  background: linear-gradient(120deg, #27ae60 0%, #2ecc71 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  border-left: 3px solid #16a085 !important;
  box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  cursor: help !important;
  transition: all 0.2s ease !important;
}

.term-db:hover {
  background: linear-gradient(120deg, #2ecc71 0%, #27ae60 100%) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4) !important;
}

/* Correzioni MarianMT - priorità alta (ARANCIONE) */
.term-marian {
  background: linear-gradient(120deg, #f39c12 0%, #e67e22 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  border-left: 3px solid #d35400 !important;
  box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  cursor: help !important;
  transition: all 0.2s ease !important;
}

.term-marian:hover {
  background: linear-gradient(120deg, #e67e22 0%, #f39c12 100%) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 3px 10px rgba(243, 156, 18, 0.4) !important;
}

/* Termini generici evidenziati (BLU) */
.terms-highlight {
  background: linear-gradient(120deg, #3498db 0%, #2980b9 100%);
  color: white;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: help;
  transition: all 0.2s ease;
}

.terms-highlight:hover {
  transform: scale(1.03);
}

.translate-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 auto;
  display: block;
  position: relative;
  overflow: hidden;
  min-height: 50px;
}

.translate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.translate-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* DYNAMIC BUTTON STATES */
.translate-btn.loading {
  color: white;
  background: linear-gradient(45deg, #3498db, #2980b9);
  border-color: #3498db;
  cursor: wait;
}

.translate-btn.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: loading-sweep 2s infinite;
}

.translate-btn.loading .btn-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  transition: width 0.5s ease;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 2;
}

.translate-btn.loading .progress-text {
  position: relative;
  z-index: 3;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

span.badge.bg-premium {
  background-color: #ff8508 !important;
  border-color: #ff8508 !important;
}

@keyframes loading-sweep {
  0% { left: -100%; }
  100% { left: 100%; }
}

.translate-btn.success {
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  border-color: #27ae60;
  color: white;
}

.translate-btn.error {
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  border-color: #e74c3c;
  color: white;
}

.translate-btn.premium_processing {
  background: linear-gradient(45deg, #f39c12, #e67e22);
  border-color: #f39c12;
  color: white;
}

/* ANIMATED ICONS */
.translate-btn.loading .fa-brain {
  animation: pulse 1.2s infinite;
}

.translate-btn.loading .fa-stream {
  animation: stream-flow 1s infinite;
}

.translate-btn.loading .fa-database {
  animation: spin 2s linear infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes stream-flow {
  0% { transform: translateX(0); }
  50% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.stats-section {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.stat-badge {
  background: white;
  border: 2px solid #e9ecef;
  padding: 15px 25px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-badge:hover {
  border-color: #3498db;
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-top: 5px;
}

.confidence-meter {
  width: 100%;
  height: 8px;
  background: #ecf0f1;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #f39c12, #27ae60);
  transition: width 0.5s ease;
  width: 0%;
}

@media (max-width: 768px) {
  .translator-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .language-selector {
    flex-direction: column;
    gap: 15px;
  }
  
  .stats-section {
    flex-direction: column;
    gap: 15px;
  }
  
  /* Fix mobile layout per info-row */
  .info-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .info-left {
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
  }
  
  /* Assicura che word counter e bottone siano su una riga */
  #wordCounter {
    white-space: nowrap;
    margin-right: 8px;
  }
  
  .btn-premium {
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  /* Fix premium hint per mobile - sovrascrive desktop */
  .premium-hint {
    font-size: 0.65rem;
    word-break: break-word;
    line-height: 1.2;
    margin-top: 8px;
    margin-left: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: calc(100vw - 60px) !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box;
    hyphens: auto;
  }
  
  /* Info-left deve andare in colonna su mobile */
  .info-left {
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  
  /* Fix container width per mobile */
  .info-row {
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
    width: calc(100% + 40px);
  }
  
  /* Forza il testo a stare dentro il viewport */
  .translator-card {
    padding: 20px !important;
    margin: 0 10px !important;
  }
}

/* Footer informativo */
.translator-footer {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 25px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-top: 40px !important; /* Add proper spacing from card */
  margin-bottom: 30px !important; /* Add bottom margin for proper spacing */
}

/* Fix main container - remove background to match page */
.main-translator-container {
  background: transparent; /* No background color */
  min-height: calc(100vh - 200px);
  padding: 20px 0;
}

.translator-footer h6 {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.translator-footer h6 i {
  color: #3498db;
  margin-right: 8px;
  width: 20px;
}

.translator-footer p {
  color: #6c757d;
  line-height: 1.4;
  margin-bottom: 0;
}

/* Hide Puter.js popup/modal if it appears */
.puter-modal,
.puter-popup,
.puter-overlay,
[data-puter-modal],
[data-puter-popup] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

/* Hide any iframe or auth popups */
iframe[src*="puter"],
iframe[src*="auth"] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Make sure Puter runs in background */
.puter-background {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Nascondere streaming indicators per evitare duplicazione */
.streaming-indicator,
.streaming-progress {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.stats-section { display: none !important; }

/* Fix bordi Quill - tutti ARROTONDATI */
.quill-container,
.ql-container, 
.ql-toolbar {
  border-radius: 0 !important;
}

/* Fix doppio cursore - SEMPRE nasconde cursore nativo nell'output */
.output-quill .ql-editor {
  caret-color: transparent !important;
}

/* Cursore normale solo quando utente clicca DOPO streaming */
.output-quill .ql-editor:focus:not(.streaming) {
  caret-color: #2c3e50 !important;
}
.output-section {
  padding-bottom: 0;
}

/* INFO ROW - Separate row for counters and info */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: -25px;
  margin-bottom: 15px;
}

.info-left, .info-right {
  flex-direction: row;
  min-height: 21px;
  align-items: center;
}

.info-left {
  justify-content: flex-start;
}

.info-right {
  justify-content: flex-end;
}

/* Translation info alignment */
#translationInfo {
  margin: 0;
  padding: 0;
  line-height: 21px;
}

/* PREMIUM UI STYLES */
.btn-premium {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.75rem;
}

.btn-premium:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-premium i {
  color: #fff3cd;
}

.premium-hint {
  margin-top: 5px;
  font-size: 0.7rem;
  font-style: italic;
  white-space: nowrap; /* Desktop: su una linea */
  display: inline-block; /* Desktop: inline con il bottone */
  margin-left: 8px;
}

.premium-hint i {
  margin-right: 6px;
}

/* Assicura spazio dopo corona nel hint */
.premium-hint .fa-crown {
  margin-right: 8px;
}

/* Spazio tra word counter e bottone Premium */
#wordCounter + .btn-premium {
  margin-left: 12px;
}

/* Spazio nella corona del bottone Premium */
.btn-premium i {
  margin-right: 4px;
}

/* Premium Modal Styles */
.plan-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.premium-plan {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-color: #f39c12;
  position: relative;
  overflow: hidden;
}

.premium-plan::before {
  content: "RECOMMENDED";
  position: absolute;
  top: 25px;
  right: -33px;
  background: #e67e22;
  color: white;
  padding: 6px 35px;
  font-size: 0.6rem;
  font-weight: bold;
  transform: rotate(45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 1;
  text-align: center;
  white-space: nowrap;
}

.plan-features {
  text-align: left;
  margin: 15px 0;
}

.plan-features .feature {
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-price {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.plan-price .price {
  font-size: 1.8rem;
  font-weight: bold;
  color: #e67e22;
}

.plan-price small {
  font-size: 0.9rem;
  color: #6c757d;
}

.btn-premium-cta {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-premium-cta:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-premium-cta i {
  color: #fff3cd;
}

/* FREE MODE TEXTAREA STYLES */
.free-editor {
  border: 2px solid #e9ecef !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
  padding: 15px !important;
  resize: none !important; /* Disable manual resize */
  overflow-x: hidden !important; /* Hide horizontal scroll */
  overflow-y: hidden !important; /* Auto-resize handles this */
  white-space: pre-line !important; /* Preserve line breaks and paragraphs */
  word-wrap: break-word !important;
  transition: all 0.3s ease !important;
  min-height: 200px !important;
  /* No max-height - allow unlimited expansion like Quill */
}

.free-editor:focus {
  border-color: #3498db !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

/* PREMIUM MODE TIPTAP STYLES */
.premium-editor {
  border: 2px solid #e9ecef !important;
  border-radius: 8px !important;
  background: white !important;
  transition: all 0.3s ease !important;
  min-height: 200px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.premium-editor:focus-within {
  border-color: #3498db !important;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

.tiptap-toolbar {
  background: #f8f9fa !important;
  border-bottom: 1px solid #e9ecef !important;
  padding: 8px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  gap: 4px !important;
}

.toolbar-btn {
  background: #fff !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  cursor: pointer !important;
  font-size: 0.875rem !important;
  transition: background 0.2s ease !important;
}

.toolbar-btn:hover {
  background: #e9ecef !important;
}

.tiptap-editor-content {
  flex: 1 !important;
  min-height: 160px !important;
  padding: 15px !important;
  outline: none !important;
  overflow-y: auto !important;
}

.tiptap-editor-content p {
  margin: 0 0 1em 0 !important;
}

.tiptap-editor-content p:last-child {
  margin-bottom: 0 !important;
}

.premium-editor.readonly {
  background: #f8f9fa !important;
}

.premium-editor.readonly .tiptap-toolbar {
  background: #f0f0f0 !important;
}

/* Fix ProseMirror base styles */
.ProseMirror {
  outline: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

.ProseMirror p {
  margin: 0 0 1em 0 !important;
}

.ProseMirror p:last-child {
  margin-bottom: 0 !important;
}

/* FREE MODE: Hide Quill toolbar for basic experience */
.free-mode .ql-toolbar {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* FREE MODE: Adjust container when toolbar is hidden */
.free-mode .quill-container {
  border-radius: 8px !important;
}

.free-mode .ql-container {
  border-top: 2px solid #e9ecef !important;
  border-radius: 8px !important;
}