:root { --nj-entry: 22; }

.nj22-line-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 10px;
  margin-block: 12px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f5f7fa;
}
.nj22-line-editor[hidden] { display: none !important; }
.nj22-line-editor > strong, .nj22-editor-actions { grid-column: 1 / -1; }
.nj22-line-editor label { display: grid; gap: 5px; min-width: 0; }
.nj22-line-editor input { width: 100%; direction: ltr; text-align: start; }
.nj22-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ui22 .nj22-line-actions button, .ui22 .nj22-editor-actions button {
  min-height: 36px;
  padding: 5px 10px;
  margin: 2px;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
.ui22 .nj22-editor-actions button:first-child { background: #1a73e8; color: white; }
.nj22-serial-count { display: block; margin-block: 5px; color: #1a73e8; }
.nj22-save-facts {
  display: flex;
  flex: 1 0 100%;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}
.nj22-save-facts > div {
  flex: 1 1 135px;
  padding: 8px 10px;
  border: 1px solid #c9ded1;
  border-radius: 8px;
  background: #fff;
}
.nj22-save-facts dt { font-size: .82rem; }
.nj22-save-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .ui22 .nj22-line-actions button, .ui22 .nj22-editor-actions button { min-height: 44px; }
}

/* ==========================================================================
   Al-Najah v3 Modern Inline Line Editor & Save Facts
   ========================================================================== */
.nj22-line-editor {
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8f0fe 100%);
  padding: 16px 18px;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.nj22-line-editor > strong {
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
}
.ui22 .nj22-line-actions button,
.ui22 .nj22-editor-actions button {
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: background .15s, border-color .15s;
}
.ui22 .nj22-line-actions button:hover,
.ui22 .nj22-editor-actions button:hover {
  background: #e8f0fe;
  border-color: #3b82f6;
}
.ui22 .nj22-editor-actions button:first-child {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  border-color: #1557b0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}
.nj22-save-facts > div {
  border-radius: 12px;
  border: 1px solid #d4e4da;
  background: #f8fcf9;
  padding: 10px 14px;
}
