.research-and-write-container1 {
  display: contents;
}
 
.research-and-write-thq-job-form-card-container-elm {
  min-height: auto !important;
  height: auto !important;
}
 
.research-and-write-thq-job-form-card-wrapper-elm {
  min-height: auto !important;
  height: auto !important;
  padding-bottom: 0 !important;
}
 
.research-and-write-thq-job-form-card-form-elm {
  min-height: auto !important;
  height: auto !important;
}
 
.research-and-write-thq-job-form-card-input-elm4 {
  width: 795px;
}
 
.research-and-write-thq-job-form-card-footer-elm {
  border: 2px dashed rgba(120, 120, 120, 0.4);
}
 
.research-and-write-thq-btn-elm {
  text-align: center;
  align-items: center;
  justify-content: center;
  display: flex;
  gap: 10px;
}
 
.research-and-write-container2 {
  display: none;
}
 
.research-and-write-container3 {
  display: contents;
}

/* TOP NAV */
.top-nav {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 40px;
  background:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.05);
}

.nav-left {
  display:flex;
  align-items:center;
  gap:40px;
}

.logo {
  font-weight:700;
  font-size:22px;
  color:#0b5cff;
}

.nav-links a {
  margin-right:22px;
  font-weight:500;
  color:#444;
}

.nav-links a.active {
  color:#0b5cff;
}

.nav-right a {
  margin-left:14px;
}

.btn-outline {
  border:2px solid #0b5cff;
  padding:8px 16px;
  border-radius:10px;
}

.btn-primary {
  background:#0b5cff;
  color:#fff;
  padding:10px 18px;
  border-radius:12px;
}

/* Button styling improvements */
.job-form-card-button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0 20px 0;
  margin-top: 0px;
}

/* Your Paper textarea styling */
#output_paper {
  font-family: 'Courier New', monospace;
  line-height: 1.8;
  padding: 20px;
}

/* Paper Action Buttons */
.paper-content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 20px;
}

.paper-textarea-container {
  min-width: 0;
}

.paper-charges-sidebar {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.charges-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #d1d5db;
}

.charges-breakdown {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.charges-section {
  padding: 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.charges-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.charge-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: #4b5563;
}

.charge-item.total {
  border-top: 2px solid #d1d5db;
  margin-top: 8px;
  padding-top: 10px;
  font-size: 15px;
  color: #1f2937;
}

.charge-item.pending {
  color: #f59e0b;
  font-style: italic;
}

.charge-item.credit-used {
  color: #059669;
}

.charge-separator {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.paper-action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 8px;
}

.btn-paper-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-paper-action svg {
  width: 18px;
  height: 18px;
}

.btn-paper-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .paper-content-layout {
    grid-template-columns: 1fr;
  }
  
  .paper-charges-sidebar {
    position: static;
  }
  
  .paper-action-buttons {
    flex-direction: column;
  }
  
  .btn-paper-action {
    width: 100%;
    justify-content: center;
  }
}

/* PREVIEW MODAL */
.preview-modal {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.6);
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding: 20px;
}

.preview-modal-content {
  background:#fff;
  padding:28px;
  width:100%;
  max-width:720px;
  border-radius:14px;
  max-height:90vh;
  overflow:auto;
}

.preview-modal-large {
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
}

.preview-split-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  margin: 16px 0;
}

.preview-left,
.preview-right {
  min-height: auto;
}

.preview-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}

.preview-table {
  width:100%;
  border-collapse:collapse;
  margin-bottom: 8px;
}

.preview-table th,
.preview-table td {
  text-align:left;
  padding:6px 8px;
  border-bottom:1px solid #eee;
  font-size: 13px;
  line-height: 1.3;
}

.preview-table th {
  width:42%;
  color:#555;
  font-weight: 500;
}

.preview-table td {
  color: #1f2937;
}

.preview-instructions-container {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0;
  max-height: 140px;
  overflow: hidden;
}

.preview-instructions-scroll {
  max-height: 140px;
  overflow-y: auto;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #555;
  white-space: pre-wrap;
}

/* Billing Breakdown - Accounting Style */
.billing-breakdown {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
}

.billing-section {
  margin-bottom: 12px;
}

.billing-subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.billing-line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.3;
}

.billing-item-label {
  flex: 1;
}

.billing-item-amount {
  font-weight: 500;
  color: #1f2937;
  min-width: 70px;
  text-align: right;
  font-size: 12px;
}

.billing-item-amount.credit {
  color: #059669;
  font-weight: 600;
}

.billing-line-item.subtotal {
  border-top: 1px solid #d1d5db;
  padding-top: 6px;
  margin-top: 3px;
  font-weight: 600;
  font-size: 12px;
}

.billing-line-item.total {
  background: #0b5cff;
  color: white;
  margin: 8px -6px 0 -6px;
  padding: 10px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.billing-line-item.total .billing-item-label,
.billing-line-item.total .billing-item-amount {
  color: white;
  font-size: 14px;
}

.billing-separator {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.billing-separator-thick {
  height: 2px;
  background: #d1d5db;
  margin: 10px 0;
}

.billing-note {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: #92400e;
  margin-top: 10px;
  line-height: 1.4;
}

.subscriber-status-note {
  background: #dbeafe;
  border-left: 3px solid #0b5cff;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #1e40af;
  margin-top: 14px;
  line-height: 1.4;
}

.pdf-agreement-box {
  background: #fffbeb;
  border: 2px solid #fbbf24;
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
}

.pdf-agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: #92400e;
  line-height: 1.4;
  font-weight: 500;
}

.pdf-agreement-checkbox {
  margin-top: 2px;
  cursor: pointer;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.pdf-agreement-text {
  flex: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #9ca3af !important;
  border-color: #9ca3af !important;
}

.preview-actions {
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:18px;
  padding-top: 16px;
  border-top: 2px solid #e5e7eb;
}

@media (max-width: 1024px) {
  .preview-split-layout {
    grid-template-columns: 1fr;
  }
  
  .preview-modal-large {
    max-width: 90%;
  }
}

/* Tight spacing for consecutive rows */
.row-tight {
  margin-bottom: 0px;
}

/* Make file input more compact */
.file-input-compact {
  max-width: 100%;
  font-size: 14px;
}

/* NEW: 3 column grid for all form rows */
.job-form-card-row-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 0px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .job-form-card-row-grid-3col {
    grid-template-columns: 1fr;
  }
  
  .paper-action-buttons {
    flex-direction: column;
  }
  
  .btn-paper-action {
    width: 100%;
    justify-content: center;
  }
}

/* SUBSCRIBER STATUS SECTION */
.subscriber-status-section {
  margin-top: 20px;
}

.subscription-info {
  background: #f7f9fc;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.subscription-period {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
}

.period-label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.period-dates {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #555;
}

.date-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.date-label {
  font-size: 11px;
  color: #777;
  margin-bottom: 2px;
}

.date-value {
  font-weight: 600;
  color: #0b5cff;
  font-size: 13px;
}



.credit-card {
  background: white;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  text-align: center;
  transition: all 0.3s ease;
}

.credit-card:hover {
  border-color: #0b5cff;
  box-shadow: 0 4px 12px rgba(11, 92, 255, 0.1);
}

.credit-title {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.credit-amount {
  font-size: 32px;
  font-weight: 700;
  color: #0b5cff;
  margin-bottom: 4px;
  line-height: 1;
}

.credit-unit {
  font-size: 12px;
  color: #999;
}

.credit-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff9e6;
  border-left: 3px solid #ffc107;
  border-radius: 5px;
  font-size: 12px;
  color: #856404;
  line-height: 1.4;
}

@media (max-width: 768px) {
  
  
  .period-dates {
    flex-direction: column;
    gap: 10px;
  }
}

/* SUBSCRIBER STATUS - Total Charges Section */
.total-charges-section {
  background: #f0fdf4;
  border: 2px solid #10b981;
  border-radius: 10px;
  padding: 16px;
  margin-top: 20px;
}

.total-charges-title {
  font-size: 14px;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-charges-amount {
  font-size: 32px;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 12px;
  text-align: center;
}

.total-charges-breakdown {
  border-top: 1px solid #a7f3d0;
  padding-top: 12px;
}

.charge-breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #047857;
}

/* Non-Subscriber Overlay */
.subscriber-wrapper {
  position: relative;
}

.non-subscriber-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  z-index: 10;
}

.overlay-content {
  text-align: center;
  padding: 30px;
  max-width: 400px;
}

.overlay-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}

.overlay-content p {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.5;
}

.subscriber-wrapper.grayed-out {
  opacity: 0.5;
  pointer-events: none;
}

.token-log-section {
  margin-top: 20px;
}
.token-log-section table th,
.token-log-section table td {
  font-size: 13px;
}


/* FORCE token cards to occupy full row */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Add to research-and-write.css */
.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.preview-modal-content {
  animation: slideUp 0.3s ease;
}

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